From 2705ed6585043fd8956497bd256a930aedbff297 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 7 Nov 2024 10:03:08 +0000 Subject: [PATCH] CodeGen from PR 31233 in Azure/azure-rest-api-specs Merge 64753557884aef104ad262f09b078205c14006a9 into cb96711fe5924dd4b642f6ffc9195db3467ea2ed --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 104 + .../SAMPLE.md | 22271 ++++++++++++++++ .../pom.xml | 63 + .../network/generated/NetworkManager.java | 2586 ++ .../fluent/AdminRuleCollectionsClient.java | 193 + .../generated/fluent/AdminRulesClient.java | 202 + ...tewayPrivateEndpointConnectionsClient.java | 208 + ...tionGatewayPrivateLinkResourcesClient.java | 48 + ...ationGatewayWafDynamicManifestsClient.java | 42 + ...ewayWafDynamicManifestsDefaultsClient.java | 42 + .../fluent/ApplicationGatewaysClient.java | 654 + .../ApplicationSecurityGroupsClient.java | 242 + .../fluent/AvailableDelegationsClient.java | 43 + .../AvailableEndpointServicesClient.java | 43 + .../AvailablePrivateEndpointTypesClient.java | 69 + ...ailableResourceGroupDelegationsClient.java | 45 + .../fluent/AvailableServiceAliasesClient.java | 73 + .../fluent/AzureFirewallFqdnTagsClient.java | 38 + .../fluent/AzureFirewallsClient.java | 387 + .../generated/fluent/BastionHostsClient.java | 269 + .../fluent/BgpServiceCommunitiesClient.java | 38 + .../ConfigurationPolicyGroupsClient.java | 216 + .../fluent/ConnectionMonitorsClient.java | 419 + .../ConnectivityConfigurationsClient.java | 191 + .../fluent/CustomIpPrefixesClient.java | 241 + .../fluent/DdosCustomPoliciesClient.java | 192 + .../fluent/DdosProtectionPlansClient.java | 240 + .../fluent/DefaultSecurityRulesClient.java | 74 + .../fluent/DscpConfigurationsClient.java | 211 + ...pressRouteCircuitAuthorizationsClient.java | 207 + .../ExpressRouteCircuitConnectionsClient.java | 228 + .../ExpressRouteCircuitPeeringsClient.java | 201 + .../fluent/ExpressRouteCircuitsClient.java | 511 + .../fluent/ExpressRouteConnectionsClient.java | 203 + ...essRouteCrossConnectionPeeringsClient.java | 208 + .../ExpressRouteCrossConnectionsClient.java | 415 + .../fluent/ExpressRouteGatewaysClient.java | 278 + .../fluent/ExpressRouteLinksClient.java | 74 + .../ExpressRoutePortAuthorizationsClient.java | 208 + .../fluent/ExpressRoutePortsClient.java | 273 + .../ExpressRoutePortsLocationsClient.java | 68 + ...ressRouteProviderPortsLocationsClient.java | 39 + .../ExpressRouteServiceProvidersClient.java | 38 + .../fluent/FirewallPoliciesClient.java | 241 + .../FirewallPolicyDeploymentsClient.java | 69 + .../fluent/FirewallPolicyDraftsClient.java | 101 + .../FirewallPolicyIdpsSignaturesClient.java | 49 + ...olicyIdpsSignaturesFilterValuesClient.java | 49 + ...llPolicyIdpsSignaturesOverridesClient.java | 136 + ...PolicyRuleCollectionGroupDraftsClient.java | 111 + ...ewallPolicyRuleCollectionGroupsClient.java | 206 + .../generated/fluent/FlowLogsClient.java | 234 + .../fluent/HubRouteTablesClient.java | 202 + .../HubVirtualNetworkConnectionsClient.java | 209 + .../fluent/InboundNatRulesClient.java | 202 + .../InboundSecurityRuleOperationsClient.java | 121 + .../generated/fluent/IpAllocationsClient.java | 239 + .../generated/fluent/IpGroupsClient.java | 256 + ...LoadBalancerBackendAddressPoolsClient.java | 202 + ...alancerFrontendIpConfigurationsClient.java | 77 + .../LoadBalancerLoadBalancingRulesClient.java | 74 + .../LoadBalancerNetworkInterfacesClient.java | 43 + .../LoadBalancerOutboundRulesClient.java | 74 + .../fluent/LoadBalancerProbesClient.java | 74 + .../generated/fluent/LoadBalancersClient.java | 396 + .../fluent/LocalNetworkGatewaysClient.java | 219 + ...tGroupNetworkManagerConnectionsClient.java | 134 + .../generated/fluent/NatGatewaysClient.java | 239 + .../generated/fluent/NatRulesClient.java | 202 + .../generated/fluent/NetworkGroupsClient.java | 181 + ...etworkInterfaceIpConfigurationsClient.java | 76 + .../NetworkInterfaceLoadBalancersClient.java | 43 + ...tworkInterfaceTapConfigurationsClient.java | 204 + .../fluent/NetworkInterfacesClient.java | 629 + .../fluent/NetworkManagementClient.java | 1029 + .../fluent/NetworkManagerCommitsClient.java | 79 + ...nagerDeploymentStatusOperationsClient.java | 51 + ...orkManagerRoutingConfigurationsClient.java | 180 + .../fluent/NetworkManagersClient.java | 224 + .../fluent/NetworkProfilesClient.java | 210 + .../fluent/NetworkSecurityGroupsClient.java | 243 + ...workVirtualApplianceConnectionsClient.java | 210 + .../NetworkVirtualAppliancesClient.java | 310 + .../fluent/NetworkWatchersClient.java | 978 + .../generated/fluent/OperationsClient.java | 38 + .../fluent/P2SVpnGatewaysClient.java | 583 + .../fluent/PacketCapturesClient.java | 322 + ...rExpressRouteCircuitConnectionsClient.java | 84 + .../fluent/PrivateDnsZoneGroupsClient.java | 204 + .../fluent/PrivateEndpointsClient.java | 224 + .../fluent/PrivateLinkServicesClient.java | 583 + .../fluent/PublicIpAddressesClient.java | 519 + .../fluent/PublicIpPrefixesClient.java | 241 + .../fluent/ResourceNavigationLinksClient.java | 46 + .../fluent/ResourceProvidersClient.java | 564 + .../fluent/RouteFilterRulesClient.java | 200 + .../generated/fluent/RouteFiltersClient.java | 240 + .../generated/fluent/RouteMapsClient.java | 202 + .../generated/fluent/RouteTablesClient.java | 239 + .../generated/fluent/RoutesClient.java | 199 + .../fluent/RoutingIntentsClient.java | 202 + .../fluent/RoutingRuleCollectionsClient.java | 192 + .../generated/fluent/RoutingRulesClient.java | 202 + .../fluent/ScopeConnectionsClient.java | 142 + .../SecurityAdminConfigurationsClient.java | 179 + .../SecurityPartnerProvidersClient.java | 244 + .../generated/fluent/SecurityRulesClient.java | 201 + .../SecurityUserConfigurationsClient.java | 179 + .../SecurityUserRuleCollectionsClient.java | 193 + .../fluent/SecurityUserRulesClient.java | 202 + .../fluent/ServiceAssociationLinksClient.java | 46 + .../fluent/ServiceEndpointPoliciesClient.java | 243 + ...erviceEndpointPolicyDefinitionsClient.java | 217 + .../fluent/ServiceTagInformationsClient.java | 50 + .../generated/fluent/ServiceTagsClient.java | 45 + .../generated/fluent/StaticMembersClient.java | 151 + .../generated/fluent/SubnetsClient.java | 341 + ...iptionNetworkManagerConnectionsClient.java | 123 + .../generated/fluent/UsagesClient.java | 41 + .../generated/fluent/VipSwapsClient.java | 140 + .../fluent/VirtualApplianceSitesClient.java | 205 + .../fluent/VirtualApplianceSkusClient.java | 66 + .../VirtualHubBgpConnectionsClient.java | 325 + .../VirtualHubIpConfigurationsClient.java | 205 + .../fluent/VirtualHubRouteTableV2SClient.java | 214 + .../generated/fluent/VirtualHubsClient.java | 436 + ...irtualNetworkGatewayConnectionsClient.java | 683 + .../VirtualNetworkGatewayNatRulesClient.java | 207 + .../fluent/VirtualNetworkGatewaysClient.java | 1227 + .../fluent/VirtualNetworkPeeringsClient.java | 215 + .../fluent/VirtualNetworkTapsClient.java | 238 + .../fluent/VirtualNetworksClient.java | 338 + .../fluent/VirtualRouterPeeringsClient.java | 213 + .../fluent/VirtualRoutersClient.java | 223 + .../generated/fluent/VirtualWansClient.java | 238 + .../fluent/VpnConnectionsClient.java | 331 + .../generated/fluent/VpnGatewaysClient.java | 444 + .../fluent/VpnLinkConnectionsClient.java | 362 + ...ationsAssociatedWithVirtualWansClient.java | 74 + .../fluent/VpnServerConfigurationsClient.java | 247 + .../fluent/VpnSiteLinkConnectionsClient.java | 49 + .../generated/fluent/VpnSiteLinksClient.java | 74 + .../generated/fluent/VpnSitesClient.java | 238 + .../fluent/VpnSitesConfigurationsClient.java | 76 + .../WebApplicationFirewallPoliciesClient.java | 179 + .../generated/fluent/WebCategoriesClient.java | 65 + ...ectivityConfigurationsListResultInner.java | 134 + ...tiveSecurityAdminRulesListResultInner.java | 134 + .../fluent/models/AdminPropertiesFormat.java | 394 + .../models/AdminRuleCollectionInner.java | 240 + .../AdminRuleCollectionPropertiesFormat.java | 174 + ...enticationCertificatePropertiesFormat.java | 115 + ...cationGatewayAvailableSslOptionsInner.java | 275 + ...ayAvailableSslOptionsPropertiesFormat.java | 201 + ...atewayAvailableWafRuleSetsResultInner.java | 102 + ...wayBackendAddressPoolPropertiesFormat.java | 146 + .../ApplicationGatewayBackendHealthInner.java | 104 + ...tionGatewayBackendHealthOnDemandInner.java | 135 + ...cationGatewayBackendHealthServerInner.java | 186 + ...ayBackendHttpSettingsPropertiesFormat.java | 491 + ...atewayBackendSettingsPropertiesFormat.java | 300 + ...atewayFirewallRuleSetPropertiesFormat.java | 228 + ...ontendIpConfigurationPropertiesFormat.java | 237 + ...onGatewayFrontendPortPropertiesFormat.java | 114 + ...onGatewayHttpListenerPropertiesFormat.java | 389 + .../models/ApplicationGatewayInner.java | 1118 + ...atewayIpConfigurationPropertiesFormat.java | 116 + ...cationGatewayListenerPropertiesFormat.java | 262 + ...oadDistributionPolicyPropertiesFormat.java | 157 + ...oadDistributionTargetPropertiesFormat.java | 129 + ...cationGatewayPathRulePropertiesFormat.java | 290 + ...GatewayPrivateEndpointConnectionInner.java | 215 + ...vateEndpointConnectionPropertiesInner.java | 161 + ...wayPrivateLinkConfigurationProperties.java | 124 + ...yPrivateLinkIpConfigurationProperties.java | 207 + ...cationGatewayPrivateLinkResourceInner.java | 201 + ...nGatewayPrivateLinkResourceProperties.java | 131 + ...plicationGatewayProbePropertiesFormat.java | 429 + .../ApplicationGatewayPropertiesFormat.java | 1304 + ...RedirectConfigurationPropertiesFormat.java | 306 + ...wayRequestRoutingRulePropertiesFormat.java | 353 + ...GatewayRewriteRuleSetPropertiesFormat.java | 121 + ...ionGatewayRoutingRulePropertiesFormat.java | 232 + ...GatewaySslCertificatePropertiesFormat.java | 188 + ...cationGatewaySslPredefinedPolicyInner.java | 178 + ...aySslPredefinedPolicyPropertiesFormat.java | 134 + ...tionGatewaySslProfilePropertiesFormat.java | 191 + ...stedClientCertificatePropertiesFormat.java | 149 + ...rustedRootCertificatePropertiesFormat.java | 146 + ...tionGatewayUrlPathMapPropertiesFormat.java | 270 + ...wayWafDynamicManifestPropertiesResult.java | 173 + ...nGatewayWafDynamicManifestResultInner.java | 220 + .../models/ApplicationSecurityGroupInner.java | 213 + ...licationSecurityGroupPropertiesFormat.java | 104 + .../models/AuthorizationPropertiesFormat.java | 160 + .../AutoApprovedPrivateLinkServiceInner.java | 95 + .../models/AvailableDelegationInner.java | 207 + .../AvailablePrivateEndpointTypeInner.java | 206 + .../models/AvailableProvidersListInner.java | 108 + .../models/AvailableServiceAliasInner.java | 177 + ...icationRuleCollectionPropertiesFormat.java | 183 + .../models/AzureFirewallFqdnTagInner.java | 210 + .../AzureFirewallFqdnTagPropertiesFormat.java | 101 + .../fluent/models/AzureFirewallInner.java | 529 + ...rewallIpConfigurationPropertiesFormat.java | 165 + ...reFirewallNatRuleCollectionProperties.java | 182 + ...NetworkRuleCollectionPropertiesFormat.java | 183 + .../models/AzureFirewallPropertiesFormat.java | 502 + .../models/AzureReachabilityReportInner.java | 181 + .../fluent/models/AzureWebCategoryInner.java | 171 + .../AzureWebCategoryPropertiesFormat.java | 82 + ...ddressInboundNatRulePortMappingsInner.java | 105 + .../models/BackendAddressPoolInner.java | 362 + .../BackendAddressPoolPropertiesFormat.java | 364 + .../fluent/models/BaseAdminRuleInner.java | 210 + .../models/BastionActiveSessionInner.java | 244 + .../fluent/models/BastionHostInner.java | 543 + ...onHostIpConfigurationPropertiesFormat.java | 189 + .../models/BastionHostPropertiesFormat.java | 440 + .../models/BastionSessionStateInner.java | 113 + .../models/BastionShareableLinkInner.java | 153 + .../fluent/models/BgpConnectionInner.java | 246 + .../models/BgpConnectionProperties.java | 186 + .../models/BgpPeerStatusListResultInner.java | 99 + .../models/BgpServiceCommunityInner.java | 223 + .../BgpServiceCommunityPropertiesFormat.java | 130 + .../models/ConnectionMonitorParameters.java | 353 + .../ConnectionMonitorQueryResultInner.java | 131 + .../models/ConnectionMonitorResultInner.java | 434 + .../ConnectionMonitorResultProperties.java | 283 + .../models/ConnectionResetSharedKeyInner.java | 95 + .../models/ConnectionSharedKeyInner.java | 113 + .../ConnectionSharedKeyResultInner.java | 156 + .../ConnectivityConfigurationInner.java | 337 + .../ConnectivityConfigurationProperties.java | 302 + .../models/ConnectivityInformationInner.java | 185 + ...nterfaceConfigurationPropertiesFormat.java | 160 + ...erfaceIpConfigurationPropertiesFormat.java | 88 + ...ainerNetworkInterfacePropertiesFormat.java | 162 + .../fluent/models/CustomIpPrefixInner.java | 534 + .../CustomIpPrefixPropertiesFormat.java | 441 + .../fluent/models/DdosCustomPolicyInner.java | 212 + .../DdosCustomPolicyPropertiesFormat.java | 103 + .../models/DdosProtectionPlanInner.java | 223 + .../DdosProtectionPlanPropertiesFormat.java | 141 + .../models/DefaultAdminPropertiesFormat.java | 293 + .../models/DefaultRuleSetPropertyFormat.java | 121 + .../DnsNameAvailabilityResultInner.java | 94 + .../fluent/models/DscpConfigurationInner.java | 394 + .../DscpConfigurationPropertiesFormat.java | 368 + ...veNetworkSecurityGroupListResultInner.java | 118 + .../models/EffectiveRouteListResultInner.java | 116 + .../EffectiveRouteMapRouteListInner.java | 101 + .../models/EndpointServiceResultInner.java | 109 + ...ExpressRouteCircuitAuthorizationInner.java | 229 + .../ExpressRouteCircuitConnectionInner.java | 305 + ...outeCircuitConnectionPropertiesFormat.java | 260 + .../models/ExpressRouteCircuitInner.java | 585 + .../ExpressRouteCircuitPeeringInner.java | 591 + ...teCircuitPeeringPropertiesFormatInner.java | 643 + .../ExpressRouteCircuitPropertiesFormat.java | 543 + .../models/ExpressRouteCircuitStatsInner.java | 180 + ...sRouteCircuitsArpTableListResultInner.java | 130 + ...uteCircuitsRoutesTableListResultInner.java | 130 + ...uitsRoutesTableSummaryListResultInner.java | 132 + .../models/ExpressRouteConnectionInner.java | 313 + .../ExpressRouteConnectionListInner.java | 100 + .../ExpressRouteConnectionProperties.java | 307 + .../ExpressRouteCrossConnectionInner.java | 345 + ...pressRouteCrossConnectionPeeringInner.java | 428 + ...RouteCrossConnectionPeeringProperties.java | 452 + ...ExpressRouteCrossConnectionProperties.java | 296 + ...ionsRoutesTableSummaryListResultInner.java | 122 + .../models/ExpressRouteGatewayInner.java | 300 + .../models/ExpressRouteGatewayListInner.java | 99 + .../models/ExpressRouteGatewayProperties.java | 225 + .../fluent/models/ExpressRouteLinkInner.java | 257 + .../ExpressRouteLinkPropertiesFormat.java | 247 + .../ExpressRoutePortAuthorizationInner.java | 201 + ...outePortAuthorizationPropertiesFormat.java | 137 + .../fluent/models/ExpressRoutePortInner.java | 411 + .../ExpressRoutePortPropertiesFormat.java | 339 + .../ExpressRoutePortsLocationInner.java | 232 + ...essRoutePortsLocationPropertiesFormat.java | 156 + .../models/ExpressRouteProviderPortInner.java | 334 + ...pressRouteProviderPortListResultInner.java | 117 + .../ExpressRouteProviderPortProperties.java | 258 + .../ExpressRouteServiceProviderInner.java | 235 + ...sRouteServiceProviderPropertiesFormat.java | 152 + .../models/FirewallPolicyDraftInner.java | 391 + .../models/FirewallPolicyDraftProperties.java | 353 + .../fluent/models/FirewallPolicyInner.java | 534 + .../FirewallPolicyPropertiesFormat.java | 505 + ...llPolicyRuleCollectionGroupDraftInner.java | 204 + ...icyRuleCollectionGroupDraftProperties.java | 150 + ...irewallPolicyRuleCollectionGroupInner.java | 230 + ...llPolicyRuleCollectionGroupProperties.java | 168 + .../models/FlowLogInformationInner.java | 313 + .../generated/fluent/models/FlowLogInner.java | 407 + .../fluent/models/FlowLogProperties.java | 224 + .../models/FlowLogPropertiesFormat.java | 326 + .../models/FrontendIpConfigurationInner.java | 404 + ...dIpConfigurationPropertiesFormatInner.java | 369 + .../models/GatewayRouteListResultInner.java | 99 + ...nerateExpressRoutePortsLoaResultInner.java | 95 + .../fluent/models/HopLinkProperties.java | 113 + .../models/HubIpConfigurationInner.java | 261 + ...bIpConfigurationPropertiesFormatInner.java | 208 + .../fluent/models/HubRouteTableInner.java | 235 + .../models/HubRouteTableProperties.java | 180 + .../HubVirtualNetworkConnectionInner.java | 274 + ...HubVirtualNetworkConnectionProperties.java | 238 + .../InboundNatPoolPropertiesFormat.java | 343 + .../fluent/models/InboundNatRuleInner.java | 430 + .../InboundNatRulePropertiesFormatInner.java | 425 + .../models/InboundSecurityRuleInner.java | 219 + .../models/InboundSecurityRuleProperties.java | 152 + .../IpAddressAvailabilityResultInner.java | 156 + .../fluent/models/IpAllocationInner.java | 349 + .../models/IpAllocationPropertiesFormat.java | 271 + .../fluent/models/IpConfigurationInner.java | 247 + .../models/IpConfigurationProfileInner.java | 193 + ...igurationProfilePropertiesFormatInner.java | 118 + .../IpConfigurationPropertiesFormatInner.java | 208 + .../generated/fluent/models/IpGroupInner.java | 244 + .../models/IpGroupPropertiesFormat.java | 149 + .../fluent/models/IpPrefixesListInner.java | 95 + ...alancerBackendAddressPropertiesFormat.java | 261 + .../fluent/models/LoadBalancerInner.java | 454 + .../models/LoadBalancerPropertiesFormat.java | 363 + ...uestFrontendIpConfigurationProperties.java | 100 + .../fluent/models/LoadBalancingRuleInner.java | 466 + .../LoadBalancingRulePropertiesFormat.java | 466 + .../models/LocalNetworkGatewayInner.java | 311 + .../LocalNetworkGatewayPropertiesFormat.java | 222 + .../fluent/models/MigratedPoolsInner.java | 96 + .../fluent/models/NatGatewayInner.java | 350 + .../models/NatGatewayPropertiesFormat.java | 207 + ...kConfigurationDiagnosticResponseInner.java | 90 + .../fluent/models/NetworkGroupInner.java | 238 + .../fluent/models/NetworkGroupProperties.java | 156 + .../fluent/models/NetworkInterfaceInner.java | 601 + .../NetworkInterfaceIpConfigurationInner.java | 510 + ...eIpConfigurationPropertiesFormatInner.java | 547 + ...NetworkInterfacePropertiesFormatInner.java | 617 + ...NetworkInterfaceTapConfigurationInner.java | 194 + ...TapConfigurationPropertiesFormatInner.java | 119 + .../models/NetworkManagerCommitInner.java | 185 + .../models/NetworkManagerConnectionInner.java | 230 + .../NetworkManagerConnectionProperties.java | 140 + ...anagerDeploymentStatusListResultInner.java | 133 + ...nectivityConfigurationListResultInner.java | 138 + ...tiveSecurityAdminRulesListResultInner.java | 137 + .../fluent/models/NetworkManagerInner.java | 299 + .../models/NetworkManagerProperties.java | 208 + ...tworkManagerRoutingConfigurationInner.java | 216 + ...rRoutingConfigurationPropertiesFormat.java | 130 + .../fluent/models/NetworkProfileInner.java | 247 + .../NetworkProfilePropertiesFormat.java | 162 + .../models/NetworkSecurityGroupInner.java | 295 + .../NetworkSecurityGroupPropertiesFormat.java | 249 + ...etworkVirtualApplianceConnectionInner.java | 279 + ...kVirtualApplianceConnectionProperties.java | 267 + .../models/NetworkVirtualApplianceInner.java | 578 + ...tworkVirtualApplianceInstanceIdsInner.java | 102 + ...tworkVirtualAppliancePropertiesFormat.java | 581 + .../NetworkVirtualApplianceSkuInner.java | 238 + ...rkVirtualApplianceSkuPropertiesFormat.java | 139 + .../fluent/models/NetworkWatcherInner.java | 200 + .../NetworkWatcherPropertiesFormat.java | 84 + .../fluent/models/NextHopResultInner.java | 155 + .../fluent/models/OperationInner.java | 197 + .../models/OperationPropertiesFormat.java | 99 + .../fluent/models/OutboundRuleInner.java | 314 + .../models/OutboundRulePropertiesFormat.java | 285 + .../P2SConnectionConfigurationProperties.java | 231 + .../models/P2SVpnConnectionHealthInner.java | 95 + .../fluent/models/P2SVpnGatewayInner.java | 354 + .../models/P2SVpnGatewayProperties.java | 287 + .../models/PacketCaptureParameters.java | 389 + .../PacketCaptureQueryStatusResultInner.java | 250 + .../models/PacketCaptureResultInner.java | 388 + .../models/PacketCaptureResultProperties.java | 244 + ...eerExpressRouteCircuitConnectionInner.java | 304 + ...outeCircuitConnectionPropertiesFormat.java | 254 + .../models/PrivateDnsZoneGroupInner.java | 181 + .../PrivateDnsZoneGroupPropertiesFormat.java | 124 + .../PrivateDnsZonePropertiesFormat.java | 117 + .../PrivateEndpointConnectionInner.java | 225 + ...vateEndpointConnectionPropertiesInner.java | 173 + .../fluent/models/PrivateEndpointInner.java | 420 + ...vateEndpointIpConfigurationProperties.java | 155 + .../PrivateEndpointPropertiesInner.java | 356 + ...rivateLinkServiceConnectionProperties.java | 211 + .../models/PrivateLinkServiceInner.java | 427 + ...rivateLinkServiceIpConfigurationInner.java | 287 + ...ServiceIpConfigurationPropertiesInner.java | 237 + .../models/PrivateLinkServiceProperties.java | 368 + .../PrivateLinkServiceVisibilityInner.java | 94 + .../generated/fluent/models/ProbeInner.java | 365 + .../fluent/models/ProbePropertiesFormat.java | 342 + .../fluent/models/PublicIpAddressInner.java | 622 + .../PublicIpAddressPropertiesFormatInner.java | 526 + ...blicIpDdosProtectionStatusResultInner.java | 184 + .../fluent/models/PublicIpPrefixInner.java | 453 + .../PublicIpPrefixPropertiesFormatInner.java | 311 + .../fluent/models/QueryResultsInner.java | 128 + .../models/ResourceNavigationLinkFormat.java | 139 + ...esourceNavigationLinksListResultInner.java | 118 + .../fluent/models/RouteFilterInner.java | 242 + .../models/RouteFilterPropertiesFormat.java | 159 + .../fluent/models/RouteFilterRuleInner.java | 255 + .../RouteFilterRulePropertiesFormat.java | 195 + .../generated/fluent/models/RouteInner.java | 263 + .../fluent/models/RouteMapInner.java | 231 + .../fluent/models/RouteMapProperties.java | 180 + .../fluent/models/RoutePropertiesFormat.java | 197 + .../fluent/models/RouteTableInner.java | 267 + .../models/RouteTablePropertiesFormat.java | 183 + .../fluent/models/RoutingIntentInner.java | 194 + .../models/RoutingIntentProperties.java | 118 + .../models/RoutingRuleCollectionInner.java | 267 + ...RoutingRuleCollectionPropertiesFormat.java | 206 + .../fluent/models/RoutingRuleInner.java | 262 + .../models/RoutingRulePropertiesFormat.java | 203 + .../fluent/models/ScopeConnectionInner.java | 251 + .../models/ScopeConnectionProperties.java | 167 + .../SecurityAdminConfigurationInner.java | 242 + ...ityAdminConfigurationPropertiesFormat.java | 165 + .../models/SecurityGroupViewResultInner.java | 101 + .../models/SecurityPartnerProviderInner.java | 259 + ...curityPartnerProviderPropertiesFormat.java | 163 + .../fluent/models/SecurityRuleInner.java | 550 + .../models/SecurityRulePropertiesFormat.java | 575 + .../SecurityUserConfigurationInner.java | 216 + ...rityUserConfigurationPropertiesFormat.java | 129 + .../SecurityUserRuleCollectionInner.java | 241 + ...ityUserRuleCollectionPropertiesFormat.java | 173 + .../fluent/models/SecurityUserRuleInner.java | 357 + .../SecurityUserRulePropertiesFormat.java | 329 + ...erviceAssociationLinkPropertiesFormat.java | 200 + ...erviceAssociationLinksListResultInner.java | 118 + .../ServiceDelegationPropertiesFormat.java | 132 + .../ServiceEndpointPolicyDefinitionInner.java | 253 + ...pointPolicyDefinitionPropertiesFormat.java | 172 + .../models/ServiceEndpointPolicyInner.java | 309 + ...ServiceEndpointPolicyPropertiesFormat.java | 220 + .../models/ServiceTagInformationInner.java | 134 + .../models/ServiceTagsListResultInner.java | 183 + ...ureOverridesFilterValuesResponseInner.java | 97 + .../models/SignaturesOverridesInner.java | 184 + .../models/SignaturesOverridesListInner.java | 101 + .../fluent/models/StaticMemberInner.java | 214 + .../fluent/models/StaticMemberProperties.java | 127 + .../generated/fluent/models/SubnetInner.java | 585 + .../models/SubnetPropertiesFormatInner.java | 667 + .../fluent/models/SwapResourceInner.java | 145 + .../models/SwapResourceListResultInner.java | 98 + .../fluent/models/TopologyInner.java | 151 + .../models/TroubleshootingProperties.java | 135 + .../models/TroubleshootingResultInner.java | 191 + .../generated/fluent/models/UsageInner.java | 209 + .../models/VerificationIpFlowResultInner.java | 125 + .../models/VirtualApplianceSiteInner.java | 215 + .../VirtualApplianceSiteProperties.java | 144 + .../VirtualHubEffectiveRouteListInner.java | 101 + .../fluent/models/VirtualHubInner.java | 654 + .../fluent/models/VirtualHubProperties.java | 656 + .../models/VirtualHubRouteTableV2Inner.java | 202 + .../VirtualHubRouteTableV2Properties.java | 148 + .../VirtualNetworkGatewayConnectionInner.java | 759 + ...tworkGatewayConnectionListEntityInner.java | 672 + ...yConnectionListEntityPropertiesFormat.java | 739 + ...atewayConnectionPropertiesFormatInner.java | 853 + .../models/VirtualNetworkGatewayInner.java | 861 + ...atewayIpConfigurationPropertiesFormat.java | 195 + .../VirtualNetworkGatewayNatRuleInner.java | 290 + ...irtualNetworkGatewayNatRuleProperties.java | 243 + ...alNetworkGatewayPolicyGroupProperties.java | 205 + ...VirtualNetworkGatewayPropertiesFormat.java | 863 + .../fluent/models/VirtualNetworkInner.java | 546 + .../models/VirtualNetworkPeeringInner.java | 621 + ...VirtualNetworkPeeringPropertiesFormat.java | 669 + .../VirtualNetworkPropertiesFormat.java | 507 + .../fluent/models/VirtualNetworkTapInner.java | 303 + ...irtualNetworkTapPropertiesFormatInner.java | 227 + .../models/VirtualNetworkUsageInner.java | 149 + .../fluent/models/VirtualRouterInner.java | 303 + .../models/VirtualRouterPeeringInner.java | 214 + .../VirtualRouterPeeringProperties.java | 140 + .../models/VirtualRouterPropertiesFormat.java | 218 + .../fluent/models/VirtualWanInner.java | 322 + .../fluent/models/VirtualWanProperties.java | 251 + .../VirtualWanSecurityProvidersInner.java | 103 + ...ientConnectionConfigurationProperties.java | 168 + ...ConnectionHealthDetailListResultInner.java | 102 + .../models/VpnClientIPsecParametersInner.java | 340 + ...entRevokedCertificatePropertiesFormat.java | 113 + ...ClientRootCertificatePropertiesFormat.java | 122 + .../fluent/models/VpnConnectionInner.java | 534 + .../models/VpnConnectionProperties.java | 588 + .../fluent/models/VpnGatewayInner.java | 376 + .../fluent/models/VpnGatewayNatRuleInner.java | 306 + .../models/VpnGatewayNatRuleProperties.java | 277 + .../fluent/models/VpnGatewayProperties.java | 321 + .../models/VpnProfileResponseInner.java | 93 + .../models/VpnServerConfigurationInner.java | 538 + ...pnServerConfigurationPolicyGroupInner.java | 252 + ...verConfigurationPolicyGroupProperties.java | 199 + .../VpnServerConfigurationProperties.java | 559 + .../VpnServerConfigurationsResponseInner.java | 100 + .../generated/fluent/models/VpnSiteInner.java | 413 + .../models/VpnSiteLinkConnectionInner.java | 550 + .../VpnSiteLinkConnectionProperties.java | 588 + .../fluent/models/VpnSiteLinkInner.java | 263 + .../fluent/models/VpnSiteLinkProperties.java | 203 + .../fluent/models/VpnSiteProperties.java | 357 + .../WebApplicationFirewallPolicyInner.java | 324 + ...icationFirewallPolicyPropertiesFormat.java | 293 + .../generated/fluent/models/package-info.java | 9 + .../generated/fluent/package-info.java | 9 + ...nectivityConfigurationsListResultImpl.java | 45 + ...ctiveSecurityAdminRulesListResultImpl.java | 44 + .../AdminRuleCollectionImpl.java | 173 + .../AdminRuleCollectionsClientImpl.java | 1042 + .../AdminRuleCollectionsImpl.java | 190 + .../implementation/AdminRulesClientImpl.java | 1098 + .../implementation/AdminRulesImpl.java | 115 + ...icationGatewayAvailableSslOptionsImpl.java | 91 + ...GatewayAvailableWafRuleSetsResultImpl.java | 41 + .../ApplicationGatewayBackendHealthImpl.java | 40 + ...ationGatewayBackendHealthOnDemandImpl.java | 38 + ...icationGatewayBackendHealthServerImpl.java | 52 + .../ApplicationGatewayImpl.java | 699 + ...nGatewayPrivateEndpointConnectionImpl.java | 70 + ...ivateEndpointConnectionPropertiesImpl.java | 55 + ...yPrivateEndpointConnectionsClientImpl.java | 974 + ...GatewayPrivateEndpointConnectionsImpl.java | 109 + ...icationGatewayPrivateLinkResourceImpl.java | 68 + ...GatewayPrivateLinkResourcesClientImpl.java | 294 + ...cationGatewayPrivateLinkResourcesImpl.java | 51 + ...icationGatewaySslPredefinedPolicyImpl.java | 53 + ...onGatewayWafDynamicManifestResultImpl.java | 61 + ...nGatewayWafDynamicManifestsClientImpl.java | 266 + ...WafDynamicManifestsDefaultsClientImpl.java | 176 + ...atewayWafDynamicManifestsDefaultsImpl.java | 59 + ...icationGatewayWafDynamicManifestsImpl.java | 48 + .../ApplicationGatewaysClientImpl.java | 3093 +++ .../ApplicationGatewaysImpl.java | 336 + .../ApplicationSecurityGroupImpl.java | 180 + .../ApplicationSecurityGroupsClientImpl.java | 1221 + .../ApplicationSecurityGroupsImpl.java | 154 + .../AutoApprovedPrivateLinkServiceImpl.java | 32 + .../AvailableDelegationImpl.java | 55 + .../AvailableDelegationsClientImpl.java | 263 + .../AvailableDelegationsImpl.java | 45 + .../AvailableEndpointServicesClientImpl.java | 263 + .../AvailableEndpointServicesImpl.java | 45 + .../AvailablePrivateEndpointTypeImpl.java | 48 + ...ailablePrivateEndpointTypesClientImpl.java | 482 + .../AvailablePrivateEndpointTypesImpl.java | 62 + .../AvailableProvidersListImpl.java | 40 + ...bleResourceGroupDelegationsClientImpl.java | 282 + ...AvailableResourceGroupDelegationsImpl.java | 45 + .../AvailableServiceAliasImpl.java | 44 + .../AvailableServiceAliasesClientImpl.java | 485 + .../AvailableServiceAliasesImpl.java | 58 + .../AzureFirewallFqdnTagImpl.java | 68 + .../AzureFirewallFqdnTagsClientImpl.java | 245 + .../AzureFirewallFqdnTagsImpl.java | 45 + .../implementation/AzureFirewallImpl.java | 358 + .../AzureFirewallsClientImpl.java | 1758 ++ .../implementation/AzureFirewallsImpl.java | 178 + .../AzureReachabilityReportImpl.java | 49 + .../implementation/AzureWebCategoryImpl.java | 48 + ...AddressInboundNatRulePortMappingsImpl.java | 40 + .../BackendAddressPoolImpl.java | 262 + .../implementation/BaseAdminRuleImpl.java | 54 + .../BastionActiveSessionImpl.java | 73 + .../implementation/BastionHostImpl.java | 312 + .../BastionHostsClientImpl.java | 1289 + .../implementation/BastionHostsImpl.java | 146 + .../BastionSessionStateImpl.java | 40 + .../BastionShareableLinkImpl.java | 45 + .../implementation/BgpConnectionImpl.java | 161 + .../BgpPeerStatusListResultImpl.java | 40 + .../BgpServiceCommunitiesClientImpl.java | 243 + .../BgpServiceCommunitiesImpl.java | 45 + .../BgpServiceCommunityImpl.java | 70 + .../ConfigurationPolicyGroupsClientImpl.java | 1011 + .../ConfigurationPolicyGroupsImpl.java | 174 + .../ConnectionMonitorQueryResultImpl.java | 45 + .../ConnectionMonitorResultImpl.java | 345 + .../ConnectionMonitorsClientImpl.java | 1853 ++ .../ConnectionMonitorsImpl.java | 205 + .../ConnectionResetSharedKeyImpl.java | 32 + .../ConnectionSharedKeyImpl.java | 36 + .../ConnectionSharedKeyResultImpl.java | 45 + .../ConnectivityConfigurationImpl.java | 215 + .../ConnectivityConfigurationsClientImpl.java | 992 + .../ConnectivityConfigurationsImpl.java | 163 + .../ConnectivityInformationImpl.java | 65 + .../implementation/CustomIpPrefixImpl.java | 320 + .../CustomIpPrefixesClientImpl.java | 1201 + .../implementation/CustomIpPrefixesImpl.java | 148 + .../DdosCustomPoliciesClientImpl.java | 822 + .../DdosCustomPoliciesImpl.java | 125 + .../implementation/DdosCustomPolicyImpl.java | 178 + .../DdosProtectionPlanImpl.java | 199 + .../DdosProtectionPlansClientImpl.java | 1209 + .../DdosProtectionPlansImpl.java | 148 + .../DefaultSecurityRulesClientImpl.java | 434 + .../DefaultSecurityRulesImpl.java | 71 + .../DnsNameAvailabilityResultImpl.java | 32 + .../implementation/DscpConfigurationImpl.java | 279 + .../DscpConfigurationsClientImpl.java | 1055 + .../DscpConfigurationsImpl.java | 148 + ...iveNetworkSecurityGroupListResultImpl.java | 44 + .../EffectiveRouteListResultImpl.java | 44 + .../EffectiveRouteMapRouteListImpl.java | 40 + .../EndpointServiceResultImpl.java | 40 + .../ExpressRouteCircuitAuthorizationImpl.java | 155 + ...sRouteCircuitAuthorizationsClientImpl.java | 961 + ...ExpressRouteCircuitAuthorizationsImpl.java | 163 + .../ExpressRouteCircuitConnectionImpl.java | 191 + ...ressRouteCircuitConnectionsClientImpl.java | 1039 + .../ExpressRouteCircuitConnectionsImpl.java | 186 + .../ExpressRouteCircuitImpl.java | 343 + .../ExpressRouteCircuitPeeringImpl.java | 328 + ...uteCircuitPeeringPropertiesFormatImpl.java | 144 + ...ExpressRouteCircuitPeeringsClientImpl.java | 935 + .../ExpressRouteCircuitPeeringsImpl.java | 161 + .../ExpressRouteCircuitStatsImpl.java | 44 + ...ssRouteCircuitsArpTableListResultImpl.java | 44 + .../ExpressRouteCircuitsClientImpl.java | 2291 ++ .../ExpressRouteCircuitsImpl.java | 264 + ...outeCircuitsRoutesTableListResultImpl.java | 44 + ...cuitsRoutesTableSummaryListResultImpl.java | 46 + .../ExpressRouteConnectionImpl.java | 71 + .../ExpressRouteConnectionListImpl.java | 44 + .../ExpressRouteConnectionsClientImpl.java | 871 + .../ExpressRouteConnectionsImpl.java | 114 + .../ExpressRouteCrossConnectionImpl.java | 247 + ...xpressRouteCrossConnectionPeeringImpl.java | 105 + ...outeCrossConnectionPeeringsClientImpl.java | 970 + ...pressRouteCrossConnectionPeeringsImpl.java | 106 + ...xpressRouteCrossConnectionsClientImpl.java | 1903 ++ .../ExpressRouteCrossConnectionsImpl.java | 189 + ...tionsRoutesTableSummaryListResultImpl.java | 46 + .../ExpressRouteGatewayImpl.java | 224 + .../ExpressRouteGatewayListImpl.java | 44 + .../ExpressRouteGatewaysClientImpl.java | 1163 + .../ExpressRouteGatewaysImpl.java | 168 + .../implementation/ExpressRouteLinkImpl.java | 80 + .../ExpressRouteLinksClientImpl.java | 423 + .../implementation/ExpressRouteLinksImpl.java | 70 + .../ExpressRoutePortAuthorizationImpl.java | 146 + ...ressRoutePortAuthorizationsClientImpl.java | 980 + .../ExpressRoutePortAuthorizationsImpl.java | 165 + .../implementation/ExpressRoutePortImpl.java | 272 + .../ExpressRoutePortsClientImpl.java | 1350 + .../implementation/ExpressRoutePortsImpl.java | 173 + .../ExpressRoutePortsLocationImpl.java | 79 + .../ExpressRoutePortsLocationsClientImpl.java | 366 + .../ExpressRoutePortsLocationsImpl.java | 66 + .../ExpressRouteProviderPortImpl.java | 91 + ...xpressRouteProviderPortListResultImpl.java | 48 + ...RouteProviderPortsLocationsClientImpl.java | 166 + ...xpressRouteProviderPortsLocationsImpl.java | 56 + .../ExpressRouteServiceProviderImpl.java | 80 + ...xpressRouteServiceProvidersClientImpl.java | 244 + .../ExpressRouteServiceProvidersImpl.java | 47 + .../FirewallPoliciesClientImpl.java | 1199 + .../implementation/FirewallPoliciesImpl.java | 148 + .../FirewallPolicyDeploymentsClientImpl.java | 279 + .../FirewallPolicyDeploymentsImpl.java | 40 + .../FirewallPolicyDraftImpl.java | 100 + .../FirewallPolicyDraftsClientImpl.java | 473 + .../FirewallPolicyDraftsImpl.java | 89 + ...irewallPolicyIdpsSignaturesClientImpl.java | 216 + ...yIdpsSignaturesFilterValuesClientImpl.java | 217 + ...lPolicyIdpsSignaturesFilterValuesImpl.java | 60 + .../FirewallPolicyIdpsSignaturesImpl.java | 58 + ...licyIdpsSignaturesOverridesClientImpl.java | 638 + ...wallPolicyIdpsSignaturesOverridesImpl.java | 124 + .../implementation/FirewallPolicyImpl.java | 327 + ...allPolicyRuleCollectionGroupDraftImpl.java | 60 + ...cyRuleCollectionGroupDraftsClientImpl.java | 531 + ...llPolicyRuleCollectionGroupDraftsImpl.java | 94 + ...FirewallPolicyRuleCollectionGroupImpl.java | 165 + ...lPolicyRuleCollectionGroupsClientImpl.java | 969 + ...irewallPolicyRuleCollectionGroupsImpl.java | 165 + .../generated/implementation/FlowLogImpl.java | 256 + .../FlowLogInformationImpl.java | 64 + .../implementation/FlowLogsClientImpl.java | 1090 + .../implementation/FlowLogsImpl.java | 156 + .../FrontendIpConfigurationImpl.java | 141 + ...ndIpConfigurationPropertiesFormatImpl.java | 116 + .../GatewayRouteListResultImpl.java | 40 + ...enerateExpressRoutePortsLoaResultImpl.java | 32 + .../HubIpConfigurationImpl.java | 180 + ...ubIpConfigurationPropertiesFormatImpl.java | 64 + .../implementation/HubRouteTableImpl.java | 177 + .../HubRouteTablesClientImpl.java | 939 + .../implementation/HubRouteTablesImpl.java | 156 + .../HubVirtualNetworkConnectionImpl.java | 67 + ...ubVirtualNetworkConnectionsClientImpl.java | 967 + .../HubVirtualNetworkConnectionsImpl.java | 106 + .../implementation/InboundNatRuleImpl.java | 233 + .../InboundNatRulePropertiesFormatImpl.java | 86 + .../InboundNatRulesClientImpl.java | 964 + .../implementation/InboundNatRulesImpl.java | 159 + .../InboundSecurityRuleImpl.java | 162 + ...boundSecurityRuleOperationsClientImpl.java | 508 + .../InboundSecurityRuleOperationsImpl.java | 102 + .../IpAddressAvailabilityResultImpl.java | 47 + .../implementation/IpAllocationImpl.java | 240 + .../IpAllocationsClientImpl.java | 1201 + .../implementation/IpAllocationsImpl.java | 148 + .../implementation/IpConfigurationImpl.java | 76 + .../IpConfigurationProfileImpl.java | 60 + ...figurationProfilePropertiesFormatImpl.java | 44 + .../IpConfigurationPropertiesFormatImpl.java | 64 + .../generated/implementation/IpGroupImpl.java | 208 + .../implementation/IpGroupsClientImpl.java | 1184 + .../implementation/IpGroupsImpl.java | 148 + .../implementation/IpPrefixesListImpl.java | 39 + ...BalancerBackendAddressPoolsClientImpl.java | 954 + .../LoadBalancerBackendAddressPoolsImpl.java | 160 + ...cerFrontendIpConfigurationsClientImpl.java | 436 + ...dBalancerFrontendIpConfigurationsImpl.java | 73 + .../implementation/LoadBalancerImpl.java | 323 + ...dBalancerLoadBalancingRulesClientImpl.java | 431 + .../LoadBalancerLoadBalancingRulesImpl.java | 70 + ...adBalancerNetworkInterfacesClientImpl.java | 282 + .../LoadBalancerNetworkInterfacesImpl.java | 46 + .../LoadBalancerOutboundRulesClientImpl.java | 428 + .../LoadBalancerOutboundRulesImpl.java | 69 + .../LoadBalancerProbesClientImpl.java | 420 + .../LoadBalancerProbesImpl.java | 68 + .../LoadBalancersClientImpl.java | 1848 ++ .../implementation/LoadBalancersImpl.java | 207 + .../implementation/LoadBalancingRuleImpl.java | 107 + .../LocalNetworkGatewayImpl.java | 217 + .../LocalNetworkGatewaysClientImpl.java | 1030 + .../LocalNetworkGatewaysImpl.java | 138 + ...upNetworkManagerConnectionsClientImpl.java | 703 + ...entGroupNetworkManagerConnectionsImpl.java | 102 + .../implementation/MigratedPoolsImpl.java | 39 + .../implementation/NatGatewayImpl.java | 251 + .../implementation/NatGatewaysClientImpl.java | 1188 + .../implementation/NatGatewaysImpl.java | 148 + .../implementation/NatRulesClientImpl.java | 933 + .../implementation/NatRulesImpl.java | 159 + ...rkConfigurationDiagnosticResponseImpl.java | 40 + .../implementation/NetworkGroupImpl.java | 179 + .../NetworkGroupsClientImpl.java | 962 + .../implementation/NetworkGroupsImpl.java | 160 + .../implementation/NetworkInterfaceImpl.java | 403 + .../NetworkInterfaceIpConfigurationImpl.java | 168 + ...ceIpConfigurationPropertiesFormatImpl.java | 154 + ...rkInterfaceIpConfigurationsClientImpl.java | 435 + .../NetworkInterfaceIpConfigurationsImpl.java | 75 + ...tworkInterfaceLoadBalancersClientImpl.java | 283 + .../NetworkInterfaceLoadBalancersImpl.java | 46 + .../NetworkInterfacePropertiesFormatImpl.java | 170 + .../NetworkInterfaceTapConfigurationImpl.java | 149 + ...eTapConfigurationPropertiesFormatImpl.java | 46 + ...kInterfaceTapConfigurationsClientImpl.java | 975 + ...NetworkInterfaceTapConfigurationsImpl.java | 165 + .../NetworkInterfacesClientImpl.java | 3493 +++ .../implementation/NetworkInterfacesImpl.java | 355 + .../NetworkManagementClientBuilder.java | 140 + .../NetworkManagementClientImpl.java | 2520 ++ .../NetworkManagerCommitImpl.java | 57 + .../NetworkManagerCommitsClientImpl.java | 313 + .../NetworkManagerCommitsImpl.java | 55 + .../NetworkManagerConnectionImpl.java | 137 + ...ManagerDeploymentStatusListResultImpl.java | 44 + ...rDeploymentStatusOperationsClientImpl.java | 227 + ...ManagerDeploymentStatusOperationsImpl.java | 60 + ...nnectivityConfigurationListResultImpl.java | 46 + ...ctiveSecurityAdminRulesListResultImpl.java | 46 + .../implementation/NetworkManagerImpl.java | 220 + ...etworkManagerRoutingConfigurationImpl.java | 152 + ...anagerRoutingConfigurationsClientImpl.java | 964 + ...tworkManagerRoutingConfigurationsImpl.java | 165 + .../NetworkManagersClientImpl.java | 1256 + .../implementation/NetworkManagersImpl.java | 149 + .../implementation/NetworkProfileImpl.java | 209 + .../NetworkProfilesClientImpl.java | 1104 + .../implementation/NetworkProfilesImpl.java | 148 + .../NetworkSecurityGroupImpl.java | 258 + .../NetworkSecurityGroupsClientImpl.java | 1214 + .../NetworkSecurityGroupsImpl.java | 151 + ...NetworkVirtualApplianceConnectionImpl.java | 73 + ...VirtualApplianceConnectionsClientImpl.java | 981 + ...etworkVirtualApplianceConnectionsImpl.java | 111 + .../NetworkVirtualApplianceImpl.java | 385 + ...etworkVirtualApplianceInstanceIdsImpl.java | 39 + .../NetworkVirtualApplianceSkuImpl.java | 83 + .../NetworkVirtualAppliancesClientImpl.java | 1546 ++ .../NetworkVirtualAppliancesImpl.java | 174 + .../implementation/NetworkWatcherImpl.java | 313 + .../NetworkWatchersClientImpl.java | 4015 +++ .../implementation/NetworkWatchersImpl.java | 438 + .../implementation/NextHopResultImpl.java | 41 + .../implementation/OperationImpl.java | 46 + .../implementation/OperationsClientImpl.java | 231 + .../implementation/OperationsImpl.java | 45 + .../implementation/OutboundRuleImpl.java | 82 + .../P2SVpnConnectionHealthImpl.java | 32 + .../implementation/P2SVpnGatewayImpl.java | 283 + .../P2SVpnGatewaysClientImpl.java | 2501 ++ .../implementation/P2SVpnGatewaysImpl.java | 244 + .../PacketCaptureQueryStatusResultImpl.java | 62 + .../PacketCaptureResultImpl.java | 97 + .../PacketCapturesClientImpl.java | 1370 + .../implementation/PacketCapturesImpl.java | 135 + ...PeerExpressRouteCircuitConnectionImpl.java | 75 + ...ressRouteCircuitConnectionsClientImpl.java | 459 + ...eerExpressRouteCircuitConnectionsImpl.java | 76 + .../PrivateDnsZoneGroupImpl.java | 57 + .../PrivateDnsZoneGroupsClientImpl.java | 964 + .../PrivateDnsZoneGroupsImpl.java | 104 + .../PrivateEndpointConnectionImpl.java | 73 + ...ivateEndpointConnectionPropertiesImpl.java | 57 + .../implementation/PrivateEndpointImpl.java | 290 + .../PrivateEndpointPropertiesImpl.java | 116 + .../PrivateEndpointsClientImpl.java | 1055 + .../implementation/PrivateEndpointsImpl.java | 149 + .../PrivateLinkServiceImpl.java | 292 + ...PrivateLinkServiceIpConfigurationImpl.java | 78 + ...kServiceIpConfigurationPropertiesImpl.java | 63 + .../PrivateLinkServiceVisibilityImpl.java | 32 + .../PrivateLinkServicesClientImpl.java | 2800 ++ .../PrivateLinkServicesImpl.java | 302 + .../generated/implementation/ProbeImpl.java | 90 + .../implementation/PublicIpAddressImpl.java | 381 + .../PublicIpAddressPropertiesFormatImpl.java | 134 + .../PublicIpAddressesClientImpl.java | 2896 ++ .../implementation/PublicIpAddressesImpl.java | 289 + ...ublicIpDdosProtectionStatusResultImpl.java | 45 + .../implementation/PublicIpPrefixImpl.java | 292 + .../PublicIpPrefixPropertiesFormatImpl.java | 92 + .../PublicIpPrefixesClientImpl.java | 1201 + .../implementation/PublicIpPrefixesImpl.java | 148 + .../implementation/QueryResultsImpl.java | 44 + .../implementation/ResourceManagerUtils.java | 195 + .../ResourceNavigationLinksClientImpl.java | 207 + .../ResourceNavigationLinksImpl.java | 59 + ...ResourceNavigationLinksListResultImpl.java | 44 + .../ResourceProvidersClientImpl.java | 2913 ++ .../implementation/ResourceProvidersImpl.java | 326 + .../implementation/RouteFilterImpl.java | 219 + .../implementation/RouteFilterRuleImpl.java | 70 + .../RouteFilterRulesClientImpl.java | 944 + .../implementation/RouteFilterRulesImpl.java | 101 + .../RouteFiltersClientImpl.java | 1201 + .../implementation/RouteFiltersImpl.java | 148 + .../generated/implementation/RouteImpl.java | 164 + .../implementation/RouteMapImpl.java | 167 + .../implementation/RouteMapsClientImpl.java | 936 + .../implementation/RouteMapsImpl.java | 156 + .../implementation/RouteTableImpl.java | 219 + .../implementation/RouteTablesClientImpl.java | 1186 + .../implementation/RouteTablesImpl.java | 148 + .../implementation/RoutesClientImpl.java | 920 + .../generated/implementation/RoutesImpl.java | 156 + .../implementation/RoutingIntentImpl.java | 145 + .../RoutingIntentsClientImpl.java | 952 + .../implementation/RoutingIntentsImpl.java | 156 + .../RoutingRuleCollectionImpl.java | 183 + .../RoutingRuleCollectionsClientImpl.java | 1040 + .../RoutingRuleCollectionsImpl.java | 190 + .../implementation/RoutingRuleImpl.java | 180 + .../RoutingRulesClientImpl.java | 1098 + .../implementation/RoutingRulesImpl.java | 216 + .../implementation/ScopeConnectionImpl.java | 163 + .../ScopeConnectionsClientImpl.java | 790 + .../implementation/ScopeConnectionsImpl.java | 162 + .../SecurityAdminConfigurationImpl.java | 171 + ...SecurityAdminConfigurationsClientImpl.java | 964 + .../SecurityAdminConfigurationsImpl.java | 165 + .../SecurityGroupViewResultImpl.java | 40 + .../SecurityPartnerProviderImpl.java | 201 + .../SecurityPartnerProvidersClientImpl.java | 1217 + .../SecurityPartnerProvidersImpl.java | 149 + .../implementation/SecurityRuleImpl.java | 316 + .../SecurityRulesClientImpl.java | 957 + .../implementation/SecurityRulesImpl.java | 161 + .../SecurityUserConfigurationImpl.java | 153 + .../SecurityUserConfigurationsClientImpl.java | 962 + .../SecurityUserConfigurationsImpl.java | 163 + .../SecurityUserRuleCollectionImpl.java | 174 + ...SecurityUserRuleCollectionsClientImpl.java | 1047 + .../SecurityUserRuleCollectionsImpl.java | 192 + .../implementation/SecurityUserRuleImpl.java | 241 + .../SecurityUserRulesClientImpl.java | 1096 + .../implementation/SecurityUserRulesImpl.java | 216 + .../ServiceAssociationLinksClientImpl.java | 207 + .../ServiceAssociationLinksImpl.java | 59 + ...ServiceAssociationLinksListResultImpl.java | 44 + .../ServiceEndpointPoliciesClientImpl.java | 1217 + .../ServiceEndpointPoliciesImpl.java | 151 + .../ServiceEndpointPolicyDefinitionImpl.java | 177 + ...ceEndpointPolicyDefinitionsClientImpl.java | 1009 + .../ServiceEndpointPolicyDefinitionsImpl.java | 176 + .../ServiceEndpointPolicyImpl.java | 242 + .../ServiceTagInformationImpl.java | 45 + .../ServiceTagInformationsClientImpl.java | 313 + .../ServiceTagInformationsImpl.java | 47 + .../implementation/ServiceTagsClientImpl.java | 183 + .../implementation/ServiceTagsImpl.java | 55 + .../ServiceTagsListResultImpl.java | 68 + ...tureOverridesFilterValuesResponseImpl.java | 39 + .../SignaturesOverridesImpl.java | 45 + .../SignaturesOverridesListImpl.java | 44 + .../implementation/StaticMemberImpl.java | 154 + .../StaticMembersClientImpl.java | 862 + .../implementation/StaticMembersImpl.java | 189 + .../generated/implementation/SubnetImpl.java | 412 + .../SubnetPropertiesFormatImpl.java | 210 + .../implementation/SubnetsClientImpl.java | 1522 ++ .../generated/implementation/SubnetsImpl.java | 188 + ...onNetworkManagerConnectionsClientImpl.java | 668 + ...criptionNetworkManagerConnectionsImpl.java | 119 + .../implementation/SwapResourceImpl.java | 45 + .../SwapResourceListResultImpl.java | 44 + .../implementation/TopologyImpl.java | 52 + .../TroubleshootingResultImpl.java | 53 + .../generated/implementation/UsageImpl.java | 49 + .../implementation/UsagesClientImpl.java | 257 + .../generated/implementation/UsagesImpl.java | 45 + .../VerificationIpFlowResultImpl.java | 37 + .../implementation/VipSwapsClientImpl.java | 583 + .../implementation/VipSwapsImpl.java | 85 + .../VirtualApplianceSiteImpl.java | 150 + .../VirtualApplianceSitesClientImpl.java | 953 + .../VirtualApplianceSitesImpl.java | 160 + .../VirtualApplianceSkusClientImpl.java | 361 + .../VirtualApplianceSkusImpl.java | 68 + .../VirtualHubBgpConnectionsClientImpl.java | 1415 + .../VirtualHubBgpConnectionsImpl.java | 204 + .../VirtualHubEffectiveRouteListImpl.java | 40 + .../implementation/VirtualHubImpl.java | 421 + .../VirtualHubIpConfigurationsClientImpl.java | 941 + .../VirtualHubIpConfigurationsImpl.java | 157 + .../VirtualHubRouteTableV2Impl.java | 66 + .../VirtualHubRouteTableV2SClientImpl.java | 949 + .../VirtualHubRouteTableV2SImpl.java | 101 + .../implementation/VirtualHubsClientImpl.java | 2028 ++ .../implementation/VirtualHubsImpl.java | 218 + .../VirtualNetworkGatewayConnectionImpl.java | 490 + ...etworkGatewayConnectionListEntityImpl.java | 183 + ...GatewayConnectionPropertiesFormatImpl.java | 199 + ...alNetworkGatewayConnectionsClientImpl.java | 2874 ++ .../VirtualNetworkGatewayConnectionsImpl.java | 254 + .../VirtualNetworkGatewayImpl.java | 591 + .../VirtualNetworkGatewayNatRuleImpl.java | 192 + ...rtualNetworkGatewayNatRulesClientImpl.java | 973 + .../VirtualNetworkGatewayNatRulesImpl.java | 165 + .../VirtualNetworkGatewaysClientImpl.java | 5250 ++++ .../VirtualNetworkGatewaysImpl.java | 415 + .../implementation/VirtualNetworkImpl.java | 351 + .../VirtualNetworkPeeringImpl.java | 340 + .../VirtualNetworkPeeringsClientImpl.java | 1054 + .../VirtualNetworkPeeringsImpl.java | 163 + .../implementation/VirtualNetworkTapImpl.java | 237 + ...VirtualNetworkTapPropertiesFormatImpl.java | 79 + .../VirtualNetworkTapsClientImpl.java | 1185 + .../VirtualNetworkTapsImpl.java | 147 + .../VirtualNetworkUsageImpl.java | 49 + .../VirtualNetworksClientImpl.java | 1862 ++ .../implementation/VirtualNetworksImpl.java | 206 + .../implementation/VirtualRouterImpl.java | 212 + .../VirtualRouterPeeringImpl.java | 147 + .../VirtualRouterPeeringsClientImpl.java | 940 + .../VirtualRouterPeeringsImpl.java | 159 + .../VirtualRoutersClientImpl.java | 1049 + .../implementation/VirtualRoutersImpl.java | 148 + .../implementation/VirtualWanImpl.java | 234 + .../VirtualWanSecurityProvidersImpl.java | 40 + .../implementation/VirtualWansClientImpl.java | 1187 + .../implementation/VirtualWansImpl.java | 146 + ...tConnectionHealthDetailListResultImpl.java | 40 + .../VpnClientIPsecParametersImpl.java | 66 + .../implementation/VpnConnectionImpl.java | 145 + .../VpnConnectionsClientImpl.java | 1552 ++ .../implementation/VpnConnectionsImpl.java | 122 + .../implementation/VpnGatewayImpl.java | 292 + .../implementation/VpnGatewayNatRuleImpl.java | 208 + .../implementation/VpnGatewaysClientImpl.java | 2105 ++ .../implementation/VpnGatewaysImpl.java | 184 + .../VpnLinkConnectionsClientImpl.java | 1734 ++ .../VpnLinkConnectionsImpl.java | 163 + .../VpnProfileResponseImpl.java | 32 + .../VpnServerConfigurationImpl.java | 376 + ...VpnServerConfigurationPolicyGroupImpl.java | 183 + ...nsAssociatedWithVirtualWansClientImpl.java | 290 + ...urationsAssociatedWithVirtualWansImpl.java | 56 + .../VpnServerConfigurationsClientImpl.java | 1234 + .../VpnServerConfigurationsImpl.java | 149 + .../VpnServerConfigurationsResponseImpl.java | 39 + .../generated/implementation/VpnSiteImpl.java | 268 + .../VpnSiteLinkConnectionImpl.java | 149 + .../VpnSiteLinkConnectionsClientImpl.java | 219 + .../VpnSiteLinkConnectionsImpl.java | 59 + .../implementation/VpnSiteLinkImpl.java | 67 + .../VpnSiteLinksClientImpl.java | 424 + .../implementation/VpnSiteLinksImpl.java | 69 + .../implementation/VpnSitesClientImpl.java | 1185 + .../VpnSitesConfigurationsClientImpl.java | 306 + .../VpnSitesConfigurationsImpl.java | 42 + .../implementation/VpnSitesImpl.java | 146 + ...ApplicationFirewallPoliciesClientImpl.java | 952 + .../WebApplicationFirewallPoliciesImpl.java | 161 + .../WebApplicationFirewallPolicyImpl.java | 250 + .../WebCategoriesClientImpl.java | 363 + .../implementation/WebCategoriesImpl.java | 66 + .../implementation/package-info.java | 9 + .../models/AadAuthenticationParameters.java | 149 + .../network/generated/models/Access.java | 51 + .../network/generated/models/Action.java | 131 + .../network/generated/models/ActionType.java | 66 + .../models/ActiveBaseSecurityAdminRule.java | 325 + .../models/ActiveConfigurationParameter.java | 126 + .../ActiveConnectivityConfiguration.java | 336 + ...eConnectivityConfigurationsListResult.java | 36 + .../ActiveDefaultSecurityAdminRule.java | 334 + .../models/ActiveSecurityAdminRule.java | 436 + .../ActiveSecurityAdminRulesListResult.java | 36 + .../generated/models/AddressPrefixItem.java | 122 + .../generated/models/AddressPrefixType.java | 51 + .../generated/models/AddressSpace.java | 96 + .../network/generated/models/AdminRule.java | 422 + .../generated/models/AdminRuleCollection.java | 246 + .../models/AdminRuleCollectionListResult.java | 129 + .../models/AdminRuleCollections.java | 166 + .../generated/models/AdminRuleKind.java | 51 + .../generated/models/AdminRuleListResult.java | 127 + .../network/generated/models/AdminRules.java | 153 + .../network/generated/models/AdminState.java | 52 + .../generated/models/ApplicationGateway.java | 1132 + ...ationGatewayAuthenticationCertificate.java | 192 + ...licationGatewayAutoscaleConfiguration.java | 125 + ...ApplicationGatewayAvailableSslOptions.java | 86 + ...GatewayAvailableSslPredefinedPolicies.java | 131 + ...tionGatewayAvailableWafRuleSetsResult.java | 29 + .../ApplicationGatewayBackendAddress.java | 122 + .../ApplicationGatewayBackendAddressPool.java | 204 + .../ApplicationGatewayBackendHealth.java | 28 + ...ationGatewayBackendHealthHttpSettings.java | 136 + ...plicationGatewayBackendHealthOnDemand.java | 34 + .../ApplicationGatewayBackendHealthPool.java | 137 + ...ApplicationGatewayBackendHealthServer.java | 48 + ...ationGatewayBackendHealthServerHealth.java | 67 + ...ApplicationGatewayBackendHttpSettings.java | 482 + .../ApplicationGatewayBackendSettings.java | 336 + ...icationGatewayClientAuthConfiguration.java | 127 + ...icationGatewayClientRevocationOptions.java | 52 + .../ApplicationGatewayConnectionDraining.java | 127 + ...ApplicationGatewayCookieBasedAffinity.java | 52 + .../models/ApplicationGatewayCustomError.java | 123 + ...plicationGatewayCustomErrorStatusCode.java | 87 + ...ationGatewayFirewallDisabledRuleGroup.java | 136 + .../ApplicationGatewayFirewallExclusion.java | 166 + ...icationGatewayFirewallManifestRuleSet.java | 236 + .../ApplicationGatewayFirewallMode.java | 51 + ...ationGatewayFirewallRateLimitDuration.java | 52 + .../ApplicationGatewayFirewallRule.java | 238 + .../ApplicationGatewayFirewallRuleGroup.java | 170 + .../ApplicationGatewayFirewallRuleSet.java | 279 + ...ionGatewayFirewallUserSessionVariable.java | 57 + ...tewayForContainersReferenceDefinition.java | 106 + ...icationGatewayFrontendIpConfiguration.java | 286 + .../ApplicationGatewayFrontendPort.java | 192 + ...ApplicationGatewayGlobalConfiguration.java | 125 + ...ApplicationGatewayHeaderConfiguration.java | 161 + .../ApplicationGatewayHttpListener.java | 403 + .../ApplicationGatewayIpConfiguration.java | 194 + .../models/ApplicationGatewayListResult.java | 128 + .../models/ApplicationGatewayListener.java | 309 + ...ationGatewayLoadDistributionAlgorithm.java | 57 + ...licationGatewayLoadDistributionPolicy.java | 218 + ...licationGatewayLoadDistributionTarget.java | 206 + .../ApplicationGatewayOnDemandProbe.java | 309 + .../ApplicationGatewayOperationalState.java | 61 + .../models/ApplicationGatewayPathRule.java | 330 + ...ationGatewayPrivateEndpointConnection.java | 79 + ...ayPrivateEndpointConnectionListResult.java | 133 + ...ayPrivateEndpointConnectionProperties.java | 51 + ...tionGatewayPrivateEndpointConnections.java | 129 + ...cationGatewayPrivateLinkConfiguration.java | 194 + ...tionGatewayPrivateLinkIpConfiguration.java | 263 + ...ApplicationGatewayPrivateLinkResource.java | 70 + ...nGatewayPrivateLinkResourceListResult.java | 132 + ...pplicationGatewayPrivateLinkResources.java | 41 + .../models/ApplicationGatewayProbe.java | 438 + ...cationGatewayProbeHealthResponseMatch.java | 127 + .../models/ApplicationGatewayProtocol.java | 61 + ...plicationGatewayRedirectConfiguration.java | 345 + .../ApplicationGatewayRedirectType.java | 61 + .../ApplicationGatewayRequestRoutingRule.java | 376 + ...licationGatewayRequestRoutingRuleType.java | 52 + .../models/ApplicationGatewayRewriteRule.java | 191 + ...pplicationGatewayRewriteRuleActionSet.java | 173 + ...pplicationGatewayRewriteRuleCondition.java | 187 + .../ApplicationGatewayRewriteRuleSet.java | 177 + .../models/ApplicationGatewayRoutingRule.java | 284 + ...pplicationGatewayRuleSetStatusOptions.java | 62 + .../models/ApplicationGatewaySku.java | 178 + .../models/ApplicationGatewaySkuFamily.java | 51 + .../models/ApplicationGatewaySkuName.java | 81 + .../ApplicationGatewaySslCertificate.java | 250 + .../ApplicationGatewaySslCipherSuite.java | 209 + .../models/ApplicationGatewaySslPolicy.java | 217 + .../ApplicationGatewaySslPolicyName.java | 71 + .../ApplicationGatewaySslPolicyType.java | 56 + ...ApplicationGatewaySslPredefinedPolicy.java | 49 + .../models/ApplicationGatewaySslProfile.java | 243 + .../models/ApplicationGatewaySslProtocol.java | 61 + .../models/ApplicationGatewayTier.java | 66 + .../models/ApplicationGatewayTierTypes.java | 61 + ...cationGatewayTrustedClientCertificate.java | 210 + ...licationGatewayTrustedRootCertificate.java | 217 + .../ApplicationGatewayUrlConfiguration.java | 158 + .../models/ApplicationGatewayUrlPathMap.java | 307 + ...cationGatewayWafDynamicManifestResult.java | 63 + ...onGatewayWafDynamicManifestResultList.java | 131 + ...ApplicationGatewayWafDynamicManifests.java | 36 + ...ionGatewayWafDynamicManifestsDefaults.java | 36 + .../ApplicationGatewayWafRuleActionTypes.java | 67 + ...icationGatewayWafRuleSensitivityTypes.java | 62 + .../ApplicationGatewayWafRuleStateTypes.java | 52 + ...ayWebApplicationFirewallConfiguration.java | 391 + .../generated/models/ApplicationGateways.java | 418 + .../generated/models/ApplicationRule.java | 410 + .../models/ApplicationSecurityGroup.java | 247 + .../ApplicationSecurityGroupListResult.java | 117 + .../models/ApplicationSecurityGroups.java | 158 + .../generated/models/AssociationType.java | 51 + .../models/AuthenticationMethod.java | 51 + .../models/AuthorizationListResult.java | 128 + .../models/AuthorizationUseStatus.java | 51 + .../AutoApprovedPrivateLinkService.java | 27 + ...AutoApprovedPrivateLinkServicesResult.java | 118 + .../models/AutoLearnPrivateRangesMode.java | 51 + .../generated/models/Availability.java | 149 + .../generated/models/AvailableDelegation.java | 55 + .../models/AvailableDelegations.java | 38 + .../models/AvailableDelegationsResult.java | 116 + .../models/AvailableEndpointServices.java | 38 + .../models/AvailablePrivateEndpointType.java | 55 + .../models/AvailablePrivateEndpointTypes.java | 62 + .../AvailablePrivateEndpointTypesResult.java | 118 + .../models/AvailableProvidersList.java | 27 + .../models/AvailableProvidersListCity.java | 123 + .../models/AvailableProvidersListCountry.java | 157 + .../AvailableProvidersListParameters.java | 181 + .../models/AvailableProvidersListState.java | 156 + .../AvailableResourceGroupDelegations.java | 40 + .../models/AvailableServiceAlias.java | 47 + .../models/AvailableServiceAliases.java | 66 + .../models/AvailableServiceAliasesResult.java | 117 + .../generated/models/AzureFirewall.java | 563 + .../models/AzureFirewallApplicationRule.java | 273 + ...zureFirewallApplicationRuleCollection.java | 225 + .../AzureFirewallApplicationRuleProtocol.java | 125 + ...reFirewallApplicationRuleProtocolType.java | 57 + .../AzureFirewallAutoscaleConfiguration.java | 129 + .../models/AzureFirewallFqdnTag.java | 76 + .../AzureFirewallFqdnTagListResult.java | 129 + .../models/AzureFirewallFqdnTags.java | 33 + .../models/AzureFirewallIpConfiguration.java | 230 + .../models/AzureFirewallIpGroups.java | 97 + .../models/AzureFirewallListResult.java | 127 + .../models/AzureFirewallNatRCAction.java | 94 + .../models/AzureFirewallNatRCActionType.java | 51 + .../models/AzureFirewallNatRule.java | 359 + .../AzureFirewallNatRuleCollection.java | 225 + .../models/AzureFirewallNetworkRule.java | 333 + .../AzureFirewallNetworkRuleCollection.java | 225 + .../AzureFirewallNetworkRuleProtocol.java | 61 + .../AzureFirewallPacketCaptureFlags.java | 95 + .../AzureFirewallPacketCaptureFlagsType.java | 72 + .../AzureFirewallPacketCaptureRule.java | 155 + .../models/AzureFirewallPublicIpAddress.java | 93 + .../models/AzureFirewallRCAction.java | 93 + .../models/AzureFirewallRCActionType.java | 51 + .../generated/models/AzureFirewallSku.java | 121 + .../models/AzureFirewallSkuName.java | 51 + .../models/AzureFirewallSkuTier.java | 56 + .../models/AzureFirewallThreatIntelMode.java | 56 + .../generated/models/AzureFirewalls.java | 209 + .../models/AzureReachabilityReport.java | 42 + .../models/AzureReachabilityReportItem.java | 155 + .../AzureReachabilityReportLatencyInfo.java | 129 + .../AzureReachabilityReportLocation.java | 159 + .../AzureReachabilityReportParameters.java | 239 + .../generated/models/AzureWebCategory.java | 54 + .../models/AzureWebCategoryListResult.java | 128 + ...kendAddressInboundNatRulePortMappings.java | 28 + .../generated/models/BackendAddressPool.java | 450 + .../generated/models/BaseAdminRule.java | 62 + .../models/BastionActiveSession.java | 96 + .../BastionActiveSessionListResult.java | 129 + .../models/BastionConnectProtocol.java | 51 + .../network/generated/models/BastionHost.java | 529 + .../models/BastionHostIpConfiguration.java | 239 + .../models/BastionHostListResult.java | 127 + ...astionHostPropertiesFormatNetworkAcls.java | 100 + .../generated/models/BastionHostSkuName.java | 61 + .../generated/models/BastionHosts.java | 158 + .../models/BastionSessionDeleteResult.java | 128 + .../generated/models/BastionSessionState.java | 40 + .../models/BastionShareableLink.java | 48 + .../BastionShareableLinkListRequest.java | 101 + .../BastionShareableLinkListResult.java | 129 + .../BastionShareableLinkTokenListRequest.java | 97 + .../generated/models/BgpCommunity.java | 239 + .../generated/models/BgpConnection.java | 299 + .../generated/models/BgpPeerState.java | 66 + .../generated/models/BgpPeerStatus.java | 193 + .../models/BgpPeerStatusListResult.java | 27 + .../models/BgpServiceCommunities.java | 33 + .../generated/models/BgpServiceCommunity.java | 70 + .../models/BgpServiceCommunityListResult.java | 129 + .../network/generated/models/BgpSettings.java | 184 + .../models/BreakOutCategoryPolicies.java | 149 + ...ckPrivateLinkServiceVisibilityRequest.java | 95 + .../generated/models/ChildResource.java | 144 + .../models/CircuitConnectionStatus.java | 56 + .../generated/models/CommissionedState.java | 82 + .../generated/models/ConfigurationGroup.java | 178 + .../models/ConfigurationPolicyGroups.java | 150 + .../generated/models/ConfigurationType.java | 61 + .../generated/models/ConnectionMonitor.java | 360 + .../models/ConnectionMonitorDestination.java | 149 + .../models/ConnectionMonitorEndpoint.java | 352 + .../ConnectionMonitorEndpointFilter.java | 129 + .../ConnectionMonitorEndpointFilterItem.java | 124 + ...nnectionMonitorEndpointFilterItemType.java | 47 + .../ConnectionMonitorEndpointFilterType.java | 47 + ...nectionMonitorEndpointLocationDetails.java | 96 + .../ConnectionMonitorEndpointScope.java | 133 + .../ConnectionMonitorEndpointScopeItem.java | 96 + .../ConnectionMonitorHttpConfiguration.java | 248 + .../ConnectionMonitorIcmpConfiguration.java | 95 + .../models/ConnectionMonitorListResult.java | 100 + .../models/ConnectionMonitorOutput.java | 125 + .../models/ConnectionMonitorQueryResult.java | 35 + .../models/ConnectionMonitorResult.java | 517 + .../models/ConnectionMonitorSource.java | 130 + .../models/ConnectionMonitorSourceStatus.java | 56 + .../ConnectionMonitorSuccessThreshold.java | 128 + .../ConnectionMonitorTcpConfiguration.java | 154 + .../ConnectionMonitorTestConfiguration.java | 329 + ...ctionMonitorTestConfigurationProtocol.java | 57 + .../models/ConnectionMonitorTestGroup.java | 234 + .../models/ConnectionMonitorType.java | 51 + .../ConnectionMonitorWorkspaceSettings.java | 94 + .../generated/models/ConnectionMonitors.java | 223 + .../models/ConnectionResetSharedKey.java | 26 + .../generated/models/ConnectionSharedKey.java | 33 + .../models/ConnectionSharedKeyResult.java | 48 + .../models/ConnectionSharedKeyResultList.java | 130 + .../generated/models/ConnectionState.java | 56 + .../models/ConnectionStateSnapshot.java | 349 + .../generated/models/ConnectionStatus.java | 61 + .../models/ConnectivityConfiguration.java | 379 + .../ConnectivityConfigurationListResult.java | 131 + .../models/ConnectivityConfigurations.java | 169 + .../models/ConnectivityDestination.java | 149 + .../models/ConnectivityGroupItem.java | 193 + .../generated/models/ConnectivityHop.java | 224 + .../models/ConnectivityInformation.java | 69 + .../generated/models/ConnectivityIssue.java | 133 + .../models/ConnectivityParameters.java | 226 + .../generated/models/ConnectivitySource.java | 129 + .../models/ConnectivityTopology.java | 51 + .../network/generated/models/Container.java | 77 + .../models/ContainerNetworkInterface.java | 211 + ...ontainerNetworkInterfaceConfiguration.java | 222 + ...tainerNetworkInterfaceIpConfiguration.java | 159 + .../generated/models/CoverageLevel.java | 71 + .../network/generated/models/Criterion.java | 182 + .../generated/models/CrossTenantScopes.java | 116 + .../CustomDnsConfigPropertiesFormat.java | 124 + .../generated/models/CustomIpPrefix.java | 517 + .../models/CustomIpPrefixListResult.java | 128 + .../generated/models/CustomIpPrefixType.java | 56 + .../generated/models/CustomIpPrefixes.java | 160 + .../generated/models/DdosCustomPolicies.java | 114 + .../generated/models/DdosCustomPolicy.java | 247 + .../generated/models/DdosProtectionPlan.java | 265 + .../models/DdosProtectionPlanListResult.java | 116 + .../generated/models/DdosProtectionPlans.java | 158 + .../generated/models/DdosSettings.java | 125 + .../models/DdosSettingsProtectionMode.java | 56 + .../generated/models/DefaultAdminRule.java | 317 + .../models/DefaultSecurityRules.java | 67 + .../network/generated/models/Delegation.java | 216 + .../models/DelegationProperties.java | 110 + .../models/DeleteExistingPeering.java | 51 + .../generated/models/DeleteOptions.java | 51 + .../generated/models/DeploymentStatus.java | 61 + .../models/DestinationPortBehavior.java | 51 + .../generated/models/DeviceProperties.java | 149 + .../network/generated/models/DhGroup.java | 81 + .../network/generated/models/DhcpOptions.java | 96 + .../network/generated/models/Dimension.java | 149 + .../network/generated/models/Direction.java | 51 + .../models/DisableBgpRoutePropagation.java | 51 + .../models/DnsNameAvailabilityResult.java | 26 + .../network/generated/models/DnsSettings.java | 151 + .../generated/models/DscpConfiguration.java | 496 + .../models/DscpConfigurationListResult.java | 116 + .../generated/models/DscpConfigurations.java | 158 + .../models/EffectiveAdminRuleKind.java | 51 + .../EffectiveBaseSecurityAdminRule.java | 265 + .../EffectiveConnectivityConfiguration.java | 318 + .../EffectiveDefaultSecurityAdminRule.java | 305 + .../models/EffectiveNetworkSecurityGroup.java | 191 + ...ectiveNetworkSecurityGroupAssociation.java | 153 + ...fectiveNetworkSecurityGroupListResult.java | 35 + .../models/EffectiveNetworkSecurityRule.java | 514 + .../generated/models/EffectiveRoute.java | 268 + .../models/EffectiveRouteListResult.java | 34 + .../models/EffectiveRouteMapRoute.java | 149 + .../models/EffectiveRouteMapRouteList.java | 27 + .../models/EffectiveRouteSource.java | 61 + .../generated/models/EffectiveRouteState.java | 51 + .../models/EffectiveRoutesParameters.java | 124 + .../models/EffectiveSecurityAdminRule.java | 407 + .../models/EffectiveSecurityRuleProtocol.java | 56 + .../models/EndpointServiceResult.java | 40 + .../models/EndpointServicesListResult.java | 128 + .../generated/models/EndpointType.java | 86 + .../network/generated/models/Error.java | 188 + .../generated/models/ErrorException.java | 42 + .../models/EvaluatedNetworkSecurityGroup.java | 175 + .../generated/models/EvaluationState.java | 56 + .../generated/models/ExceptionEntry.java | 263 + .../models/ExceptionEntryMatchVariable.java | 56 + .../ExceptionEntrySelectorMatchOperator.java | 62 + .../ExceptionEntryValueMatchOperator.java | 66 + .../models/ExclusionManagedRule.java | 101 + .../models/ExclusionManagedRuleGroup.java | 138 + .../models/ExclusionManagedRuleSet.java | 169 + .../generated/models/ExplicitProxy.java | 233 + .../generated/models/ExpressRouteCircuit.java | 575 + .../models/ExpressRouteCircuitArpTable.java | 177 + .../ExpressRouteCircuitAuthorization.java | 270 + .../ExpressRouteCircuitAuthorizations.java | 144 + .../models/ExpressRouteCircuitConnection.java | 385 + ...pressRouteCircuitConnectionListResult.java | 131 + .../ExpressRouteCircuitConnections.java | 158 + .../models/ExpressRouteCircuitListResult.java | 129 + .../models/ExpressRouteCircuitPeering.java | 791 + ...uitPeeringAdvertisedPublicPrefixState.java | 64 + .../ExpressRouteCircuitPeeringConfig.java | 228 + .../models/ExpressRouteCircuitPeeringId.java | 93 + .../ExpressRouteCircuitPeeringListResult.java | 130 + ...ssRouteCircuitPeeringPropertiesFormat.java | 164 + .../ExpressRouteCircuitPeeringState.java | 51 + .../models/ExpressRouteCircuitPeerings.java | 144 + .../models/ExpressRouteCircuitReference.java | 93 + .../ExpressRouteCircuitRoutesTable.java | 208 + ...ExpressRouteCircuitRoutesTableSummary.java | 213 + ...RouteCircuitServiceProviderProperties.java | 152 + .../models/ExpressRouteCircuitSku.java | 150 + .../models/ExpressRouteCircuitSkuFamily.java | 51 + .../models/ExpressRouteCircuitSkuTier.java | 61 + .../models/ExpressRouteCircuitStats.java | 47 + .../models/ExpressRouteCircuits.java | 307 + ...xpressRouteCircuitsArpTableListResult.java | 35 + ...essRouteCircuitsRoutesTableListResult.java | 35 + ...eCircuitsRoutesTableSummaryListResult.java | 36 + .../models/ExpressRouteConnection.java | 91 + .../models/ExpressRouteConnectionId.java | 81 + .../models/ExpressRouteConnectionList.java | 27 + .../models/ExpressRouteConnections.java | 124 + .../models/ExpressRouteCrossConnection.java | 362 + ...ExpressRouteCrossConnectionListResult.java | 118 + .../ExpressRouteCrossConnectionPeering.java | 148 + ...xpressRouteCrossConnectionPeeringList.java | 118 + .../ExpressRouteCrossConnectionPeerings.java | 127 + ...outeCrossConnectionRoutesTableSummary.java | 187 + .../models/ExpressRouteCrossConnections.java | 219 + ...nnectionsRoutesTableSummaryListResult.java | 36 + .../generated/models/ExpressRouteGateway.java | 327 + .../models/ExpressRouteGatewayList.java | 27 + ...tewayPropertiesAutoScaleConfiguration.java | 101 + ...ropertiesAutoScaleConfigurationBounds.java | 127 + .../models/ExpressRouteGateways.java | 161 + .../generated/models/ExpressRouteLink.java | 103 + .../models/ExpressRouteLinkAdminState.java | 51 + .../models/ExpressRouteLinkConnectorType.java | 51 + .../models/ExpressRouteLinkListResult.java | 130 + .../models/ExpressRouteLinkMacSecCipher.java | 61 + .../models/ExpressRouteLinkMacSecConfig.java | 181 + .../ExpressRouteLinkMacSecSciState.java | 51 + .../generated/models/ExpressRouteLinks.java | 67 + .../models/ExpressRoutePeeringState.java | 51 + .../models/ExpressRoutePeeringType.java | 56 + .../generated/models/ExpressRoutePort.java | 409 + .../models/ExpressRoutePortAuthorization.java | 215 + ...pressRoutePortAuthorizationListResult.java | 132 + ...xpressRoutePortAuthorizationUseStatus.java | 52 + .../ExpressRoutePortAuthorizations.java | 145 + .../models/ExpressRoutePortListResult.java | 130 + .../generated/models/ExpressRoutePorts.java | 187 + .../models/ExpressRoutePortsBillingType.java | 51 + .../ExpressRoutePortsEncapsulation.java | 51 + .../models/ExpressRoutePortsLocation.java | 84 + .../ExpressRoutePortsLocationBandwidths.java | 102 + .../ExpressRoutePortsLocationListResult.java | 132 + .../models/ExpressRoutePortsLocations.java | 61 + .../models/ExpressRouteProviderPort.java | 118 + .../ExpressRouteProviderPortListResult.java | 35 + .../ExpressRouteProviderPortsLocations.java | 34 + .../models/ExpressRouteServiceProvider.java | 77 + ...RouteServiceProviderBandwidthsOffered.java | 124 + ...ExpressRouteServiceProviderListResult.java | 130 + .../models/ExpressRouteServiceProviders.java | 33 + .../generated/models/ExtendedLocation.java | 121 + .../models/ExtendedLocationTypes.java | 46 + .../network/generated/models/FilterItems.java | 123 + .../FirewallPacketCaptureParameters.java | 276 + .../generated/models/FirewallPolicies.java | 160 + .../generated/models/FirewallPolicy.java | 513 + .../FirewallPolicyCertificateAuthority.java | 124 + .../models/FirewallPolicyDeployments.java | 35 + .../generated/models/FirewallPolicyDraft.java | 119 + .../models/FirewallPolicyDrafts.java | 93 + .../FirewallPolicyFilterRuleCollection.java | 176 + ...ewallPolicyFilterRuleCollectionAction.java | 96 + ...lPolicyFilterRuleCollectionActionType.java | 52 + .../FirewallPolicyHttpHeaderToInsert.java | 122 + .../FirewallPolicyIdpsQuerySortOrder.java | 51 + .../FirewallPolicyIdpsSignatureDirection.java | 70 + .../FirewallPolicyIdpsSignatureMode.java | 59 + .../FirewallPolicyIdpsSignatureSeverity.java | 59 + .../models/FirewallPolicyIdpsSignatures.java | 43 + ...ewallPolicyIdpsSignaturesFilterValues.java | 42 + ...FirewallPolicyIdpsSignaturesOverrides.java | 121 + .../models/FirewallPolicyInsights.java | 153 + .../FirewallPolicyIntrusionDetection.java | 163 + ...nDetectionBypassTrafficSpecifications.java | 316 + ...PolicyIntrusionDetectionConfiguration.java | 176 + ...llPolicyIntrusionDetectionProfileType.java | 62 + ...ewallPolicyIntrusionDetectionProtocol.java | 62 + ...rusionDetectionSignatureSpecification.java | 126 + ...wallPolicyIntrusionDetectionStateType.java | 57 + .../models/FirewallPolicyListResult.java | 128 + .../FirewallPolicyLogAnalyticsResources.java | 130 + .../FirewallPolicyLogAnalyticsWorkspace.java | 124 + .../FirewallPolicyNatRuleCollection.java | 176 + ...FirewallPolicyNatRuleCollectionAction.java | 96 + ...wallPolicyNatRuleCollectionActionType.java | 47 + .../generated/models/FirewallPolicyRule.java | 167 + ...FirewallPolicyRuleApplicationProtocol.java | 125 + ...wallPolicyRuleApplicationProtocolType.java | 52 + .../models/FirewallPolicyRuleCollection.java | 168 + .../FirewallPolicyRuleCollectionGroup.java | 271 + ...irewallPolicyRuleCollectionGroupDraft.java | 65 + ...rewallPolicyRuleCollectionGroupDrafts.java | 102 + ...llPolicyRuleCollectionGroupListResult.java | 130 + .../FirewallPolicyRuleCollectionGroups.java | 148 + .../FirewallPolicyRuleCollectionType.java | 53 + .../FirewallPolicyRuleNetworkProtocol.java | 61 + .../models/FirewallPolicyRuleType.java | 56 + .../generated/models/FirewallPolicySku.java | 93 + .../models/FirewallPolicySkuTier.java | 56 + .../generated/models/FirewallPolicySnat.java | 128 + .../generated/models/FirewallPolicySql.java | 96 + .../FirewallPolicyThreatIntelWhitelist.java | 125 + .../FirewallPolicyTransportSecurity.java | 99 + .../network/generated/models/FlowLog.java | 417 + .../models/FlowLogFormatParameters.java | 121 + .../generated/models/FlowLogFormatType.java | 46 + .../generated/models/FlowLogInformation.java | 78 + .../generated/models/FlowLogListResult.java | 115 + .../models/FlowLogStatusParameters.java | 104 + .../network/generated/models/FlowLogs.java | 144 + .../models/FrontendIpConfiguration.java | 143 + ...ontendIpConfigurationPropertiesFormat.java | 107 + ...ewayCustomBgpIpAddressIpConfiguration.java | 137 + .../GatewayLoadBalancerTunnelInterface.java | 180 + ...atewayLoadBalancerTunnelInterfaceType.java | 57 + .../GatewayLoadBalancerTunnelProtocol.java | 56 + .../generated/models/GatewayRoute.java | 177 + .../models/GatewayRouteListResult.java | 27 + .../GenerateExpressRoutePortsLoaRequest.java | 104 + .../GenerateExpressRoutePortsLoaResult.java | 27 + .../network/generated/models/Geo.java | 86 + .../models/GetInboundRoutesParameters.java | 124 + .../models/GetOutboundRoutesParameters.java | 124 + .../GetVpnSitesConfigurationRequest.java | 133 + .../generated/models/GroupByUserSession.java | 108 + .../generated/models/GroupByVariable.java | 102 + .../generated/models/GroupConnectivity.java | 51 + .../generated/models/GroupMemberType.java | 51 + .../generated/models/HeaderValueMatcher.java | 159 + .../network/generated/models/HopLink.java | 200 + .../generated/models/HttpConfiguration.java | 156 + .../models/HttpConfigurationMethod.java | 51 + .../network/generated/models/HttpHeader.java | 121 + .../network/generated/models/HttpMethod.java | 46 + .../network/generated/models/Hub.java | 121 + .../models/HubBgpConnectionStatus.java | 61 + .../generated/models/HubIpAddresses.java | 124 + .../generated/models/HubIpConfiguration.java | 325 + .../HubIpConfigurationPropertiesFormat.java | 55 + .../models/HubPublicIpAddresses.java | 129 + .../network/generated/models/HubRoute.java | 233 + .../generated/models/HubRouteTable.java | 275 + .../generated/models/HubRouteTables.java | 146 + .../models/HubRoutingPreference.java | 56 + .../models/HubVirtualNetworkConnection.java | 86 + .../models/HubVirtualNetworkConnections.java | 128 + .../generated/models/IdpsQueryObject.java | 213 + .../generated/models/IkeEncryption.java | 76 + .../generated/models/IkeIntegrity.java | 71 + .../generated/models/InboundNatPool.java | 368 + .../generated/models/InboundNatRule.java | 596 + .../models/InboundNatRuleListResult.java | 116 + .../models/InboundNatRulePortMapping.java | 129 + .../InboundNatRulePropertiesFormat.java | 115 + .../generated/models/InboundNatRules.java | 146 + .../generated/models/InboundSecurityRule.java | 262 + .../models/InboundSecurityRuleOperations.java | 72 + .../models/InboundSecurityRuleType.java | 52 + .../models/InboundSecurityRules.java | 242 + .../models/InboundSecurityRulesProtocol.java | 51 + .../InternetIngressPublicIpsProperties.java | 96 + .../models/IpAddressAvailabilityResult.java | 42 + .../generated/models/IpAllocation.java | 368 + .../models/IpAllocationListResult.java | 127 + .../generated/models/IpAllocationMethod.java | 51 + .../generated/models/IpAllocationType.java | 51 + .../generated/models/IpAllocations.java | 160 + .../generated/models/IpConfiguration.java | 76 + .../IpConfigurationBgpPeeringAddress.java | 160 + .../models/IpConfigurationProfile.java | 62 + ...pConfigurationProfilePropertiesFormat.java | 35 + .../IpConfigurationPropertiesFormat.java | 55 + .../generated/models/IpFlowProtocol.java | 51 + .../network/generated/models/IpGroup.java | 275 + .../generated/models/IpGroupListResult.java | 127 + .../network/generated/models/IpGroups.java | 174 + .../generated/models/IpPrefixesList.java | 27 + .../network/generated/models/IpRule.java | 93 + .../network/generated/models/IpTag.java | 121 + .../network/generated/models/IpVersion.java | 51 + .../generated/models/IpsecEncryption.java | 86 + .../generated/models/IpsecIntegrity.java | 71 + .../network/generated/models/IpsecPolicy.java | 325 + .../models/Ipv6CircuitConnectionConfig.java | 110 + .../Ipv6ExpressRouteCircuitPeeringConfig.java | 214 + .../network/generated/models/IsGlobal.java | 51 + .../generated/models/IsWorkloadProtected.java | 51 + .../network/generated/models/IssueType.java | 86 + .../models/ListHubRouteTablesResult.java | 127 + ...istHubVirtualNetworkConnectionsResult.java | 130 + .../models/ListP2SVpnGatewaysResult.java | 128 + .../generated/models/ListRouteMapsResult.java | 127 + .../models/ListRoutingIntentResult.java | 127 + .../ListVirtualHubBgpConnectionResults.java | 128 + .../ListVirtualHubIpConfigurationResults.java | 130 + .../ListVirtualHubRouteTableV2SResult.java | 129 + .../models/ListVirtualHubsResult.java | 128 + ...stVirtualNetworkGatewayNatRulesResult.java | 131 + .../models/ListVirtualWansResult.java | 128 + .../models/ListVpnConnectionsResult.java | 128 + .../models/ListVpnGatewayNatRulesResult.java | 129 + .../models/ListVpnGatewaysResult.java | 128 + ...ServerConfigurationPolicyGroupsResult.java | 131 + .../ListVpnServerConfigurationsResult.java | 130 + .../ListVpnSiteLinkConnectionsResult.java | 130 + .../models/ListVpnSiteLinksResult.java | 128 + .../generated/models/ListVpnSitesResult.java | 128 + .../generated/models/LoadBalancer.java | 465 + .../models/LoadBalancerBackendAddress.java | 257 + .../LoadBalancerBackendAddressAdminState.java | 58 + ...dBalancerBackendAddressPoolListResult.java | 118 + .../LoadBalancerBackendAddressPools.java | 144 + ...ncerFrontendIpConfigurationListResult.java | 118 + .../LoadBalancerFrontendIpConfigurations.java | 67 + .../models/LoadBalancerListResult.java | 115 + ...adBalancerLoadBalancingRuleListResult.java | 118 + .../LoadBalancerLoadBalancingRules.java | 67 + .../models/LoadBalancerNetworkInterfaces.java | 38 + .../LoadBalancerOutboundRuleListResult.java | 116 + .../LoadBalancerOutboundRuleProtocol.java | 56 + .../models/LoadBalancerOutboundRules.java | 67 + .../models/LoadBalancerProbeListResult.java | 115 + .../generated/models/LoadBalancerProbes.java | 67 + .../generated/models/LoadBalancerSku.java | 121 + .../generated/models/LoadBalancerSkuName.java | 56 + .../generated/models/LoadBalancerSkuTier.java | 51 + .../models/LoadBalancerVipSwapRequest.java | 101 + ...VipSwapRequestFrontendIpConfiguration.java | 141 + .../generated/models/LoadBalancers.java | 241 + .../generated/models/LoadBalancingRule.java | 149 + .../generated/models/LoadDistribution.java | 56 + .../generated/models/LocalNetworkGateway.java | 326 + .../models/LocalNetworkGatewayListResult.java | 117 + .../models/LocalNetworkGateways.java | 138 + .../generated/models/LogSpecification.java | 149 + .../models/ManagedRuleEnabledState.java | 51 + .../models/ManagedRuleGroupOverride.java | 138 + .../generated/models/ManagedRuleOverride.java | 185 + .../generated/models/ManagedRuleSet.java | 168 + .../models/ManagedRulesDefinition.java | 173 + .../models/ManagedServiceIdentity.java | 182 + ...ServiceIdentityUserAssignedIdentities.java | 99 + ...agementGroupNetworkManagerConnections.java | 124 + .../generated/models/MatchCondition.java | 230 + .../generated/models/MatchVariable.java | 130 + .../network/generated/models/MatchedRule.java | 121 + .../generated/models/MetricSpecification.java | 468 + .../MigrateLoadBalancerToIpBasedRequest.java | 97 + .../generated/models/MigratedPools.java | 27 + .../network/generated/models/NatGateway.java | 359 + .../models/NatGatewayListResult.java | 127 + .../generated/models/NatGatewaySku.java | 93 + .../generated/models/NatGatewaySkuName.java | 46 + .../network/generated/models/NatGateways.java | 160 + .../network/generated/models/NatRule.java | 343 + .../generated/models/NatRulePortMapping.java | 149 + .../network/generated/models/NatRules.java | 146 + ...workConfigurationDiagnosticParameters.java | 175 + ...NetworkConfigurationDiagnosticProfile.java | 239 + ...etworkConfigurationDiagnosticResponse.java | 28 + .../NetworkConfigurationDiagnosticResult.java | 132 + .../generated/models/NetworkGroup.java | 276 + .../models/NetworkGroupListResult.java | 128 + .../generated/models/NetworkGroups.java | 155 + .../NetworkGroupsCreateOrUpdateHeaders.java | 58 + .../NetworkGroupsCreateOrUpdateResponse.java | 40 + .../generated/models/NetworkIntentPolicy.java | 170 + .../NetworkIntentPolicyBasedService.java | 56 + .../NetworkIntentPolicyConfiguration.java | 129 + .../generated/models/NetworkInterface.java | 617 + .../models/NetworkInterfaceAssociation.java | 116 + .../models/NetworkInterfaceAuxiliaryMode.java | 61 + .../models/NetworkInterfaceAuxiliarySku.java | 66 + .../models/NetworkInterfaceDnsSettings.java | 187 + .../NetworkInterfaceIpConfiguration.java | 161 + ...orkInterfaceIpConfigurationListResult.java | 118 + ...rationPrivateLinkConnectionProperties.java | 121 + ...erfaceIpConfigurationPropertiesFormat.java | 133 + .../NetworkInterfaceIpConfigurations.java | 69 + .../models/NetworkInterfaceListResult.java | 116 + ...etworkInterfaceLoadBalancerListResult.java | 117 + .../models/NetworkInterfaceLoadBalancers.java | 38 + .../NetworkInterfaceMigrationPhase.java | 66 + .../models/NetworkInterfaceNicType.java | 51 + .../NetworkInterfacePropertiesFormat.java | 179 + .../NetworkInterfaceTapConfiguration.java | 228 + ...rkInterfaceTapConfigurationListResult.java | 118 + ...rfaceTapConfigurationPropertiesFormat.java | 35 + .../NetworkInterfaceTapConfigurations.java | 146 + .../generated/models/NetworkInterfaces.java | 466 + .../generated/models/NetworkManager.java | 315 + .../models/NetworkManagerCommit.java | 48 + .../models/NetworkManagerCommits.java | 42 + .../models/NetworkManagerConnection.java | 214 + .../NetworkManagerConnectionListResult.java | 129 + .../NetworkManagerDeploymentStatus.java | 246 + ...workManagerDeploymentStatusListResult.java | 36 + ...workManagerDeploymentStatusOperations.java | 44 + ...tworkManagerDeploymentStatusParameter.java | 158 + ...veConnectivityConfigurationListResult.java | 37 + ...EffectiveSecurityAdminRulesListResult.java | 37 + .../models/NetworkManagerListResult.java | 129 + ...ManagerPropertiesNetworkManagerScopes.java | 149 + .../NetworkManagerRoutingConfiguration.java | 211 + ...ManagerRoutingConfigurationListResult.java | 130 + .../NetworkManagerRoutingConfigurations.java | 156 + .../NetworkManagerRoutingGroupItem.java | 103 + .../NetworkManagerSecurityGroupItem.java | 103 + .../generated/models/NetworkManagers.java | 173 + .../generated/models/NetworkProfile.java | 277 + .../models/NetworkProfileListResult.java | 128 + .../generated/models/NetworkProfiles.java | 160 + .../network/generated/models/NetworkRule.java | 319 + .../models/NetworkSecurityGroup.java | 319 + .../NetworkSecurityGroupListResult.java | 129 + .../models/NetworkSecurityGroupResult.java | 118 + .../models/NetworkSecurityGroups.java | 160 + .../NetworkSecurityRulesEvaluationResult.java | 240 + .../models/NetworkVirtualAppliance.java | 578 + .../NetworkVirtualApplianceConnection.java | 85 + ...NetworkVirtualApplianceConnectionList.java | 130 + .../NetworkVirtualApplianceConnections.java | 129 + .../NetworkVirtualApplianceInstanceIds.java | 30 + .../NetworkVirtualApplianceListResult.java | 129 + ...pliancePropertiesFormatNetworkProfile.java | 105 + ...NetworkVirtualApplianceSiteListResult.java | 130 + .../models/NetworkVirtualApplianceSku.java | 84 + .../NetworkVirtualApplianceSkuInstances.java | 102 + .../NetworkVirtualApplianceSkuListResult.java | 130 + .../models/NetworkVirtualAppliances.java | 191 + .../generated/models/NetworkWatcher.java | 530 + .../models/NetworkWatcherListResult.java | 100 + .../generated/models/NetworkWatchers.java | 517 + .../generated/models/NextHopParameters.java | 201 + .../generated/models/NextHopResult.java | 42 + .../network/generated/models/NextHopType.java | 71 + .../network/generated/models/NextStep.java | 56 + .../generated/models/NicTypeInRequest.java | 51 + .../generated/models/NicTypeInResponse.java | 56 + .../models/O365BreakOutCategoryPolicies.java | 150 + .../models/O365PolicyProperties.java | 96 + .../models/Office365PolicyProperties.java | 97 + .../models/OfficeTrafficCategory.java | 61 + .../network/generated/models/Operation.java | 47 + .../generated/models/OperationDisplay.java | 177 + .../generated/models/OperationListResult.java | 128 + ...nPropertiesFormatServiceSpecification.java | 139 + .../network/generated/models/Operations.java | 33 + .../network/generated/models/OrderBy.java | 121 + .../network/generated/models/Origin.java | 56 + .../generated/models/OutboundRule.java | 101 + .../network/generated/models/OutputType.java | 46 + .../models/OwaspCrsExclusionEntry.java | 213 + .../OwaspCrsExclusionEntryMatchVariable.java | 87 + ...rsExclusionEntrySelectorMatchOperator.java | 68 + .../models/P2SConnectionConfiguration.java | 253 + .../models/P2SVpnConnectionHealth.java | 27 + .../models/P2SVpnConnectionHealthRequest.java | 127 + .../models/P2SVpnConnectionRequest.java | 96 + .../generated/models/P2SVpnGateway.java | 465 + .../generated/models/P2SVpnGateways.java | 297 + .../models/P2SVpnProfileParameters.java | 95 + .../generated/models/PacketCapture.java | 332 + .../generated/models/PacketCaptureFilter.java | 229 + .../models/PacketCaptureListResult.java | 100 + .../models/PacketCaptureMachineScope.java | 127 + .../PacketCaptureQueryStatusResult.java | 64 + .../generated/models/PacketCaptureResult.java | 123 + .../models/PacketCaptureSettings.java | 156 + .../models/PacketCaptureStorageLocation.java | 195 + .../models/PacketCaptureTargetType.java | 56 + .../generated/models/PacketCaptures.java | 177 + .../network/generated/models/Parameter.java | 153 + .../PartnerManagedResourceProperties.java | 114 + .../network/generated/models/PatchObject.java | 95 + .../network/generated/models/PcError.java | 66 + .../network/generated/models/PcProtocol.java | 56 + .../network/generated/models/PcStatus.java | 66 + .../PeerExpressRouteCircuitConnection.java | 103 + ...pressRouteCircuitConnectionListResult.java | 133 + .../PeerExpressRouteCircuitConnections.java | 77 + .../network/generated/models/PeerRoute.java | 177 + .../network/generated/models/PfsGroup.java | 86 + .../generated/models/PolicySettings.java | 413 + .../models/PolicySettingsLogScrubbing.java | 129 + .../generated/models/PreferredIpVersion.java | 52 + .../models/PreferredRoutingGateway.java | 56 + .../models/PrepareNetworkPoliciesRequest.java | 131 + .../models/PrivateDnsZoneConfig.java | 150 + .../generated/models/PrivateDnsZoneGroup.java | 57 + .../models/PrivateDnsZoneGroupListResult.java | 117 + .../models/PrivateDnsZoneGroups.java | 126 + .../generated/models/PrivateEndpoint.java | 550 + .../models/PrivateEndpointConnection.java | 84 + .../PrivateEndpointConnectionListResult.java | 118 + .../PrivateEndpointConnectionProperties.java | 56 + .../PrivateEndpointIpConfiguration.java | 221 + .../models/PrivateEndpointListResult.java | 116 + .../models/PrivateEndpointProperties.java | 89 + .../models/PrivateEndpointVNetPolicies.java | 51 + .../generated/models/PrivateEndpoints.java | 172 + .../generated/models/PrivateLinkService.java | 542 + .../models/PrivateLinkServiceConnection.java | 270 + .../PrivateLinkServiceConnectionState.java | 154 + .../PrivateLinkServiceIpConfiguration.java | 92 + ...eLinkServiceIpConfigurationProperties.java | 65 + .../models/PrivateLinkServiceListResult.java | 116 + ...vateLinkServicePropertiesAutoApproval.java | 80 + ...rivateLinkServicePropertiesVisibility.java | 80 + .../models/PrivateLinkServiceVisibility.java | 27 + .../generated/models/PrivateLinkServices.java | 412 + .../network/generated/models/Probe.java | 125 + .../ProbeNoHealthyBackendsBehavior.java | 51 + .../generated/models/ProbeProtocol.java | 57 + .../models/ProcessorArchitecture.java | 51 + .../models/PropagatedRouteTable.java | 125 + .../network/generated/models/Protocol.java | 61 + .../models/ProtocolConfiguration.java | 96 + .../generated/models/ProtocolType.java | 86 + .../generated/models/ProvisioningState.java | 61 + .../generated/models/PublicIpAddress.java | 609 + .../models/PublicIpAddressDnsSettings.java | 200 + ...ddressDnsSettingsDomainNameLabelScope.java | 68 + .../models/PublicIpAddressListResult.java | 128 + .../models/PublicIpAddressMigrationPhase.java | 66 + .../PublicIpAddressPropertiesFormat.java | 134 + .../generated/models/PublicIpAddressSku.java | 121 + .../models/PublicIpAddressSkuName.java | 51 + .../models/PublicIpAddressSkuTier.java | 51 + .../generated/models/PublicIpAddresses.java | 393 + .../PublicIpDdosProtectionStatusResult.java | 49 + .../generated/models/PublicIpPrefix.java | 435 + .../models/PublicIpPrefixListResult.java | 128 + .../PublicIpPrefixPropertiesFormat.java | 93 + .../generated/models/PublicIpPrefixSku.java | 121 + .../models/PublicIpPrefixSkuName.java | 46 + .../models/PublicIpPrefixSkuTier.java | 51 + .../generated/models/PublicIpPrefixes.java | 160 + .../generated/models/QosDefinition.java | 256 + .../network/generated/models/QosIpRange.java | 121 + .../generated/models/QosPortRange.java | 121 + ...QueryInboundNatRulePortMappingRequest.java | 124 + .../generated/models/QueryRequestOptions.java | 96 + .../generated/models/QueryResults.java | 34 + .../QueryTroubleshootingParameters.java | 103 + .../generated/models/RadiusServer.java | 158 + .../network/generated/models/RecordSet.java | 223 + .../models/ReferencedPublicIpAddress.java | 93 + .../generated/models/ResiliencyModel.java | 51 + .../models/ResourceIdentityType.java | 68 + .../models/ResourceNavigationLink.java | 215 + .../models/ResourceNavigationLinks.java | 41 + .../ResourceNavigationLinksListResult.java | 35 + .../generated/models/ResourceProviders.java | 417 + .../network/generated/models/ResourceSet.java | 96 + .../models/RetentionPolicyParameters.java | 121 + .../network/generated/models/Route.java | 334 + .../network/generated/models/RouteFilter.java | 274 + .../models/RouteFilterListResult.java | 127 + .../generated/models/RouteFilterRule.java | 78 + .../models/RouteFilterRuleListResult.java | 128 + .../generated/models/RouteFilterRuleType.java | 46 + .../generated/models/RouteFilterRules.java | 124 + .../generated/models/RouteFilters.java | 160 + .../generated/models/RouteListResult.java | 127 + .../network/generated/models/RouteMap.java | 275 + .../generated/models/RouteMapActionType.java | 67 + .../models/RouteMapMatchCondition.java | 66 + .../generated/models/RouteMapRule.java | 189 + .../network/generated/models/RouteMaps.java | 146 + .../generated/models/RouteNextHopType.java | 66 + .../network/generated/models/RouteTable.java | 298 + .../models/RouteTableListResult.java | 127 + .../network/generated/models/RouteTables.java | 160 + .../network/generated/models/Routes.java | 143 + .../models/RoutingConfiguration.java | 218 + .../generated/models/RoutingIntent.java | 227 + .../generated/models/RoutingIntents.java | 146 + .../generated/models/RoutingPolicy.java | 169 + .../network/generated/models/RoutingRule.java | 280 + .../models/RoutingRuleCollection.java | 284 + .../RoutingRuleCollectionListResult.java | 129 + .../models/RoutingRuleCollections.java | 164 + .../models/RoutingRuleDestinationType.java | 51 + .../models/RoutingRuleListResult.java | 127 + .../generated/models/RoutingRuleNextHop.java | 129 + .../models/RoutingRuleNextHopType.java | 66 + .../models/RoutingRuleRouteDestination.java | 136 + .../generated/models/RoutingRules.java | 170 + .../generated/models/RoutingState.java | 61 + .../generated/models/ScopeConnection.java | 270 + .../models/ScopeConnectionListResult.java | 128 + .../models/ScopeConnectionState.java | 66 + .../generated/models/ScopeConnections.java | 153 + .../ScrubbingRuleEntryMatchOperator.java | 52 + .../ScrubbingRuleEntryMatchVariable.java | 71 + .../models/ScrubbingRuleEntryState.java | 51 + .../models/SecurityAdminConfiguration.java | 251 + .../SecurityAdminConfigurationListResult.java | 130 + .../models/SecurityAdminConfigurations.java | 155 + .../SecurityConfigurationRuleAccess.java | 56 + .../SecurityConfigurationRuleDirection.java | 51 + .../SecurityConfigurationRuleProtocol.java | 71 + .../models/SecurityGroupNetworkInterface.java | 127 + .../models/SecurityGroupViewParameters.java | 102 + .../models/SecurityGroupViewResult.java | 27 + .../models/SecurityPartnerProvider.java | 287 + ...curityPartnerProviderConnectionStatus.java | 62 + .../SecurityPartnerProviderListResult.java | 129 + .../models/SecurityPartnerProviders.java | 160 + .../models/SecurityProviderName.java | 56 + .../generated/models/SecurityRule.java | 784 + .../generated/models/SecurityRuleAccess.java | 51 + .../models/SecurityRuleAssociations.java | 200 + .../models/SecurityRuleDirection.java | 51 + .../models/SecurityRuleListResult.java | 128 + .../models/SecurityRuleProtocol.java | 71 + .../generated/models/SecurityRules.java | 144 + .../models/SecurityUserConfiguration.java | 210 + .../SecurityUserConfigurationListResult.java | 130 + .../models/SecurityUserConfigurations.java | 155 + .../models/SecurityUserGroupItem.java | 102 + .../generated/models/SecurityUserRule.java | 418 + .../models/SecurityUserRuleCollection.java | 246 + .../SecurityUserRuleCollectionListResult.java | 130 + .../models/SecurityUserRuleCollections.java | 164 + .../models/SecurityUserRuleListResult.java | 128 + .../generated/models/SecurityUserRules.java | 170 + .../generated/models/SensitivityType.java | 61 + .../models/ServiceAssociationLink.java | 263 + .../models/ServiceAssociationLinks.java | 41 + .../ServiceAssociationLinksListResult.java | 35 + .../models/ServiceEndpointPolicies.java | 160 + .../models/ServiceEndpointPolicy.java | 327 + .../ServiceEndpointPolicyDefinition.java | 322 + ...iceEndpointPolicyDefinitionListResult.java | 131 + .../ServiceEndpointPolicyDefinitions.java | 153 + .../ServiceEndpointPolicyListResult.java | 117 + .../ServiceEndpointPropertiesFormat.java | 170 + .../ServiceProviderProvisioningState.java | 61 + .../models/ServiceTagInformation.java | 47 + .../ServiceTagInformationListResult.java | 117 + ...ServiceTagInformationPropertiesFormat.java | 149 + .../models/ServiceTagInformations.java | 45 + .../network/generated/models/ServiceTags.java | 40 + .../models/ServiceTagsListResult.java | 69 + .../network/generated/models/SessionIds.java | 95 + .../network/generated/models/Severity.java | 51 + .../generated/models/SharedKeyProperties.java | 138 + .../generated/models/SharingScope.java | 52 + .../SignatureOverridesFilterValuesQuery.java | 95 + ...ignatureOverridesFilterValuesResponse.java | 28 + .../generated/models/SignaturesOverrides.java | 48 + .../models/SignaturesOverridesList.java | 28 + .../models/SignaturesOverridesProperties.java | 96 + .../generated/models/SingleQueryResult.java | 383 + .../network/generated/models/Sku.java | 93 + .../network/generated/models/SlotType.java | 56 + .../generated/models/StaticMember.java | 212 + .../models/StaticMemberListResult.java | 128 + .../generated/models/StaticMembers.java | 160 + .../network/generated/models/StaticRoute.java | 152 + .../generated/models/StaticRoutesConfig.java | 116 + .../network/generated/models/Subnet.java | 830 + .../generated/models/SubnetAssociation.java | 116 + .../generated/models/SubnetListResult.java | 127 + .../models/SubnetPropertiesFormat.java | 177 + .../network/generated/models/Subnets.java | 208 + ...SubscriptionNetworkManagerConnections.java | 137 + .../generated/models/SwapResource.java | 47 + .../models/SwapResourceListResult.java | 27 + .../models/SwapResourceProperties.java | 93 + .../network/generated/models/SyncMode.java | 51 + .../models/SyncRemoteAddressSpace.java | 46 + .../network/generated/models/TagsObject.java | 95 + .../network/generated/models/Topology.java | 49 + .../generated/models/TopologyAssociation.java | 150 + .../generated/models/TopologyParameters.java | 150 + .../generated/models/TopologyResource.java | 185 + ...afficAnalyticsConfigurationProperties.java | 211 + .../models/TrafficAnalyticsProperties.java | 101 + .../models/TrafficSelectorPolicy.java | 140 + .../generated/models/TransportProtocol.java | 56 + .../models/TroubleshootingDetails.java | 212 + .../models/TroubleshootingParameters.java | 173 + .../TroubleshootingRecommendedActions.java | 178 + .../models/TroubleshootingResult.java | 49 + .../models/TunnelConnectionHealth.java | 147 + .../UnprepareNetworkPoliciesRequest.java | 94 + .../network/generated/models/Usage.java | 54 + .../network/generated/models/UsageName.java | 121 + .../network/generated/models/UsageUnit.java | 46 + .../network/generated/models/Usages.java | 36 + .../generated/models/UsagesListResult.java | 127 + .../generated/models/UseHubGateway.java | 51 + .../network/generated/models/VM.java | 154 + .../generated/models/VerbosityLevel.java | 56 + .../models/VerificationIpFlowParameters.java | 337 + .../models/VerificationIpFlowResult.java | 34 + .../network/generated/models/VipSwaps.java | 97 + ...rtualApplianceAdditionalNicProperties.java | 126 + .../VirtualApplianceIpConfiguration.java | 126 + ...ualApplianceIpConfigurationProperties.java | 96 + ...pplianceNetworkInterfaceConfiguration.java | 129 + ...tworkInterfaceConfigurationProperties.java | 105 + .../models/VirtualApplianceNicProperties.java | 147 + .../models/VirtualApplianceSite.java | 256 + .../models/VirtualApplianceSites.java | 147 + .../models/VirtualApplianceSkuProperties.java | 150 + .../models/VirtualApplianceSkus.java | 59 + .../network/generated/models/VirtualHub.java | 699 + .../models/VirtualHubBgpConnections.java | 202 + .../models/VirtualHubEffectiveRoute.java | 209 + .../models/VirtualHubEffectiveRouteList.java | 28 + .../generated/models/VirtualHubId.java | 96 + .../models/VirtualHubIpConfigurations.java | 144 + .../generated/models/VirtualHubRoute.java | 124 + .../models/VirtualHubRouteTable.java | 98 + .../models/VirtualHubRouteTableV2.java | 63 + .../models/VirtualHubRouteTableV2S.java | 132 + .../generated/models/VirtualHubRouteV2.java | 180 + .../network/generated/models/VirtualHubs.java | 243 + .../generated/models/VirtualNetwork.java | 567 + .../models/VirtualNetworkBgpCommunities.java | 118 + ...tualNetworkConnectionGatewayReference.java | 104 + ...tualNetworkDdosProtectionStatusResult.java | 130 + .../models/VirtualNetworkEncryption.java | 126 + .../VirtualNetworkEncryptionEnforcement.java | 53 + .../models/VirtualNetworkGateway.java | 1124 + .../VirtualNetworkGatewayAutoScaleBounds.java | 123 + ...lNetworkGatewayAutoScaleConfiguration.java | 99 + .../VirtualNetworkGatewayConnection.java | 805 + ...ualNetworkGatewayConnectionListEntity.java | 228 + ...ualNetworkGatewayConnectionListResult.java | 118 + .../VirtualNetworkGatewayConnectionMode.java | 57 + ...workGatewayConnectionPropertiesFormat.java | 214 + ...rtualNetworkGatewayConnectionProtocol.java | 52 + ...VirtualNetworkGatewayConnectionStatus.java | 62 + .../VirtualNetworkGatewayConnectionType.java | 62 + .../VirtualNetworkGatewayConnections.java | 352 + .../VirtualNetworkGatewayIpConfiguration.java | 235 + ...alNetworkGatewayListConnectionsResult.java | 119 + .../VirtualNetworkGatewayListResult.java | 117 + .../models/VirtualNetworkGatewayNatRule.java | 363 + .../models/VirtualNetworkGatewayNatRules.java | 148 + .../VirtualNetworkGatewayPolicyGroup.java | 235 + ...irtualNetworkGatewayPolicyGroupMember.java | 152 + .../models/VirtualNetworkGatewaySku.java | 139 + .../models/VirtualNetworkGatewaySkuName.java | 131 + .../models/VirtualNetworkGatewaySkuTier.java | 131 + .../models/VirtualNetworkGatewayType.java | 56 + .../models/VirtualNetworkGateways.java | 623 + .../models/VirtualNetworkListResult.java | 128 + .../models/VirtualNetworkListUsageResult.java | 117 + .../models/VirtualNetworkPeering.java | 908 + .../models/VirtualNetworkPeeringLevel.java | 61 + .../VirtualNetworkPeeringListResult.java | 129 + .../models/VirtualNetworkPeeringState.java | 56 + .../models/VirtualNetworkPeerings.java | 144 + ...NetworkPrivateEndpointNetworkPolicies.java | 64 + ...workPrivateLinkServiceNetworkPolicies.java | 52 + .../generated/models/VirtualNetworkTap.java | 327 + .../models/VirtualNetworkTapListResult.java | 128 + .../VirtualNetworkTapPropertiesFormat.java | 66 + .../generated/models/VirtualNetworkTaps.java | 158 + .../generated/models/VirtualNetworkUsage.java | 54 + .../models/VirtualNetworkUsageName.java | 97 + .../generated/models/VirtualNetworks.java | 247 + .../generated/models/VirtualRouter.java | 382 + .../VirtualRouterAutoScaleConfiguration.java | 96 + .../models/VirtualRouterListResult.java | 127 + .../models/VirtualRouterPeering.java | 255 + .../VirtualRouterPeeringListResult.java | 129 + .../models/VirtualRouterPeerings.java | 154 + .../generated/models/VirtualRouters.java | 172 + .../network/generated/models/VirtualWan.java | 343 + .../models/VirtualWanSecurityProvider.java | 138 + .../VirtualWanSecurityProviderType.java | 51 + .../models/VirtualWanSecurityProviders.java | 27 + .../VirtualWanVpnProfileParameters.java | 127 + .../network/generated/models/VirtualWans.java | 158 + .../VnetLocalRouteOverrideCriteria.java | 51 + .../network/generated/models/VnetRoute.java | 147 + .../VngClientConnectionConfiguration.java | 205 + .../models/VpnAuthenticationType.java | 56 + .../models/VpnClientConfiguration.java | 488 + .../models/VpnClientConnectionHealth.java | 161 + .../VpnClientConnectionHealthDetail.java | 264 + ...lientConnectionHealthDetailListResult.java | 28 + .../models/VpnClientIPsecParameters.java | 77 + .../generated/models/VpnClientParameters.java | 192 + .../generated/models/VpnClientProtocol.java | 56 + .../models/VpnClientRevokedCertificate.java | 177 + .../models/VpnClientRootCertificate.java | 185 + .../generated/models/VpnConnection.java | 177 + ...onnectionPacketCaptureStartParameters.java | 126 + ...ConnectionPacketCaptureStopParameters.java | 126 + .../generated/models/VpnConnectionStatus.java | 61 + .../generated/models/VpnConnections.java | 185 + .../models/VpnDeviceScriptParameters.java | 149 + .../network/generated/models/VpnGateway.java | 459 + .../models/VpnGatewayGeneration.java | 56 + .../models/VpnGatewayIpConfiguration.java | 149 + .../generated/models/VpnGatewayNatRule.java | 377 + ...pnGatewayPacketCaptureStartParameters.java | 95 + ...VpnGatewayPacketCaptureStopParameters.java | 95 + .../models/VpnGatewayTunnelingProtocol.java | 51 + .../network/generated/models/VpnGateways.java | 237 + .../generated/models/VpnLinkBgpSettings.java | 121 + .../models/VpnLinkConnectionMode.java | 56 + .../generated/models/VpnLinkConnections.java | 236 + .../models/VpnLinkProviderProperties.java | 121 + .../generated/models/VpnNatRuleMapping.java | 121 + .../generated/models/VpnNatRuleMode.java | 51 + .../generated/models/VpnNatRuleType.java | 51 + .../VpnPacketCaptureStartParameters.java | 94 + .../VpnPacketCaptureStopParameters.java | 94 + .../models/VpnPolicyMemberAttributeType.java | 56 + .../generated/models/VpnProfileResponse.java | 26 + ...rverConfigRadiusClientRootCertificate.java | 123 + ...rverConfigRadiusServerRootCertificate.java | 123 + ...rverConfigVpnClientRevokedCertificate.java | 123 + ...nServerConfigVpnClientRootCertificate.java | 123 + .../models/VpnServerConfiguration.java | 537 + .../VpnServerConfigurationPolicyGroup.java | 304 + ...nServerConfigurationPolicyGroupMember.java | 152 + .../models/VpnServerConfigurations.java | 162 + ...nfigurationsAssociatedWithVirtualWans.java | 37 + .../VpnServerConfigurationsResponse.java | 28 + .../network/generated/models/VpnSite.java | 424 + .../network/generated/models/VpnSiteLink.java | 83 + .../models/VpnSiteLinkConnection.java | 183 + .../models/VpnSiteLinkConnections.java | 44 + .../generated/models/VpnSiteLinks.java | 67 + .../network/generated/models/VpnSites.java | 157 + .../models/VpnSitesConfigurations.java | 38 + .../network/generated/models/VpnType.java | 51 + .../models/WebApplicationFirewallAction.java | 61 + .../WebApplicationFirewallCustomRule.java | 382 + .../WebApplicationFirewallEnabledState.java | 51 + .../WebApplicationFirewallMatchVariable.java | 82 + .../models/WebApplicationFirewallMode.java | 51 + .../WebApplicationFirewallOperator.java | 101 + .../WebApplicationFirewallPolicies.java | 160 + .../models/WebApplicationFirewallPolicy.java | 378 + ...ebApplicationFirewallPolicyListResult.java | 107 + ...pplicationFirewallPolicyResourceState.java | 72 + .../WebApplicationFirewallRuleType.java | 56 + .../WebApplicationFirewallScrubbingRules.java | 204 + .../WebApplicationFirewallScrubbingState.java | 52 + .../models/WebApplicationFirewallState.java | 51 + .../WebApplicationFirewallTransform.java | 76 + .../generated/models/WebCategories.java | 58 + .../generated/models/package-info.java | 9 + .../network/generated/package-info.java | 9 + .../src/main/java/module-info.java | 15 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...nRuleCollectionsCreateOrUpdateSamples.java | 33 + .../AdminRuleCollectionsDeleteSamples.java | 26 + .../AdminRuleCollectionsGetSamples.java | 26 + .../AdminRuleCollectionsListSamples.java | 25 + .../AdminRulesCreateOrUpdateSamples.java | 63 + .../generated/AdminRulesDeleteSamples.java | 26 + .../generated/AdminRulesGetSamples.java | 42 + .../generated/AdminRulesListSamples.java | 26 + ...ivateEndpointConnectionsDeleteSamples.java | 25 + ...yPrivateEndpointConnectionsGetSamples.java | 25 + ...PrivateEndpointConnectionsListSamples.java | 24 + ...ivateEndpointConnectionsUpdateSamples.java | 33 + ...atewayPrivateLinkResourcesListSamples.java | 24 + ...yWafDynamicManifestsDefaultGetSamples.java | 24 + ...nGatewayWafDynamicManifestsGetSamples.java | 23 + ...nGatewaysBackendHealthOnDemandSamples.java | 37 + ...plicationGatewaysBackendHealthSamples.java | 23 + ...licationGatewaysCreateOrUpdateSamples.java | 181 + .../ApplicationGatewaysDeleteSamples.java | 23 + ...tionGatewaysGetByResourceGroupSamples.java | 23 + ...GatewaysGetSslPredefinedPolicySamples.java | 25 + ...aysListAvailableRequestHeadersSamples.java | 23 + ...ysListAvailableResponseHeadersSamples.java | 23 + ...ysListAvailableServerVariablesSamples.java | 23 + ...atewaysListAvailableSslOptionsSamples.java | 23 + ...AvailableSslPredefinedPoliciesSamples.java | 24 + ...tewaysListAvailableWafRuleSetsSamples.java | 23 + ...ionGatewaysListByResourceGroupSamples.java | 24 + .../ApplicationGatewaysListSamples.java | 25 + .../ApplicationGatewaysStartSamples.java | 23 + .../ApplicationGatewaysStopSamples.java | 23 + .../ApplicationGatewaysUpdateTagsSamples.java | 44 + ...onSecurityGroupsCreateOrUpdateSamples.java | 28 + ...pplicationSecurityGroupsDeleteSamples.java | 24 + ...curityGroupsGetByResourceGroupSamples.java | 25 + ...urityGroupsListByResourceGroupSamples.java | 25 + .../ApplicationSecurityGroupsListSamples.java | 24 + ...cationSecurityGroupsUpdateTagsSamples.java | 43 + .../AvailableDelegationsListSamples.java | 23 + .../AvailableEndpointServicesListSamples.java | 23 + ...dpointTypesListByResourceGroupSamples.java | 25 + ...ilablePrivateEndpointTypesListSamples.java | 24 + ...leResourceGroupDelegationsListSamples.java | 24 + ...viceAliasesListByResourceGroupSamples.java | 24 + .../AvailableServiceAliasesListSamples.java | 24 + .../AzureFirewallFqdnTagsListSamples.java | 24 + .../AzureFirewallsCreateOrUpdateSamples.java | 489 + .../AzureFirewallsDeleteSamples.java | 23 + ...ureFirewallsGetByResourceGroupSamples.java | 85 + ...reFirewallsListByResourceGroupSamples.java | 24 + ...reFirewallsListLearnedPrefixesSamples.java | 24 + .../generated/AzureFirewallsListSamples.java | 24 + .../AzureFirewallsPacketCaptureSamples.java | 48 + .../AzureFirewallsUpdateTagsSamples.java | 42 + .../BastionHostsCreateOrUpdateSamples.java | 82 + .../generated/BastionHostsDeleteSamples.java | 37 + ...BastionHostsGetByResourceGroupSamples.java | 52 + ...astionHostsListByResourceGroupSamples.java | 24 + .../generated/BastionHostsListSamples.java | 25 + .../BastionHostsUpdateTagsSamples.java | 42 + .../BgpServiceCommunitiesListSamples.java | 23 + ...tionPolicyGroupsCreateOrUpdateSamples.java | 40 + ...onfigurationPolicyGroupsDeleteSamples.java | 25 + .../ConfigurationPolicyGroupsGetSamples.java | 25 + ...psListByVpnServerConfigurationSamples.java | 25 + ...nnectionMonitorsCreateOrUpdateSamples.java | 139 + .../ConnectionMonitorsDeleteSamples.java | 23 + .../ConnectionMonitorsGetSamples.java | 23 + .../ConnectionMonitorsListSamples.java | 23 + .../ConnectionMonitorsQuerySamples.java | 23 + .../ConnectionMonitorsStartSamples.java | 23 + .../ConnectionMonitorsStopSamples.java | 23 + .../ConnectionMonitorsUpdateTagsSamples.java | 42 + ...tyConfigurationsCreateOrUpdateSamples.java | 48 + ...nnectivityConfigurationsDeleteSamples.java | 26 + .../ConnectivityConfigurationsGetSamples.java | 26 + ...ConnectivityConfigurationsListSamples.java | 25 + ...CustomIpPrefixesCreateOrUpdateSamples.java | 29 + .../CustomIpPrefixesDeleteSamples.java | 23 + ...omIpPrefixesGetByResourceGroupSamples.java | 24 + ...mIpPrefixesListByResourceGroupSamples.java | 24 + .../CustomIpPrefixesListSamples.java | 23 + .../CustomIpPrefixesUpdateTagsSamples.java | 42 + ...osCustomPoliciesCreateOrUpdateSamples.java | 27 + .../DdosCustomPoliciesDeleteSamples.java | 23 + ...stomPoliciesGetByResourceGroupSamples.java | 24 + .../DdosCustomPoliciesUpdateTagsSamples.java | 43 + ...sProtectionPlansCreateOrUpdateSamples.java | 27 + .../DdosProtectionPlansDeleteSamples.java | 23 + ...tectionPlansGetByResourceGroupSamples.java | 24 + ...ectionPlansListByResourceGroupSamples.java | 24 + .../DdosProtectionPlansListSamples.java | 24 + .../DdosProtectionPlansUpdateTagsSamples.java | 44 + .../DefaultSecurityRulesGetSamples.java | 24 + .../DefaultSecurityRulesListSamples.java | 23 + ...scpConfigurationCreateOrUpdateSamples.java | 49 + .../DscpConfigurationDeleteSamples.java | 23 + ...onfigurationGetByResourceGroupSamples.java | 24 + ...nfigurationListByResourceGroupSamples.java | 23 + .../DscpConfigurationListSamples.java | 23 + ...itAuthorizationsCreateOrUpdateSamples.java | 27 + ...uteCircuitAuthorizationsDeleteSamples.java | 25 + ...sRouteCircuitAuthorizationsGetSamples.java | 25 + ...RouteCircuitAuthorizationsListSamples.java | 24 + ...rcuitConnectionsCreateOrUpdateSamples.java | 37 + ...sRouteCircuitConnectionsDeleteSamples.java | 25 + ...ressRouteCircuitConnectionsGetSamples.java | 26 + ...essRouteCircuitConnectionsListSamples.java | 25 + ...eCircuitPeeringsCreateOrUpdateSamples.java | 31 + ...ressRouteCircuitPeeringsDeleteSamples.java | 25 + ...ExpressRouteCircuitPeeringsGetSamples.java | 26 + ...xpressRouteCircuitPeeringsListSamples.java | 24 + ...essRouteCircuitsCreateOrUpdateSamples.java | 71 + .../ExpressRouteCircuitsDeleteSamples.java | 24 + ...outeCircuitsGetByResourceGroupSamples.java | 24 + ...ssRouteCircuitsGetPeeringStatsSamples.java | 25 + .../ExpressRouteCircuitsGetStatsSamples.java | 24 + ...pressRouteCircuitsListArpTableSamples.java | 24 + ...uteCircuitsListByResourceGroupSamples.java | 24 + ...ssRouteCircuitsListRoutesTableSamples.java | 24 + ...CircuitsListRoutesTableSummarySamples.java | 25 + .../ExpressRouteCircuitsListSamples.java | 24 + ...ExpressRouteCircuitsUpdateTagsSamples.java | 44 + ...RouteConnectionsCreateOrUpdateSamples.java | 54 + .../ExpressRouteConnectionsDeleteSamples.java | 26 + .../ExpressRouteConnectionsGetSamples.java | 26 + .../ExpressRouteConnectionsListSamples.java | 25 + ...nnectionPeeringsCreateOrUpdateSamples.java | 36 + ...eCrossConnectionPeeringsDeleteSamples.java | 26 + ...outeCrossConnectionPeeringsGetSamples.java | 26 + ...uteCrossConnectionPeeringsListSamples.java | 25 + ...CrossConnectionsCreateOrUpdateSamples.java | 31 + ...sConnectionsGetByResourceGroupSamples.java | 26 + ...teCrossConnectionsListArpTableSamples.java | 26 + ...ConnectionsListByResourceGroupSamples.java | 25 + ...rossConnectionsListRoutesTableSamples.java | 26 + ...nectionsListRoutesTableSummarySamples.java | 26 + ...pressRouteCrossConnectionsListSamples.java | 24 + ...outeCrossConnectionsUpdateTagsSamples.java | 44 + ...essRouteGatewaysCreateOrUpdateSamples.java | 37 + .../ExpressRouteGatewaysDeleteSamples.java | 25 + ...outeGatewaysGetByResourceGroupSamples.java | 25 + ...uteGatewaysListByResourceGroupSamples.java | 25 + ...outeGatewaysListBySubscriptionSamples.java | 24 + ...ExpressRouteGatewaysUpdateTagsSamples.java | 44 + .../ExpressRouteLinksGetSamples.java | 23 + .../ExpressRouteLinksListSamples.java | 23 + ...rtAuthorizationsCreateOrUpdateSamples.java | 27 + ...sRoutePortAuthorizationsDeleteSamples.java | 25 + ...ressRoutePortAuthorizationsGetSamples.java | 25 + ...essRoutePortAuthorizationsListSamples.java | 24 + ...xpressRoutePortsCreateOrUpdateSamples.java | 61 + .../ExpressRoutePortsDeleteSamples.java | 23 + .../ExpressRoutePortsGenerateLoaSamples.java | 29 + ...ssRoutePortsGetByResourceGroupSamples.java | 23 + ...sRoutePortsListByResourceGroupSamples.java | 24 + .../ExpressRoutePortsListSamples.java | 23 + .../ExpressRoutePortsLocationsGetSamples.java | 25 + ...ExpressRoutePortsLocationsListSamples.java | 25 + .../ExpressRoutePortsUpdateTagsSamples.java | 43 + ...RouteProviderPortsLocationListSamples.java | 25 + ...pressRouteServiceProvidersListSamples.java | 23 + ...FirewallPoliciesCreateOrUpdateSamples.java | 110 + .../FirewallPoliciesDeleteSamples.java | 23 + ...wallPoliciesGetByResourceGroupSamples.java | 24 + ...allPoliciesListByResourceGroupSamples.java | 24 + .../FirewallPoliciesListSamples.java | 24 + .../FirewallPoliciesUpdateTagsSamples.java | 42 + ...irewallPolicyDeploymentsDeploySamples.java | 24 + ...wallPolicyDraftsCreateOrUpdateSamples.java | 87 + .../FirewallPolicyDraftsDeleteSamples.java | 25 + .../FirewallPolicyDraftsGetSamples.java | 23 + ...IdpsSignaturesFilterValuesListSamples.java | 27 + ...rewallPolicyIdpsSignaturesListSamples.java | 35 + ...licyIdpsSignaturesOverridesGetSamples.java | 24 + ...icyIdpsSignaturesOverridesListSamples.java | 24 + ...cyIdpsSignaturesOverridesPatchSamples.java | 47 + ...licyIdpsSignaturesOverridesPutSamples.java | 47 + ...ctionGroupDraftsCreateOrUpdateSamples.java | 45 + ...uleCollectionGroupDraftsDeleteSamples.java | 25 + ...cyRuleCollectionGroupDraftsGetSamples.java | 24 + ...CollectionGroupsCreateOrUpdateSamples.java | 178 + ...licyRuleCollectionGroupsDeleteSamples.java | 25 + ...lPolicyRuleCollectionGroupsGetSamples.java | 70 + ...PolicyRuleCollectionGroupsListSamples.java | 52 + .../FlowLogsCreateOrUpdateSamples.java | 59 + .../generated/FlowLogsDeleteSamples.java | 24 + .../generated/FlowLogsGetSamples.java | 23 + .../generated/FlowLogsListSamples.java | 24 + .../generated/FlowLogsUpdateTagsSamples.java | 41 + .../HubRouteTablesCreateOrUpdateSamples.java | 36 + .../HubRouteTablesDeleteSamples.java | 23 + .../generated/HubRouteTablesGetSamples.java | 24 + .../generated/HubRouteTablesListSamples.java | 23 + ...tworkConnectionsCreateOrUpdateSamples.java | 58 + ...irtualNetworkConnectionsDeleteSamples.java | 25 + ...ubVirtualNetworkConnectionsGetSamples.java | 25 + ...bVirtualNetworkConnectionsListSamples.java | 24 + .../InboundNatRulesCreateOrUpdateSamples.java | 37 + .../InboundNatRulesDeleteSamples.java | 23 + .../generated/InboundNatRulesGetSamples.java | 24 + .../generated/InboundNatRulesListSamples.java | 23 + ...ityRuleOperationCreateOrUpdateSamples.java | 39 + ...nboundSecurityRuleOperationGetSamples.java | 25 + .../IpAllocationsCreateOrUpdateSamples.java | 47 + .../generated/IpAllocationsDeleteSamples.java | 23 + ...pAllocationsGetByResourceGroupSamples.java | 24 + ...AllocationsListByResourceGroupSamples.java | 24 + .../generated/IpAllocationsListSamples.java | 23 + .../IpAllocationsUpdateTagsSamples.java | 42 + .../IpGroupsCreateOrUpdateSamples.java | 45 + .../generated/IpGroupsDeleteSamples.java | 23 + .../IpGroupsGetByResourceGroupSamples.java | 24 + .../IpGroupsListByResourceGroupSamples.java | 24 + .../generated/IpGroupsListSamples.java | 24 + .../IpGroupsUpdateGroupsSamples.java | 42 + ...kendAddressPoolsCreateOrUpdateSamples.java | 42 + ...ancerBackendAddressPoolsDeleteSamples.java | 23 + ...BalancerBackendAddressPoolsGetSamples.java | 40 + ...alancerBackendAddressPoolsListSamples.java | 38 + ...cerFrontendIpConfigurationsGetSamples.java | 25 + ...erFrontendIpConfigurationsListSamples.java | 24 + ...dBalancerLoadBalancingRulesGetSamples.java | 25 + ...BalancerLoadBalancingRulesListSamples.java | 24 + ...dBalancerNetworkInterfacesListSamples.java | 38 + .../LoadBalancerOutboundRulesGetSamples.java | 24 + .../LoadBalancerOutboundRulesListSamples.java | 25 + .../LoadBalancerProbesGetSamples.java | 23 + .../LoadBalancerProbesListSamples.java | 23 + .../LoadBalancersCreateOrUpdateSamples.java | 560 + .../generated/LoadBalancersDeleteSamples.java | 23 + ...oadBalancersGetByResourceGroupSamples.java | 37 + ...adBalancersListByResourceGroupSamples.java | 24 + ...ListInboundNatRulePortMappingsSamples.java | 29 + .../generated/LoadBalancersListSamples.java | 23 + .../LoadBalancersMigrateToIpBasedSamples.java | 31 + ...BalancersSwapPublicIpAddressesSamples.java | 39 + .../LoadBalancersUpdateTagsSamples.java | 42 + ...lNetworkGatewaysCreateOrUpdateSamples.java | 34 + .../LocalNetworkGatewaysDeleteSamples.java | 24 + ...workGatewaysGetByResourceGroupSamples.java | 24 + ...orkGatewaysListByResourceGroupSamples.java | 23 + ...LocalNetworkGatewaysUpdateTagsSamples.java | 44 + ...nagerConnectionsCreateOrUpdateSamples.java | 30 + ...etworkManagerConnectionsDeleteSamples.java | 26 + ...upNetworkManagerConnectionsGetSamples.java | 25 + ...pNetworkManagerConnectionsListSamples.java | 25 + .../NatGatewaysCreateOrUpdateSamples.java | 37 + .../generated/NatGatewaysDeleteSamples.java | 23 + .../NatGatewaysGetByResourceGroupSamples.java | 24 + ...NatGatewaysListByResourceGroupSamples.java | 24 + .../generated/NatGatewaysListSamples.java | 23 + .../NatGatewaysUpdateTagsSamples.java | 42 + .../NatRulesCreateOrUpdateSamples.java | 37 + .../generated/NatRulesDeleteSamples.java | 23 + .../generated/NatRulesGetSamples.java | 23 + .../NatRulesListByVpnGatewaySamples.java | 23 + .../NetworkGroupsCreateOrUpdateSamples.java | 30 + .../generated/NetworkGroupsDeleteSamples.java | 25 + .../generated/NetworkGroupsGetSamples.java | 24 + .../generated/NetworkGroupsListSamples.java | 23 + ...rkInterfaceIpConfigurationsGetSamples.java | 25 + ...kInterfaceIpConfigurationsListSamples.java | 24 + ...workInterfaceLoadBalancersListSamples.java | 24 + ...apConfigurationsCreateOrUpdateSamples.java | 31 + ...terfaceTapConfigurationsDeleteSamples.java | 24 + ...kInterfaceTapConfigurationsGetSamples.java | 25 + ...InterfaceTapConfigurationsListSamples.java | 24 + ...etworkInterfacesCreateOrUpdateSamples.java | 67 + .../NetworkInterfacesDeleteSamples.java | 23 + ...rkInterfacesGetByResourceGroupSamples.java | 24 + ...etCloudServiceNetworkInterfaceSamples.java | 26 + ...terfacesGetEffectiveRouteTableSamples.java | 24 + ...MachineScaleSetIpConfigurationSamples.java | 26 + ...achineScaleSetNetworkInterfaceSamples.java | 26 + ...kInterfacesListByResourceGroupSamples.java | 24 + ...tCloudServiceNetworkInterfacesSamples.java | 24 + ...eRoleInstanceNetworkInterfacesSamples.java | 26 + ...EffectiveNetworkSecurityGroupsSamples.java | 24 + .../NetworkInterfacesListSamples.java | 23 + ...achineScaleSetIpConfigurationsSamples.java | 26 + ...chineScaleSetNetworkInterfacesSamples.java | 25 + ...ineScaleSetVMNetworkInterfacesSamples.java | 26 + .../NetworkInterfacesUpdateTagsSamples.java | 43 + .../NetworkManagerCommitsPostSamples.java | 32 + ...rDeploymentStatusOperationListSamples.java | 34 + ...ngConfigurationsCreateOrUpdateSamples.java | 28 + ...gerRoutingConfigurationsDeleteSamples.java | 25 + ...anagerRoutingConfigurationsGetSamples.java | 24 + ...nagerRoutingConfigurationsListSamples.java | 25 + .../NetworkManagersCreateOrUpdateSamples.java | 36 + .../NetworkManagersDeleteSamples.java | 23 + ...workManagersGetByResourceGroupSamples.java | 24 + ...orkManagersListByResourceGroupSamples.java | 23 + .../generated/NetworkManagersListSamples.java | 23 + .../NetworkManagersPatchSamples.java | 42 + .../NetworkProfilesCreateOrUpdateSamples.java | 38 + .../NetworkProfilesDeleteSamples.java | 23 + ...workProfilesGetByResourceGroupSamples.java | 40 + ...orkProfilesListByResourceGroupSamples.java | 24 + .../generated/NetworkProfilesListSamples.java | 23 + .../NetworkProfilesUpdateTagsSamples.java | 42 + ...rkSecurityGroupsCreateOrUpdateSamples.java | 61 + .../NetworkSecurityGroupsDeleteSamples.java | 24 + ...curityGroupsGetByResourceGroupSamples.java | 24 + ...urityGroupsListByResourceGroupSamples.java | 24 + .../NetworkSecurityGroupsListSamples.java | 25 + ...etworkSecurityGroupsUpdateTagsSamples.java | 43 + ...ianceConnectionsCreateOrUpdateSamples.java | 46 + ...tualApplianceConnectionsDeleteSamples.java | 25 + ...VirtualApplianceConnectionsGetSamples.java | 25 + ...irtualApplianceConnectionsListSamples.java | 24 + ...irtualAppliancesCreateOrUpdateSamples.java | 129 + ...NetworkVirtualAppliancesDeleteSamples.java | 25 + ...alAppliancesGetByResourceGroupSamples.java | 25 + ...lAppliancesListByResourceGroupSamples.java | 24 + .../NetworkVirtualAppliancesListSamples.java | 24 + ...etworkVirtualAppliancesRestartSamples.java | 38 + ...orkVirtualAppliancesUpdateTagsSamples.java | 43 + ...tworkWatchersCheckConnectivitySamples.java | 35 + .../NetworkWatchersCreateOrUpdateSamples.java | 23 + .../NetworkWatchersDeleteSamples.java | 23 + ...hersGetAzureReachabilityReportSamples.java | 37 + ...workWatchersGetByResourceGroupSamples.java | 23 + ...etworkWatchersGetFlowLogStatusSamples.java | 29 + ...NetworkConfigurationDiagnosticSamples.java | 38 + .../NetworkWatchersGetNextHopSamples.java | 34 + .../NetworkWatchersGetTopologySamples.java | 28 + ...tchersGetTroubleshootingResultSamples.java | 29 + ...workWatchersGetTroubleshootingSamples.java | 34 + ...workWatchersGetVMSecurityRulesSamples.java | 29 + ...WatchersListAvailableProvidersSamples.java | 32 + ...orkWatchersListByResourceGroupSamples.java | 23 + .../generated/NetworkWatchersListSamples.java | 23 + ...atchersSetFlowLogConfigurationSamples.java | 52 + .../NetworkWatchersUpdateTagsSamples.java | 42 + .../NetworkWatchersVerifyIpFlowSamples.java | 39 + .../generated/OperationsListSamples.java | 24 + .../P2SVpnGatewaysCreateOrUpdateSamples.java | 71 + .../P2SVpnGatewaysDeleteSamples.java | 23 + ...aysDisconnectP2SVpnConnectionsSamples.java | 30 + ...SVpnGatewaysGenerateVpnProfileSamples.java | 30 + ...SVpnGatewaysGetByResourceGroupSamples.java | 24 + ...P2SVpnConnectionHealthDetailedSamples.java | 32 + ...ewaysGetP2SVpnConnectionHealthSamples.java | 24 + ...VpnGatewaysListByResourceGroupSamples.java | 24 + .../generated/P2SVpnGatewaysListSamples.java | 24 + .../generated/P2SVpnGatewaysResetSamples.java | 23 + .../P2SVpnGatewaysUpdateTagsSamples.java | 42 + .../PacketCapturesCreateSamples.java | 43 + .../PacketCapturesDeleteSamples.java | 23 + .../generated/PacketCapturesGetSamples.java | 23 + .../PacketCapturesGetStatusSamples.java | 23 + .../generated/PacketCapturesListSamples.java | 23 + .../generated/PacketCapturesStopSamples.java | 23 + ...ressRouteCircuitConnectionsGetSamples.java | 26 + ...essRouteCircuitConnectionsListSamples.java | 25 + ...ateDnsZoneGroupsCreateOrUpdateSamples.java | 31 + .../PrivateDnsZoneGroupsDeleteSamples.java | 23 + .../PrivateDnsZoneGroupsGetSamples.java | 24 + .../PrivateDnsZoneGroupsListSamples.java | 24 + ...PrivateEndpointsCreateOrUpdateSamples.java | 103 + .../PrivateEndpointsDeleteSamples.java | 23 + ...ateEndpointsGetByResourceGroupSamples.java | 55 + ...teEndpointsListByResourceGroupSamples.java | 24 + .../PrivateEndpointsListSamples.java | 23 + ...rviceVisibilityByResourceGroupSamples.java | 30 + ...ckPrivateLinkServiceVisibilitySamples.java | 30 + ...vateLinkServicesCreateOrUpdateSamples.java | 49 + ...eletePrivateEndpointConnectionSamples.java | 25 + .../PrivateLinkServicesDeleteSamples.java | 23 + ...LinkServicesGetByResourceGroupSamples.java | 24 + ...esGetPrivateEndpointConnectionSamples.java | 26 + ...ateLinkServicesByResourceGroupSamples.java | 25 + ...utoApprovedPrivateLinkServicesSamples.java | 25 + ...inkServicesListByResourceGroupSamples.java | 24 + ...ListPrivateEndpointConnectionsSamples.java | 25 + .../PrivateLinkServicesListSamples.java | 24 + ...pdatePrivateEndpointConnectionSamples.java | 33 + ...ublicIpAddressesCreateOrUpdateSamples.java | 94 + ...pAddressesDdosProtectionStatusSamples.java | 24 + .../PublicIpAddressesDeleteSamples.java | 23 + ...cIpAddressesGetByResourceGroupSamples.java | 24 + ...GetCloudServicePublicIpAddressSamples.java | 25 + ...MachineScaleSetPublicIpAddressSamples.java | 25 + ...IpAddressesListByResourceGroupSamples.java | 24 + ...tCloudServicePublicIpAddressesSamples.java | 25 + ...eRoleInstancePublicIpAddressesSamples.java | 25 + .../PublicIpAddressesListSamples.java | 23 + ...chineScaleSetPublicIpAddressesSamples.java | 24 + ...ineScaleSetVMPublicIpAddressesSamples.java | 25 + .../PublicIpAddressesUpdateTagsSamples.java | 43 + ...PublicIpPrefixesCreateOrUpdateSamples.java | 58 + .../PublicIpPrefixesDeleteSamples.java | 23 + ...icIpPrefixesGetByResourceGroupSamples.java | 24 + ...cIpPrefixesListByResourceGroupSamples.java | 24 + .../PublicIpPrefixesListSamples.java | 23 + .../PublicIpPrefixesUpdateTagsSamples.java | 42 + .../ResourceNavigationLinksListSamples.java | 23 + ...oviderCheckDnsNameAvailabilitySamples.java | 24 + ...eteBastionShareableLinkByTokenSamples.java | 31 + ...iderDeleteBastionShareableLinkSamples.java | 37 + ...oviderDisconnectActiveSessionsSamples.java | 27 + ...oviderExpressRouteProviderPortSamples.java | 23 + ...nserverconfigurationvpnprofileSamples.java | 32 + ...ourceProviderGetActiveSessionsSamples.java | 24 + ...roviderGetBastionShareableLinkSamples.java | 36 + ...tiveConnectivityConfigurationsSamples.java | 31 + ...erListActiveSecurityAdminRulesSamples.java | 31 + ...tiveConnectivityConfigurationsSamples.java | 29 + ...gerEffectiveSecurityAdminRulesSamples.java | 29 + ...roviderPutBastionShareableLinkSamples.java | 37 + ...iderSupportedSecurityProvidersSamples.java | 24 + ...RouteFilterRulesCreateOrUpdateSamples.java | 33 + .../RouteFilterRulesDeleteSamples.java | 23 + .../generated/RouteFilterRulesGetSamples.java | 23 + ...teFilterRulesListByRouteFilterSamples.java | 24 + .../RouteFiltersCreateOrUpdateSamples.java | 51 + .../generated/RouteFiltersDeleteSamples.java | 23 + ...RouteFiltersGetByResourceGroupSamples.java | 24 + ...outeFiltersListByResourceGroupSamples.java | 24 + .../generated/RouteFiltersListSamples.java | 23 + .../RouteFiltersUpdateTagsSamples.java | 42 + .../RouteMapsCreateOrUpdateSamples.java | 48 + .../generated/RouteMapsDeleteSamples.java | 23 + .../generated/RouteMapsGetSamples.java | 23 + .../generated/RouteMapsListSamples.java | 23 + .../RouteTablesCreateOrUpdateSamples.java | 49 + .../generated/RouteTablesDeleteSamples.java | 23 + .../RouteTablesGetByResourceGroupSamples.java | 23 + ...RouteTablesListByResourceGroupSamples.java | 24 + .../generated/RouteTablesListSamples.java | 23 + .../RouteTablesUpdateTagsSamples.java | 42 + .../RoutesCreateOrUpdateSamples.java | 30 + .../generated/RoutesDeleteSamples.java | 23 + .../generated/generated/RoutesGetSamples.java | 23 + .../generated/RoutesListSamples.java | 23 + .../RoutingIntentCreateOrUpdateSamples.java | 38 + .../generated/RoutingIntentDeleteSamples.java | 23 + .../generated/RoutingIntentGetSamples.java | 23 + .../generated/RoutingIntentListSamples.java | 23 + ...gRuleCollectionsCreateOrUpdateSamples.java | 33 + .../RoutingRuleCollectionsDeleteSamples.java | 26 + .../RoutingRuleCollectionsGetSamples.java | 25 + .../RoutingRuleCollectionsListSamples.java | 24 + .../RoutingRulesCreateOrUpdateSamples.java | 57 + .../generated/RoutingRulesDeleteSamples.java | 25 + .../generated/RoutingRulesGetSamples.java | 26 + .../generated/RoutingRulesListSamples.java | 26 + ...ScopeConnectionsCreateOrUpdateSamples.java | 30 + .../ScopeConnectionsDeleteSamples.java | 25 + .../generated/ScopeConnectionsGetSamples.java | 25 + .../ScopeConnectionsListSamples.java | 24 + ...inConfigurationsCreateOrUpdateSamples.java | 32 + ...urityAdminConfigurationsDeleteSamples.java | 25 + ...SecurityAdminConfigurationsGetSamples.java | 25 + ...ecurityAdminConfigurationsListSamples.java | 25 + ...PartnerProvidersCreateOrUpdateSamples.java | 50 + ...SecurityPartnerProvidersDeleteSamples.java | 25 + ...nerProvidersGetByResourceGroupSamples.java | 25 + ...erProvidersListByResourceGroupSamples.java | 24 + .../SecurityPartnerProvidersListSamples.java | 24 + ...rityPartnerProvidersUpdateTagsSamples.java | 43 + .../SecurityRulesCreateOrUpdateSamples.java | 38 + .../generated/SecurityRulesDeleteSamples.java | 24 + .../generated/SecurityRulesGetSamples.java | 25 + .../generated/SecurityRulesListSamples.java | 25 + ...erConfigurationsCreateOrUpdateSamples.java | 28 + ...curityUserConfigurationsDeleteSamples.java | 25 + .../SecurityUserConfigurationsGetSamples.java | 25 + ...SecurityUserConfigurationsListSamples.java | 25 + ...rRuleCollectionsCreateOrUpdateSamples.java | 33 + ...urityUserRuleCollectionsDeleteSamples.java | 26 + ...SecurityUserRuleCollectionsGetSamples.java | 26 + ...ecurityUserRuleCollectionsListSamples.java | 25 + ...ecurityUserRulesCreateOrUpdateSamples.java | 41 + .../SecurityUserRulesDeleteSamples.java | 25 + .../SecurityUserRulesGetSamples.java | 25 + .../SecurityUserRulesListSamples.java | 25 + .../ServiceAssociationLinksListSamples.java | 23 + ...EndpointPoliciesCreateOrUpdateSamples.java | 56 + .../ServiceEndpointPoliciesDeleteSamples.java | 24 + ...ointPoliciesGetByResourceGroupSamples.java | 24 + ...intPoliciesListByResourceGroupSamples.java | 25 + .../ServiceEndpointPoliciesListSamples.java | 25 + ...viceEndpointPoliciesUpdateTagsSamples.java | 43 + ...olicyDefinitionsCreateOrUpdateSamples.java | 34 + ...ndpointPolicyDefinitionsDeleteSamples.java | 25 + ...ceEndpointPolicyDefinitionsGetSamples.java | 25 + ...DefinitionsListByResourceGroupSamples.java | 25 + .../ServiceTagInformationListSamples.java | 51 + .../generated/ServiceTagsListSamples.java | 23 + .../StaticMembersCreateOrUpdateSamples.java | 29 + .../generated/StaticMembersDeleteSamples.java | 25 + .../generated/StaticMembersGetSamples.java | 26 + .../generated/StaticMembersListSamples.java | 24 + .../SubnetsCreateOrUpdateSamples.java | 109 + .../generated/SubnetsDeleteSamples.java | 23 + .../generated/SubnetsGetSamples.java | 50 + .../generated/SubnetsListSamples.java | 23 + .../SubnetsPrepareNetworkPoliciesSamples.java | 29 + ...ubnetsUnprepareNetworkPoliciesSamples.java | 28 + ...nagerConnectionsCreateOrUpdateSamples.java | 28 + ...etworkManagerConnectionsDeleteSamples.java | 25 + ...onNetworkManagerConnectionsGetSamples.java | 25 + ...nNetworkManagerConnectionsListSamples.java | 24 + .../generated/UsagesListSamples.java | 36 + .../generated/VipSwapCreateSamples.java | 30 + .../generated/VipSwapGetSamples.java | 23 + .../generated/VipSwapListSamples.java | 23 + ...alApplianceSitesCreateOrUpdateSamples.java | 33 + .../VirtualApplianceSitesDeleteSamples.java | 24 + .../VirtualApplianceSitesGetSamples.java | 24 + .../VirtualApplianceSitesListSamples.java | 24 + .../VirtualApplianceSkusGetSamples.java | 25 + .../VirtualApplianceSkusListSamples.java | 24 + ...ubBgpConnectionsCreateOrUpdateSamples.java | 33 + ...VirtualHubBgpConnectionsDeleteSamples.java | 25 + .../VirtualHubBgpConnectionsGetSamples.java | 25 + ...onnectionsListAdvertisedRoutesSamples.java | 25 + ...gpConnectionsListLearnedRoutesSamples.java | 25 + .../VirtualHubBgpConnectionsListSamples.java | 24 + ...bIpConfigurationCreateOrUpdateSamples.java | 32 + ...irtualHubIpConfigurationDeleteSamples.java | 24 + .../VirtualHubIpConfigurationGetSamples.java | 26 + .../VirtualHubIpConfigurationListSamples.java | 24 + ...HubRouteTableV2SCreateOrUpdateSamples.java | 41 + .../VirtualHubRouteTableV2SDeleteSamples.java | 26 + .../VirtualHubRouteTableV2SGetSamples.java | 26 + .../VirtualHubRouteTableV2SListSamples.java | 24 + .../VirtualHubsCreateOrUpdateSamples.java | 48 + .../generated/VirtualHubsDeleteSamples.java | 23 + .../VirtualHubsGetByResourceGroupSamples.java | 23 + ...bsGetEffectiveVirtualHubRoutesSamples.java | 61 + .../VirtualHubsGetInboundRoutesSamples.java | 29 + .../VirtualHubsGetOutboundRoutesSamples.java | 29 + ...VirtualHubsListByResourceGroupSamples.java | 25 + .../generated/VirtualHubsListSamples.java | 23 + .../VirtualHubsUpdateTagsSamples.java | 42 + ...tewayConnectionsCreateOrUpdateSamples.java | 107 + ...etworkGatewayConnectionsDeleteSamples.java | 24 + ...yConnectionsGetByResourceGroupSamples.java | 25 + ...orkGatewayConnectionsGetIkeSasSamples.java | 24 + ...GatewayConnectionsGetSharedKeySamples.java | 25 + ...ConnectionsListByResourceGroupSamples.java | 24 + ...ewayConnectionsResetConnectionSamples.java | 24 + ...tewayConnectionsResetSharedKeySamples.java | 28 + ...GatewayConnectionsSetSharedKeySamples.java | 28 + ...yConnectionsStartPacketCaptureSamples.java | 44 + ...ayConnectionsStopPacketCaptureSamples.java | 29 + ...rkGatewayConnectionsUpdateTagsSamples.java | 43 + ...kGatewayNatRulesCreateOrUpdateSamples.java | 40 + ...alNetworkGatewayNatRulesDeleteSamples.java | 24 + ...rtualNetworkGatewayNatRulesGetSamples.java | 25 + ...lesListByVirtualNetworkGatewaySamples.java | 25 + ...lNetworkGatewaysCreateOrUpdateSamples.java | 138 + .../VirtualNetworkGatewaysDeleteSamples.java | 24 + ...alNetworkGatewayVpnConnectionsSamples.java | 30 + ...workGatewaysGenerateVpnProfileSamples.java | 27 + ...tewaysGeneratevpnclientpackageSamples.java | 26 + ...orkGatewaysGetAdvertisedRoutesSamples.java | 24 + ...etworkGatewaysGetBgpPeerStatusSamples.java | 24 + ...workGatewaysGetByResourceGroupSamples.java | 39 + ...etworkGatewaysGetLearnedRoutesSamples.java | 24 + ...atewaysGetVpnProfilePackageUrlSamples.java | 24 + ...ysGetVpnclientConnectionHealthSamples.java | 25 + ...aysGetVpnclientIpsecParametersSamples.java | 24 + ...orkGatewaysListByResourceGroupSamples.java | 25 + ...NetworkGatewaysListConnectionsSamples.java | 25 + .../VirtualNetworkGatewaysResetSamples.java | 24 + ...atewaysResetVpnClientSharedKeySamples.java | 23 + ...aysSetVpnclientIpsecParametersSamples.java | 42 + ...workGatewaysStartPacketCaptureSamples.java | 43 + ...tworkGatewaysStopPacketCaptureSamples.java | 29 + ...orkGatewaysSupportedVpnDevicesSamples.java | 25 + ...rtualNetworkGatewaysUpdateTagsSamples.java | 43 + ...ysVpnDeviceConfigurationScriptSamples.java | 31 + ...lNetworkPeeringsCreateOrUpdateSamples.java | 186 + .../VirtualNetworkPeeringsDeleteSamples.java | 24 + .../VirtualNetworkPeeringsGetSamples.java | 63 + .../VirtualNetworkPeeringsListSamples.java | 38 + ...rtualNetworkTapsCreateOrUpdateSamples.java | 31 + .../VirtualNetworkTapsDeleteSamples.java | 24 + ...lNetworkTapsGetByResourceGroupSamples.java | 24 + ...NetworkTapsListByResourceGroupSamples.java | 24 + .../VirtualNetworkTapsListSamples.java | 23 + .../VirtualNetworkTapsUpdateTagsSamples.java | 43 + ...orksCheckIpAddressAvailabilitySamples.java | 24 + .../VirtualNetworksCreateOrUpdateSamples.java | 195 + .../VirtualNetworksDeleteSamples.java | 23 + ...tualNetworksGetByResourceGroupSamples.java | 54 + ...ualNetworksListByResourceGroupSamples.java | 24 + ...tworksListDdosProtectionStatusSamples.java | 25 + .../generated/VirtualNetworksListSamples.java | 23 + .../VirtualNetworksListUsageSamples.java | 23 + .../VirtualNetworksUpdateTagsSamples.java | 42 + ...alRouterPeeringsCreateOrUpdateSamples.java | 28 + .../VirtualRouterPeeringsDeleteSamples.java | 24 + .../VirtualRouterPeeringsGetSamples.java | 24 + .../VirtualRouterPeeringsListSamples.java | 24 + .../VirtualRoutersCreateOrUpdateSamples.java | 46 + .../VirtualRoutersDeleteSamples.java | 23 + ...rtualRoutersGetByResourceGroupSamples.java | 24 + ...tualRoutersListByResourceGroupSamples.java | 24 + .../generated/VirtualRoutersListSamples.java | 24 + .../VirtualWansCreateOrUpdateSamples.java | 45 + .../generated/VirtualWansDeleteSamples.java | 23 + .../VirtualWansGetByResourceGroupSamples.java | 23 + ...VirtualWansListByResourceGroupSamples.java | 25 + .../generated/VirtualWansListSamples.java | 23 + .../VirtualWansUpdateTagsSamples.java | 42 + .../VpnConnectionsCreateOrUpdateSamples.java | 58 + .../VpnConnectionsDeleteSamples.java | 23 + .../generated/VpnConnectionsGetSamples.java | 23 + ...VpnConnectionsListByVpnGatewaySamples.java | 23 + ...nConnectionsStartPacketCaptureSamples.java | 50 + ...pnConnectionsStopPacketCaptureSamples.java | 32 + .../VpnGatewaysCreateOrUpdateSamples.java | 82 + .../generated/VpnGatewaysDeleteSamples.java | 23 + .../VpnGatewaysGetByResourceGroupSamples.java | 23 + ...VpnGatewaysListByResourceGroupSamples.java | 25 + .../generated/VpnGatewaysListSamples.java | 24 + .../generated/VpnGatewaysResetSamples.java | 23 + .../VpnGatewaysStartPacketCaptureSamples.java | 44 + .../VpnGatewaysStopPacketCaptureSamples.java | 30 + .../VpnGatewaysUpdateTagsSamples.java | 42 + ...inkConnectionsGetAllSharedKeysSamples.java | 26 + ...ConnectionsGetDefaultSharedKeySamples.java | 26 + .../VpnLinkConnectionsGetIkeSasSamples.java | 24 + ...ConnectionsListByVpnConnectionSamples.java | 25 + ...onnectionsListDefaultSharedKeySamples.java | 26 + ...LinkConnectionsResetConnectionSamples.java | 25 + ...tionsSetOrInitDefaultSharedKeySamples.java | 31 + ...nsAssociatedWithVirtualWanListSamples.java | 25 + ...erConfigurationsCreateOrUpdateSamples.java | 104 + .../VpnServerConfigurationsDeleteSamples.java | 25 + ...nfigurationsGetByResourceGroupSamples.java | 25 + ...figurationsListByResourceGroupSamples.java | 24 + .../VpnServerConfigurationsListSamples.java | 24 + ...ServerConfigurationsUpdateTagsSamples.java | 43 + .../VpnSiteLinkConnectionsGetSamples.java | 24 + .../generated/VpnSiteLinksGetSamples.java | 23 + .../VpnSiteLinksListByVpnSiteSamples.java | 23 + .../VpnSitesConfigurationDownloadSamples.java | 34 + .../VpnSitesCreateOrUpdateSamples.java | 63 + .../generated/VpnSitesDeleteSamples.java | 23 + .../VpnSitesGetByResourceGroupSamples.java | 23 + .../VpnSitesListByResourceGroupSamples.java | 24 + .../generated/VpnSitesListSamples.java | 23 + .../generated/VpnSitesUpdateTagsSamples.java | 42 + ...FirewallPoliciesCreateOrUpdateSamples.java | 229 + ...licationFirewallPoliciesDeleteSamples.java | 24 + ...wallPoliciesGetByResourceGroupSamples.java | 25 + ...allPoliciesListByResourceGroupSamples.java | 24 + ...pplicationFirewallPoliciesListSamples.java | 24 + .../generated/WebCategoriesGetSamples.java | 23 + .../generated/WebCategoriesListSamples.java | 24 + sdk/network/ci.yml | 46 + sdk/network/pom.xml | 15 + 2796 files changed, 536119 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/SAMPLE.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/AdminRuleCollectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRulesClient.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/ApplicationGatewayWafDynamicManifestsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayWafDynamicManifestsDefaultsClient.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/ConfigurationPolicyGroupsClient.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/ConnectivityConfigurationsClient.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/ExpressRoutePortAuthorizationsClient.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/ExpressRouteProviderPortsLocationsClient.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/FirewallPolicyDeploymentsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyDraftsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesFilterValuesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesOverridesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupDraftsClient.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/ManagementGroupNetworkManagerConnectionsClient.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/NetworkGroupsClient.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/NetworkManagerCommitsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerDeploymentStatusOperationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerRoutingConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagersClient.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/NetworkVirtualApplianceConnectionsClient.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/RouteMapsClient.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/RoutingIntentsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingRuleCollectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingRulesClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ScopeConnectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityAdminConfigurationsClient.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/SecurityUserConfigurationsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRuleCollectionsClient.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRulesClient.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/ServiceTagInformationsClient.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/StaticMembersClient.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/SubscriptionNetworkManagerConnectionsClient.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/VipSwapsClient.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/ActiveConnectivityConfigurationsListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveSecurityAdminRulesListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.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/ApplicationGatewayAvailableSslOptionsPropertiesFormat.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/ApplicationGatewayBackendAddressPoolPropertiesFormat.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/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendSettingsPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.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/ApplicationGatewayIpConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayListenerPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPathRulePropertiesFormat.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/ApplicationGatewayPrivateEndpointConnectionPropertiesInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkConfigurationProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkIpConfigurationProperties.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/ApplicationGatewayPrivateLinkResourceProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayProbePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRoutingRulePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.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/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslProfilePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestPropertiesResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestResultInner.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/ApplicationSecurityGroupPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AuthorizationPropertiesFormat.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/AzureFirewallApplicationRuleCollectionPropertiesFormat.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/AzureFirewallFqdnTagPropertiesFormat.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/AzureFirewallIpConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNatRuleCollectionProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallPropertiesFormat.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/AzureWebCategoryPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressInboundNatRulePortMappingsInner.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/BackendAddressPoolPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BaseAdminRuleInner.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/BastionHostIpConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostPropertiesFormat.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/BgpConnectionProperties.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/BgpServiceCommunityPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorParameters.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/ConnectionMonitorResultProperties.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/ConnectionSharedKeyResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationProperties.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/ContainerNetworkInterfaceConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfacePropertiesFormat.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/CustomIpPrefixPropertiesFormat.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/DdosCustomPolicyPropertiesFormat.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/DdosProtectionPlanPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultAdminPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultRuleSetPropertyFormat.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/DscpConfigurationPropertiesFormat.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/EffectiveRouteMapRouteListInner.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/ExpressRouteCircuitConnectionPropertiesFormat.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/ExpressRouteCircuitPeeringPropertiesFormatInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPropertiesFormat.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/ExpressRouteConnectionProperties.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/ExpressRouteCrossConnectionPeeringProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionProperties.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/ExpressRouteGatewayProperties.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/ExpressRouteLinkPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationPropertiesFormat.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/ExpressRoutePortPropertiesFormat.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/ExpressRoutePortsLocationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortProperties.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/ExpressRouteServiceProviderPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftProperties.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/FirewallPolicyPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftProperties.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/FirewallPolicyRuleCollectionGroupProperties.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/FlowLogProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogPropertiesFormat.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/FrontendIpConfigurationPropertiesFormatInner.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/HopLinkProperties.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/HubIpConfigurationPropertiesFormatInner.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/HubRouteTableProperties.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/HubVirtualNetworkConnectionProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatPoolPropertiesFormat.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/InboundNatRulePropertiesFormatInner.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/InboundSecurityRuleProperties.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/IpAllocationPropertiesFormat.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/IpConfigurationProfilePropertiesFormatInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationPropertiesFormatInner.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/IpGroupPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpPrefixesListInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerBackendAddressPropertiesFormat.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/LoadBalancerPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.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/LoadBalancingRulePropertiesFormat.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/LocalNetworkGatewayPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/MigratedPoolsInner.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/NatGatewayPropertiesFormat.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/NetworkGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupProperties.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/NetworkInterfaceIpConfigurationPropertiesFormatInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfacePropertiesFormatInner.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/NetworkInterfaceTapConfigurationPropertiesFormatInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerCommitInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerDeploymentStatusListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveConnectivityConfigurationListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveSecurityAdminRulesListResultInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationPropertiesFormat.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/NetworkProfilePropertiesFormat.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/NetworkSecurityGroupPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionProperties.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/NetworkVirtualApplianceInstanceIdsInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualAppliancePropertiesFormat.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/NetworkVirtualApplianceSkuPropertiesFormat.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/NetworkWatcherPropertiesFormat.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/OperationPropertiesFormat.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/OutboundRulePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SConnectionConfigurationProperties.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/P2SVpnGatewayProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureParameters.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/PacketCaptureResultProperties.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/PeerExpressRouteCircuitConnectionPropertiesFormat.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/PrivateDnsZoneGroupPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZonePropertiesFormat.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/PrivateEndpointConnectionPropertiesInner.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/PrivateEndpointIpConfigurationProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointPropertiesInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceConnectionProperties.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/PrivateLinkServiceIpConfigurationPropertiesInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceProperties.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/ProbePropertiesFormat.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/PublicIpAddressPropertiesFormatInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpDdosProtectionStatusResultInner.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/PublicIpPrefixPropertiesFormatInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/QueryResultsInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinkFormat.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/RouteFilterPropertiesFormat.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/RouteFilterRulePropertiesFormat.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/RouteMapInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutePropertiesFormat.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/RouteTablePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRulePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationPropertiesFormat.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/SecurityPartnerProviderPropertiesFormat.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/SecurityRulePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRulePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinkPropertiesFormat.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/ServiceDelegationPropertiesFormat.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/ServiceEndpointPolicyDefinitionPropertiesFormat.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/ServiceEndpointPolicyPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagInformationInner.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/SignatureOverridesFilterValuesResponseInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesListInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberProperties.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/SubnetPropertiesFormatInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceListResultInner.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/TroubleshootingProperties.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/VirtualApplianceSiteProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubEffectiveRouteListInner.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/VirtualHubProperties.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/VirtualHubRouteTableV2Properties.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/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.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/VirtualNetworkGatewayIpConfigurationPropertiesFormat.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/VirtualNetworkGatewayNatRuleProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPolicyGroupProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPropertiesFormat.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/VirtualNetworkPeeringPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPropertiesFormat.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/VirtualNetworkTapPropertiesFormatInner.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/VirtualRouterPeeringProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPropertiesFormat.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/VirtualWanProperties.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/VngClientConnectionConfigurationProperties.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/VpnClientRevokedCertificatePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRootCertificatePropertiesFormat.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/VpnConnectionProperties.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/VpnGatewayNatRuleProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayProperties.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/VpnServerConfigurationPolicyGroupInner.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationProperties.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/VpnSiteLinkConnectionProperties.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/VpnSiteLinkProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteProperties.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/WebApplicationFirewallPolicyPropertiesFormat.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/ActiveConnectivityConfigurationsListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ActiveSecurityAdminRulesListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesImpl.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/ApplicationGatewayPrivateEndpointConnectionPropertiesImpl.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/ApplicationGatewayWafDynamicManifestResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsImpl.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/BackendAddressInboundNatRulePortMappingsImpl.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/BaseAdminRuleImpl.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/ConfigurationPolicyGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConfigurationPolicyGroupsImpl.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/ConnectionSharedKeyResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsImpl.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/EffectiveRouteMapRouteListImpl.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/ExpressRouteCircuitPeeringPropertiesFormatImpl.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/ExpressRoutePortAuthorizationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsImpl.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/ExpressRouteProviderPortImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsImpl.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/FirewallPolicyDeploymentsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDeploymentsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesImpl.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/FirewallPolicyRuleCollectionGroupDraftImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftsImpl.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/FrontendIpConfigurationPropertiesFormatImpl.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/HubIpConfigurationPropertiesFormatImpl.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/InboundNatRulePropertiesFormatImpl.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/IpConfigurationProfilePropertiesFormatImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationPropertiesFormatImpl.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/IpPrefixesListImpl.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/ManagementGroupNetworkManagerConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/MigratedPoolsImpl.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/NetworkGroupImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsImpl.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/NetworkInterfaceIpConfigurationPropertiesFormatImpl.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/NetworkInterfacePropertiesFormatImpl.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/NetworkInterfaceTapConfigurationPropertiesFormatImpl.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/NetworkManagerCommitImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerEffectiveConnectivityConfigurationListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerEffectiveSecurityAdminRulesListResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersImpl.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/NetworkVirtualApplianceConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionsImpl.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/NetworkVirtualApplianceInstanceIdsImpl.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/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/PrivateEndpointConnectionPropertiesImpl.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/PrivateEndpointPropertiesImpl.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/PrivateLinkServiceIpConfigurationPropertiesImpl.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/PublicIpAddressPropertiesFormatImpl.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/PublicIpDdosProtectionStatusResultImpl.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/PublicIpPrefixPropertiesFormatImpl.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/QueryResultsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceManagerUtils.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/RouteMapImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsImpl.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/RoutingIntentImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsImpl.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/SecurityUserConfigurationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRulesClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRulesImpl.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/ServiceTagInformationImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsImpl.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/SignatureOverridesFilterValuesResponseImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesListImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMemberImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersImpl.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/SubnetPropertiesFormatImpl.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/SubscriptionNetworkManagerConnectionsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceListResultImpl.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/VerificationIpFlowResultImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsClientImpl.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsImpl.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/VirtualHubEffectiveRouteListImpl.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/VirtualNetworkGatewayConnectionPropertiesFormatImpl.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/VirtualNetworkTapPropertiesFormatImpl.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/VpnServerConfigurationPolicyGroupImpl.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/Action.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveBaseSecurityAdminRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConfigurationParameter.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfigurationsListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveDefaultSecurityAdminRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRulesListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixType.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/AdminRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleKind.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminState.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/ApplicationGatewayBackendSettings.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/ApplicationGatewayClientRevocationOptions.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/ApplicationGatewayFirewallManifestRuleSet.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/ApplicationGatewayFirewallRateLimitDuration.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/ApplicationGatewayFirewallUserSessionVariable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayForContainersReferenceDefinition.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/ApplicationGatewayGlobalConfiguration.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/ApplicationGatewayListener.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionAlgorithm.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionTarget.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/ApplicationGatewayPrivateEndpointConnectionProperties.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/ApplicationGatewayRoutingRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRuleSetStatusOptions.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/ApplicationGatewaySkuFamily.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/ApplicationGatewayTierTypes.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/ApplicationGatewayWafDynamicManifestResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResultList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifests.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestsDefaults.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleActionTypes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleSensitivityTypes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleStateTypes.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/AutoLearnPrivateRangesMode.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/AzureFirewallAutoscaleConfiguration.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/AzureFirewallPacketCaptureFlags.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureFlagsType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureRule.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/BackendAddressInboundNatRulePortMappings.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/BaseAdminRule.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/BastionHostPropertiesFormatNetworkAcls.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/BastionShareableLinkTokenListRequest.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/ChildResource.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/ConfigurationGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationPolicyGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationType.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/ConnectionMonitorEndpointLocationDetails.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/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/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/ConnectionSharedKeyResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKeyResultList.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/ConnectivityConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurations.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/ConnectivityGroupItem.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/ConnectivityTopology.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/Criterion.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CrossTenantScopes.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/CustomIpPrefixType.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/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/DdosSettingsProtectionMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultAdminRule.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/DelegationProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteExistingPeering.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/DeploymentStatus.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/DisableBgpRoutePropagation.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/EffectiveAdminRuleKind.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveBaseSecurityAdminRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveConnectivityConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveDefaultSecurityAdminRule.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/EffectiveRouteMapRoute.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteMapRouteList.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/EffectiveSecurityAdminRule.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/ExceptionEntry.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryMatchVariable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntrySelectorMatchOperator.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryValueMatchOperator.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleSet.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxy.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/ExpressRouteCircuitPeeringPropertiesFormat.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/ExpressRoutePortAuthorization.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationUseStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizations.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/ExpressRoutePortsBillingType.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/ExpressRouteProviderPort.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortsLocations.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/FilterItems.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPacketCaptureParameters.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/FirewallPolicyDeployments.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDraft.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDrafts.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/FirewallPolicyHttpHeaderToInsert.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsQuerySortOrder.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureDirection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureSeverity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatures.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesFilterValues.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesOverrides.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/FirewallPolicyIntrusionDetectionProfileType.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/FirewallPolicyRuleCollectionGroupDraft.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupDrafts.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/FirewallPolicySql.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/FrontendIpConfigurationPropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayCustomBgpIpAddressIpConfiguration.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/Geo.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetInboundRoutesParameters.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetOutboundRoutesParameters.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/GroupByUserSession.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupByVariable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupConnectivity.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupMemberType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HeaderValueMatcher.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/Hub.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/HubIpConfigurationPropertiesFormat.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/HubRoutingPreference.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/IdpsQueryObject.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/InboundNatRulePortMapping.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePropertiesFormat.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/InboundSecurityRuleType.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/InternetIngressPublicIpsProperties.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/IpConfigurationProfilePropertiesFormat.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationPropertiesFormat.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/IpPrefixesList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpRule.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/IsGlobal.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsWorkloadProtected.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/ListRouteMapsResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRoutingIntentResult.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/ListVpnServerConfigurationPolicyGroupsResult.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/LoadBalancerBackendAddressAdminState.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/ManagementGroupNetworkManagerConnections.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/MigrateLoadBalancerToIpBasedRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MigratedPools.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/NatRulePortMapping.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/NetworkGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroups.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateHeaders.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateResponse.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/NetworkIntentPolicyBasedService.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/NetworkInterfaceAuxiliaryMode.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliarySku.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/NetworkInterfaceIpConfigurationPropertiesFormat.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/NetworkInterfacePropertiesFormat.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/NetworkInterfaceTapConfigurationPropertiesFormat.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/NetworkManager.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommit.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommits.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatus.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusOperations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusParameter.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveConnectivityConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveSecurityAdminRulesListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerPropertiesNetworkManagerScopes.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingGroupItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerSecurityGroupItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagers.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/NetworkVirtualApplianceConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnectionList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceInstanceIds.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/NetworkVirtualAppliancePropertiesFormatNetworkProfile.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/NextStep.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInResponse.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/OrderBy.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/PacketCaptureMachineScope.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/PacketCaptureSettings.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/PacketCaptureTargetType.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/Parameter.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PartnerManagedResourceProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PatchObject.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/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/PolicySettingsLogScrubbing.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/PrivateEndpointConnectionProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointIpConfiguration.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/PrivateEndpointProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointVNetPolicies.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/PrivateLinkServiceIpConfigurationProperties.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/ProbeNoHealthyBackendsBehavior.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/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/PublicIpAddressDnsSettingsDomainNameLabelScope.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/PublicIpAddressPropertiesFormat.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/PublicIpDdosProtectionStatusResult.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/PublicIpPrefixPropertiesFormat.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/QosDefinition.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/QueryInboundNatRulePortMappingRequest.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryRequestOptions.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryResults.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/ResiliencyModel.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/RouteMap.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapActionType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapMatchCondition.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMaps.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/RoutingIntent.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntents.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingPolicy.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleDestinationType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHop.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHopType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleRouteDestination.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRules.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/ScopeConnection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchOperator.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchVariable.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleAccess.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleDirection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleProtocol.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/SecurityUserConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurationListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurations.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserGroupItem.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRule.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollection.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollectionListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SensitivityType.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/ServiceTagInformationListResult.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/ServiceTagInformations.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/SharedKeyProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SharingScope.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesQuery.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesResponse.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverrides.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesList.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResult.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/SlotType.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMember.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMemberListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMembers.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/StaticRoutesConfig.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/SubnetPropertiesFormat.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/SubscriptionNetworkManagerConnections.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResource.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceListResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncMode.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/UseHubGateway.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/VipSwaps.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceAdditionalNicProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfigurationProperties.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfiguration.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfigurationProperties.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/VirtualHubEffectiveRouteList.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/VirtualNetworkDdosProtectionStatusResult.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryption.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryptionEnforcement.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/VirtualNetworkGatewayAutoScaleBounds.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayAutoScaleConfiguration.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/VirtualNetworkGatewayConnectionPropertiesFormat.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/VirtualNetworkGatewayPolicyGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroupMember.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/VirtualNetworkTapPropertiesFormat.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/VirtualRouterAutoScaleConfiguration.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/VnetLocalRouteOverrideCriteria.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/VngClientConnectionConfiguration.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/VpnPolicyMemberAttributeType.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/VpnServerConfigurationPolicyGroup.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroupMember.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/WebApplicationFirewallScrubbingRules.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallScrubbingState.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallState.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/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/proxy-config.json create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/reflect-config.json create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateLinkResourcesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsDefaultGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthOnDemandSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStartSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStopSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableDelegationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableEndpointServicesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableResourceGroupDelegationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallFqdnTagsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListLearnedPrefixesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BgpServiceCommunitiesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsListByVpnServerConfigurationSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsQuerySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStartSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStopSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetPeeringStatsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetStatsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListArpTableSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListArpTableSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListBySubscriptionSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGenerateLoaSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteProviderPortsLocationListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteServiceProvidersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDeploymentsDeploySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsUpdateGroupsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerNetworkInterfacesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListInboundNatRulePortMappingsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersMigrateToIpBasedSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersSwapPublicIpAddressesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesListByVpnGatewaySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceLoadBalancersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetCloudServiceNetworkInterfaceSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetEffectiveRouteTableSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceNetworkInterfacesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerCommitsPostSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerDeploymentStatusOperationListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersPatchSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesRestartSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCheckConnectivitySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetAzureReachabilityReportSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetFlowLogStatusSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNetworkConfigurationDiagnosticSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNextHopSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTopologySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingResultSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetVMSecurityRulesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListAvailableProvidersSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersSetFlowLogConfigurationSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersVerifyIpFlowSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/OperationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGenerateVpnProfileSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysResetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesCreateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetStatusSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesStopSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeletePrivateEndpointConnectionSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetPrivateEndpointConnectionSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListPrivateEndpointConnectionsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesUpdatePrivateEndpointConnectionSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDdosProtectionStatusSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetCloudServicePublicIpAddressSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServicePublicIpAddressesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceNavigationLinksListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderCheckDnsNameAvailabilitySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkByTokenSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDisconnectActiveSessionsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderExpressRouteProviderPortSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetActiveSessionsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetBastionShareableLinkSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveConnectivityConfigurationsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveSecurityAdminRulesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderPutBastionShareableLinkSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderSupportedSecurityProvidersSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesListByRouteFilterSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceAssociationLinksListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagInformationListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsPrepareNetworkPoliciesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsUnprepareNetworkPoliciesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/UsagesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapCreateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListAdvertisedRoutesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListLearnedRoutesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetEffectiveVirtualHubRoutesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetInboundRoutesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetOutboundRoutesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetIkeSasSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetSharedKeySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetConnectionSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetSharedKeySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsSetSharedKeySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStartPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStopPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGenerateVpnProfileSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGeneratevpnclientpackageSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetAdvertisedRoutesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetBgpPeerStatusSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetLearnedRoutesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListConnectionsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetVpnClientSharedKeySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStartPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStopPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSupportedVpnDevicesSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCheckIpAddressAvailabilitySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListDdosProtectionStatusSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListUsageSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsListByVpnGatewaySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStartPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStopPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysResetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStartPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStopPacketCaptureSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetAllSharedKeysSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetDefaultSharedKeySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetIkeSasSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListByVpnConnectionSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListDefaultSharedKeySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsResetConnectionSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsSetOrInitDefaultSharedKeySamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsAssociatedWithVirtualWanListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinkConnectionsGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksListByVpnSiteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesConfigurationDownloadSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesUpdateTagsSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesCreateOrUpdateSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesDeleteSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesGetByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListByResourceGroupSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesGetSamples.java create mode 100644 sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesListSamples.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 8e3656e1b7bd2..c932ca699bbe3 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -474,6 +474,7 @@ com.azure.resourcemanager:azure-resourcemanager-computeschedule;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-trustedsigning;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-iotoperations;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-containerorchestratorruntime;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 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.1 diff --git a/pom.xml b/pom.xml index 866c8c788a53b..bb0871f6f801f 100644 --- a/pom.xml +++ b/pom.xml @@ -149,6 +149,7 @@ sdk/mysql sdk/mysqlflexibleserver sdk/netapp + sdk/network sdk/networkanalytics sdk/networkcloud sdk/networkfunction 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..de79382157f6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2024-11-07) + +- Azure Resource Manager Network client library for Java. This package contains Microsoft Azure SDK for Network Management SDK. Network Client. Package tag package-2024-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-network-generated Java SDK. 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..12ed2756a256c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/README.md @@ -0,0 +1,104 @@ +# 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-2024-03. 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the 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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fnetwork%2Fazure-resourcemanager-network-generated%2FREADME.png) diff --git a/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md new file mode 100644 index 0000000000000..a26a275f9362b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/SAMPLE.md @@ -0,0 +1,22271 @@ +# Code snippets and samples + + +## AdminRuleCollections + +- [CreateOrUpdate](#adminrulecollections_createorupdate) +- [Delete](#adminrulecollections_delete) +- [Get](#adminrulecollections_get) +- [List](#adminrulecollections_list) + +## AdminRules + +- [CreateOrUpdate](#adminrules_createorupdate) +- [Delete](#adminrules_delete) +- [Get](#adminrules_get) +- [List](#adminrules_list) + +## ApplicationGatewayPrivateEndpointConnections + +- [Delete](#applicationgatewayprivateendpointconnections_delete) +- [Get](#applicationgatewayprivateendpointconnections_get) +- [List](#applicationgatewayprivateendpointconnections_list) +- [Update](#applicationgatewayprivateendpointconnections_update) + +## ApplicationGatewayPrivateLinkResources + +- [List](#applicationgatewayprivatelinkresources_list) + +## ApplicationGatewayWafDynamicManifests + +- [Get](#applicationgatewaywafdynamicmanifests_get) + +## ApplicationGatewayWafDynamicManifestsDefault + +- [Get](#applicationgatewaywafdynamicmanifestsdefault_get) + +## ApplicationGateways + +- [BackendHealth](#applicationgateways_backendhealth) +- [BackendHealthOnDemand](#applicationgateways_backendhealthondemand) +- [CreateOrUpdate](#applicationgateways_createorupdate) +- [Delete](#applicationgateways_delete) +- [GetByResourceGroup](#applicationgateways_getbyresourcegroup) +- [GetSslPredefinedPolicy](#applicationgateways_getsslpredefinedpolicy) +- [List](#applicationgateways_list) +- [ListAvailableRequestHeaders](#applicationgateways_listavailablerequestheaders) +- [ListAvailableResponseHeaders](#applicationgateways_listavailableresponseheaders) +- [ListAvailableServerVariables](#applicationgateways_listavailableservervariables) +- [ListAvailableSslOptions](#applicationgateways_listavailablessloptions) +- [ListAvailableSslPredefinedPolicies](#applicationgateways_listavailablesslpredefinedpolicies) +- [ListAvailableWafRuleSets](#applicationgateways_listavailablewafrulesets) +- [ListByResourceGroup](#applicationgateways_listbyresourcegroup) +- [Start](#applicationgateways_start) +- [Stop](#applicationgateways_stop) +- [UpdateTags](#applicationgateways_updatetags) + +## ApplicationSecurityGroups + +- [CreateOrUpdate](#applicationsecuritygroups_createorupdate) +- [Delete](#applicationsecuritygroups_delete) +- [GetByResourceGroup](#applicationsecuritygroups_getbyresourcegroup) +- [List](#applicationsecuritygroups_list) +- [ListByResourceGroup](#applicationsecuritygroups_listbyresourcegroup) +- [UpdateTags](#applicationsecuritygroups_updatetags) + +## AvailableDelegations + +- [List](#availabledelegations_list) + +## AvailableEndpointServices + +- [List](#availableendpointservices_list) + +## AvailablePrivateEndpointTypes + +- [List](#availableprivateendpointtypes_list) +- [ListByResourceGroup](#availableprivateendpointtypes_listbyresourcegroup) + +## AvailableResourceGroupDelegations + +- [List](#availableresourcegroupdelegations_list) + +## AvailableServiceAliases + +- [List](#availableservicealiases_list) +- [ListByResourceGroup](#availableservicealiases_listbyresourcegroup) + +## AzureFirewallFqdnTags + +- [List](#azurefirewallfqdntags_list) + +## AzureFirewalls + +- [CreateOrUpdate](#azurefirewalls_createorupdate) +- [Delete](#azurefirewalls_delete) +- [GetByResourceGroup](#azurefirewalls_getbyresourcegroup) +- [List](#azurefirewalls_list) +- [ListByResourceGroup](#azurefirewalls_listbyresourcegroup) +- [ListLearnedPrefixes](#azurefirewalls_listlearnedprefixes) +- [PacketCapture](#azurefirewalls_packetcapture) +- [UpdateTags](#azurefirewalls_updatetags) + +## BastionHosts + +- [CreateOrUpdate](#bastionhosts_createorupdate) +- [Delete](#bastionhosts_delete) +- [GetByResourceGroup](#bastionhosts_getbyresourcegroup) +- [List](#bastionhosts_list) +- [ListByResourceGroup](#bastionhosts_listbyresourcegroup) +- [UpdateTags](#bastionhosts_updatetags) + +## BgpServiceCommunities + +- [List](#bgpservicecommunities_list) + +## ConfigurationPolicyGroups + +- [CreateOrUpdate](#configurationpolicygroups_createorupdate) +- [Delete](#configurationpolicygroups_delete) +- [Get](#configurationpolicygroups_get) +- [ListByVpnServerConfiguration](#configurationpolicygroups_listbyvpnserverconfiguration) + +## ConnectionMonitors + +- [CreateOrUpdate](#connectionmonitors_createorupdate) +- [Delete](#connectionmonitors_delete) +- [Get](#connectionmonitors_get) +- [List](#connectionmonitors_list) +- [Query](#connectionmonitors_query) +- [Start](#connectionmonitors_start) +- [Stop](#connectionmonitors_stop) +- [UpdateTags](#connectionmonitors_updatetags) + +## ConnectivityConfigurations + +- [CreateOrUpdate](#connectivityconfigurations_createorupdate) +- [Delete](#connectivityconfigurations_delete) +- [Get](#connectivityconfigurations_get) +- [List](#connectivityconfigurations_list) + +## CustomIpPrefixes + +- [CreateOrUpdate](#customipprefixes_createorupdate) +- [Delete](#customipprefixes_delete) +- [GetByResourceGroup](#customipprefixes_getbyresourcegroup) +- [List](#customipprefixes_list) +- [ListByResourceGroup](#customipprefixes_listbyresourcegroup) +- [UpdateTags](#customipprefixes_updatetags) + +## DdosCustomPolicies + +- [CreateOrUpdate](#ddoscustompolicies_createorupdate) +- [Delete](#ddoscustompolicies_delete) +- [GetByResourceGroup](#ddoscustompolicies_getbyresourcegroup) +- [UpdateTags](#ddoscustompolicies_updatetags) + +## DdosProtectionPlans + +- [CreateOrUpdate](#ddosprotectionplans_createorupdate) +- [Delete](#ddosprotectionplans_delete) +- [GetByResourceGroup](#ddosprotectionplans_getbyresourcegroup) +- [List](#ddosprotectionplans_list) +- [ListByResourceGroup](#ddosprotectionplans_listbyresourcegroup) +- [UpdateTags](#ddosprotectionplans_updatetags) + +## DefaultSecurityRules + +- [Get](#defaultsecurityrules_get) +- [List](#defaultsecurityrules_list) + +## DscpConfiguration + +- [CreateOrUpdate](#dscpconfiguration_createorupdate) +- [Delete](#dscpconfiguration_delete) +- [GetByResourceGroup](#dscpconfiguration_getbyresourcegroup) +- [List](#dscpconfiguration_list) +- [ListByResourceGroup](#dscpconfiguration_listbyresourcegroup) + +## ExpressRouteCircuitAuthorizations + +- [CreateOrUpdate](#expressroutecircuitauthorizations_createorupdate) +- [Delete](#expressroutecircuitauthorizations_delete) +- [Get](#expressroutecircuitauthorizations_get) +- [List](#expressroutecircuitauthorizations_list) + +## ExpressRouteCircuitConnections + +- [CreateOrUpdate](#expressroutecircuitconnections_createorupdate) +- [Delete](#expressroutecircuitconnections_delete) +- [Get](#expressroutecircuitconnections_get) +- [List](#expressroutecircuitconnections_list) + +## ExpressRouteCircuitPeerings + +- [CreateOrUpdate](#expressroutecircuitpeerings_createorupdate) +- [Delete](#expressroutecircuitpeerings_delete) +- [Get](#expressroutecircuitpeerings_get) +- [List](#expressroutecircuitpeerings_list) + +## ExpressRouteCircuits + +- [CreateOrUpdate](#expressroutecircuits_createorupdate) +- [Delete](#expressroutecircuits_delete) +- [GetByResourceGroup](#expressroutecircuits_getbyresourcegroup) +- [GetPeeringStats](#expressroutecircuits_getpeeringstats) +- [GetStats](#expressroutecircuits_getstats) +- [List](#expressroutecircuits_list) +- [ListArpTable](#expressroutecircuits_listarptable) +- [ListByResourceGroup](#expressroutecircuits_listbyresourcegroup) +- [ListRoutesTable](#expressroutecircuits_listroutestable) +- [ListRoutesTableSummary](#expressroutecircuits_listroutestablesummary) +- [UpdateTags](#expressroutecircuits_updatetags) + +## ExpressRouteConnections + +- [CreateOrUpdate](#expressrouteconnections_createorupdate) +- [Delete](#expressrouteconnections_delete) +- [Get](#expressrouteconnections_get) +- [List](#expressrouteconnections_list) + +## ExpressRouteCrossConnectionPeerings + +- [CreateOrUpdate](#expressroutecrossconnectionpeerings_createorupdate) +- [Delete](#expressroutecrossconnectionpeerings_delete) +- [Get](#expressroutecrossconnectionpeerings_get) +- [List](#expressroutecrossconnectionpeerings_list) + +## ExpressRouteCrossConnections + +- [CreateOrUpdate](#expressroutecrossconnections_createorupdate) +- [GetByResourceGroup](#expressroutecrossconnections_getbyresourcegroup) +- [List](#expressroutecrossconnections_list) +- [ListArpTable](#expressroutecrossconnections_listarptable) +- [ListByResourceGroup](#expressroutecrossconnections_listbyresourcegroup) +- [ListRoutesTable](#expressroutecrossconnections_listroutestable) +- [ListRoutesTableSummary](#expressroutecrossconnections_listroutestablesummary) +- [UpdateTags](#expressroutecrossconnections_updatetags) + +## ExpressRouteGateways + +- [CreateOrUpdate](#expressroutegateways_createorupdate) +- [Delete](#expressroutegateways_delete) +- [GetByResourceGroup](#expressroutegateways_getbyresourcegroup) +- [ListByResourceGroup](#expressroutegateways_listbyresourcegroup) +- [ListBySubscription](#expressroutegateways_listbysubscription) +- [UpdateTags](#expressroutegateways_updatetags) + +## ExpressRouteLinks + +- [Get](#expressroutelinks_get) +- [List](#expressroutelinks_list) + +## ExpressRoutePortAuthorizations + +- [CreateOrUpdate](#expressrouteportauthorizations_createorupdate) +- [Delete](#expressrouteportauthorizations_delete) +- [Get](#expressrouteportauthorizations_get) +- [List](#expressrouteportauthorizations_list) + +## ExpressRoutePorts + +- [CreateOrUpdate](#expressrouteports_createorupdate) +- [Delete](#expressrouteports_delete) +- [GenerateLoa](#expressrouteports_generateloa) +- [GetByResourceGroup](#expressrouteports_getbyresourcegroup) +- [List](#expressrouteports_list) +- [ListByResourceGroup](#expressrouteports_listbyresourcegroup) +- [UpdateTags](#expressrouteports_updatetags) + +## ExpressRoutePortsLocations + +- [Get](#expressrouteportslocations_get) +- [List](#expressrouteportslocations_list) + +## ExpressRouteProviderPortsLocation + +- [List](#expressrouteproviderportslocation_list) + +## ExpressRouteServiceProviders + +- [List](#expressrouteserviceproviders_list) + +## FirewallPolicies + +- [CreateOrUpdate](#firewallpolicies_createorupdate) +- [Delete](#firewallpolicies_delete) +- [GetByResourceGroup](#firewallpolicies_getbyresourcegroup) +- [List](#firewallpolicies_list) +- [ListByResourceGroup](#firewallpolicies_listbyresourcegroup) +- [UpdateTags](#firewallpolicies_updatetags) + +## FirewallPolicyDeployments + +- [Deploy](#firewallpolicydeployments_deploy) + +## FirewallPolicyDrafts + +- [CreateOrUpdate](#firewallpolicydrafts_createorupdate) +- [Delete](#firewallpolicydrafts_delete) +- [Get](#firewallpolicydrafts_get) + +## FirewallPolicyIdpsSignatures + +- [List](#firewallpolicyidpssignatures_list) + +## FirewallPolicyIdpsSignaturesFilterValues + +- [List](#firewallpolicyidpssignaturesfiltervalues_list) + +## FirewallPolicyIdpsSignaturesOverrides + +- [Get](#firewallpolicyidpssignaturesoverrides_get) +- [List](#firewallpolicyidpssignaturesoverrides_list) +- [Patch](#firewallpolicyidpssignaturesoverrides_patch) +- [Put](#firewallpolicyidpssignaturesoverrides_put) + +## FirewallPolicyRuleCollectionGroupDrafts + +- [CreateOrUpdate](#firewallpolicyrulecollectiongroupdrafts_createorupdate) +- [Delete](#firewallpolicyrulecollectiongroupdrafts_delete) +- [Get](#firewallpolicyrulecollectiongroupdrafts_get) + +## FirewallPolicyRuleCollectionGroups + +- [CreateOrUpdate](#firewallpolicyrulecollectiongroups_createorupdate) +- [Delete](#firewallpolicyrulecollectiongroups_delete) +- [Get](#firewallpolicyrulecollectiongroups_get) +- [List](#firewallpolicyrulecollectiongroups_list) + +## FlowLogs + +- [CreateOrUpdate](#flowlogs_createorupdate) +- [Delete](#flowlogs_delete) +- [Get](#flowlogs_get) +- [List](#flowlogs_list) +- [UpdateTags](#flowlogs_updatetags) + +## HubRouteTables + +- [CreateOrUpdate](#hubroutetables_createorupdate) +- [Delete](#hubroutetables_delete) +- [Get](#hubroutetables_get) +- [List](#hubroutetables_list) + +## HubVirtualNetworkConnections + +- [CreateOrUpdate](#hubvirtualnetworkconnections_createorupdate) +- [Delete](#hubvirtualnetworkconnections_delete) +- [Get](#hubvirtualnetworkconnections_get) +- [List](#hubvirtualnetworkconnections_list) + +## InboundNatRules + +- [CreateOrUpdate](#inboundnatrules_createorupdate) +- [Delete](#inboundnatrules_delete) +- [Get](#inboundnatrules_get) +- [List](#inboundnatrules_list) + +## InboundSecurityRuleOperation + +- [CreateOrUpdate](#inboundsecurityruleoperation_createorupdate) +- [Get](#inboundsecurityruleoperation_get) + +## IpAllocations + +- [CreateOrUpdate](#ipallocations_createorupdate) +- [Delete](#ipallocations_delete) +- [GetByResourceGroup](#ipallocations_getbyresourcegroup) +- [List](#ipallocations_list) +- [ListByResourceGroup](#ipallocations_listbyresourcegroup) +- [UpdateTags](#ipallocations_updatetags) + +## IpGroups + +- [CreateOrUpdate](#ipgroups_createorupdate) +- [Delete](#ipgroups_delete) +- [GetByResourceGroup](#ipgroups_getbyresourcegroup) +- [List](#ipgroups_list) +- [ListByResourceGroup](#ipgroups_listbyresourcegroup) +- [UpdateGroups](#ipgroups_updategroups) + +## LoadBalancerBackendAddressPools + +- [CreateOrUpdate](#loadbalancerbackendaddresspools_createorupdate) +- [Delete](#loadbalancerbackendaddresspools_delete) +- [Get](#loadbalancerbackendaddresspools_get) +- [List](#loadbalancerbackendaddresspools_list) + +## LoadBalancerFrontendIpConfigurations + +- [Get](#loadbalancerfrontendipconfigurations_get) +- [List](#loadbalancerfrontendipconfigurations_list) + +## LoadBalancerLoadBalancingRules + +- [Get](#loadbalancerloadbalancingrules_get) +- [List](#loadbalancerloadbalancingrules_list) + +## LoadBalancerNetworkInterfaces + +- [List](#loadbalancernetworkinterfaces_list) + +## LoadBalancerOutboundRules + +- [Get](#loadbalanceroutboundrules_get) +- [List](#loadbalanceroutboundrules_list) + +## LoadBalancerProbes + +- [Get](#loadbalancerprobes_get) +- [List](#loadbalancerprobes_list) + +## LoadBalancers + +- [CreateOrUpdate](#loadbalancers_createorupdate) +- [Delete](#loadbalancers_delete) +- [GetByResourceGroup](#loadbalancers_getbyresourcegroup) +- [List](#loadbalancers_list) +- [ListByResourceGroup](#loadbalancers_listbyresourcegroup) +- [ListInboundNatRulePortMappings](#loadbalancers_listinboundnatruleportmappings) +- [MigrateToIpBased](#loadbalancers_migratetoipbased) +- [SwapPublicIpAddresses](#loadbalancers_swappublicipaddresses) +- [UpdateTags](#loadbalancers_updatetags) + +## LocalNetworkGateways + +- [CreateOrUpdate](#localnetworkgateways_createorupdate) +- [Delete](#localnetworkgateways_delete) +- [GetByResourceGroup](#localnetworkgateways_getbyresourcegroup) +- [ListByResourceGroup](#localnetworkgateways_listbyresourcegroup) +- [UpdateTags](#localnetworkgateways_updatetags) + +## ManagementGroupNetworkManagerConnections + +- [CreateOrUpdate](#managementgroupnetworkmanagerconnections_createorupdate) +- [Delete](#managementgroupnetworkmanagerconnections_delete) +- [Get](#managementgroupnetworkmanagerconnections_get) +- [List](#managementgroupnetworkmanagerconnections_list) + +## NatGateways + +- [CreateOrUpdate](#natgateways_createorupdate) +- [Delete](#natgateways_delete) +- [GetByResourceGroup](#natgateways_getbyresourcegroup) +- [List](#natgateways_list) +- [ListByResourceGroup](#natgateways_listbyresourcegroup) +- [UpdateTags](#natgateways_updatetags) + +## NatRules + +- [CreateOrUpdate](#natrules_createorupdate) +- [Delete](#natrules_delete) +- [Get](#natrules_get) +- [ListByVpnGateway](#natrules_listbyvpngateway) + +## NetworkGroups + +- [CreateOrUpdate](#networkgroups_createorupdate) +- [Delete](#networkgroups_delete) +- [Get](#networkgroups_get) +- [List](#networkgroups_list) + +## NetworkInterfaceIpConfigurations + +- [Get](#networkinterfaceipconfigurations_get) +- [List](#networkinterfaceipconfigurations_list) + +## NetworkInterfaceLoadBalancers + +- [List](#networkinterfaceloadbalancers_list) + +## NetworkInterfaceTapConfigurations + +- [CreateOrUpdate](#networkinterfacetapconfigurations_createorupdate) +- [Delete](#networkinterfacetapconfigurations_delete) +- [Get](#networkinterfacetapconfigurations_get) +- [List](#networkinterfacetapconfigurations_list) + +## NetworkInterfaces + +- [CreateOrUpdate](#networkinterfaces_createorupdate) +- [Delete](#networkinterfaces_delete) +- [GetByResourceGroup](#networkinterfaces_getbyresourcegroup) +- [GetCloudServiceNetworkInterface](#networkinterfaces_getcloudservicenetworkinterface) +- [GetEffectiveRouteTable](#networkinterfaces_geteffectiveroutetable) +- [GetVirtualMachineScaleSetIpConfiguration](#networkinterfaces_getvirtualmachinescalesetipconfiguration) +- [GetVirtualMachineScaleSetNetworkInterface](#networkinterfaces_getvirtualmachinescalesetnetworkinterface) +- [List](#networkinterfaces_list) +- [ListByResourceGroup](#networkinterfaces_listbyresourcegroup) +- [ListCloudServiceNetworkInterfaces](#networkinterfaces_listcloudservicenetworkinterfaces) +- [ListCloudServiceRoleInstanceNetworkInterfaces](#networkinterfaces_listcloudserviceroleinstancenetworkinterfaces) +- [ListEffectiveNetworkSecurityGroups](#networkinterfaces_listeffectivenetworksecuritygroups) +- [ListVirtualMachineScaleSetIpConfigurations](#networkinterfaces_listvirtualmachinescalesetipconfigurations) +- [ListVirtualMachineScaleSetNetworkInterfaces](#networkinterfaces_listvirtualmachinescalesetnetworkinterfaces) +- [ListVirtualMachineScaleSetVMNetworkInterfaces](#networkinterfaces_listvirtualmachinescalesetvmnetworkinterfaces) +- [UpdateTags](#networkinterfaces_updatetags) + +## NetworkManagerCommits + +- [Post](#networkmanagercommits_post) + +## NetworkManagerDeploymentStatusOperation + +- [List](#networkmanagerdeploymentstatusoperation_list) + +## NetworkManagerRoutingConfigurations + +- [CreateOrUpdate](#networkmanagerroutingconfigurations_createorupdate) +- [Delete](#networkmanagerroutingconfigurations_delete) +- [Get](#networkmanagerroutingconfigurations_get) +- [List](#networkmanagerroutingconfigurations_list) + +## NetworkManagers + +- [CreateOrUpdate](#networkmanagers_createorupdate) +- [Delete](#networkmanagers_delete) +- [GetByResourceGroup](#networkmanagers_getbyresourcegroup) +- [List](#networkmanagers_list) +- [ListByResourceGroup](#networkmanagers_listbyresourcegroup) +- [Patch](#networkmanagers_patch) + +## NetworkProfiles + +- [CreateOrUpdate](#networkprofiles_createorupdate) +- [Delete](#networkprofiles_delete) +- [GetByResourceGroup](#networkprofiles_getbyresourcegroup) +- [List](#networkprofiles_list) +- [ListByResourceGroup](#networkprofiles_listbyresourcegroup) +- [UpdateTags](#networkprofiles_updatetags) + +## NetworkSecurityGroups + +- [CreateOrUpdate](#networksecuritygroups_createorupdate) +- [Delete](#networksecuritygroups_delete) +- [GetByResourceGroup](#networksecuritygroups_getbyresourcegroup) +- [List](#networksecuritygroups_list) +- [ListByResourceGroup](#networksecuritygroups_listbyresourcegroup) +- [UpdateTags](#networksecuritygroups_updatetags) + +## NetworkVirtualApplianceConnections + +- [CreateOrUpdate](#networkvirtualapplianceconnections_createorupdate) +- [Delete](#networkvirtualapplianceconnections_delete) +- [Get](#networkvirtualapplianceconnections_get) +- [List](#networkvirtualapplianceconnections_list) + +## NetworkVirtualAppliances + +- [CreateOrUpdate](#networkvirtualappliances_createorupdate) +- [Delete](#networkvirtualappliances_delete) +- [GetByResourceGroup](#networkvirtualappliances_getbyresourcegroup) +- [List](#networkvirtualappliances_list) +- [ListByResourceGroup](#networkvirtualappliances_listbyresourcegroup) +- [Restart](#networkvirtualappliances_restart) +- [UpdateTags](#networkvirtualappliances_updatetags) + +## NetworkWatchers + +- [CheckConnectivity](#networkwatchers_checkconnectivity) +- [CreateOrUpdate](#networkwatchers_createorupdate) +- [Delete](#networkwatchers_delete) +- [GetAzureReachabilityReport](#networkwatchers_getazurereachabilityreport) +- [GetByResourceGroup](#networkwatchers_getbyresourcegroup) +- [GetFlowLogStatus](#networkwatchers_getflowlogstatus) +- [GetNetworkConfigurationDiagnostic](#networkwatchers_getnetworkconfigurationdiagnostic) +- [GetNextHop](#networkwatchers_getnexthop) +- [GetTopology](#networkwatchers_gettopology) +- [GetTroubleshooting](#networkwatchers_gettroubleshooting) +- [GetTroubleshootingResult](#networkwatchers_gettroubleshootingresult) +- [GetVMSecurityRules](#networkwatchers_getvmsecurityrules) +- [List](#networkwatchers_list) +- [ListAvailableProviders](#networkwatchers_listavailableproviders) +- [ListByResourceGroup](#networkwatchers_listbyresourcegroup) +- [SetFlowLogConfiguration](#networkwatchers_setflowlogconfiguration) +- [UpdateTags](#networkwatchers_updatetags) +- [VerifyIpFlow](#networkwatchers_verifyipflow) + +## Operations + +- [List](#operations_list) + +## P2SVpnGateways + +- [CreateOrUpdate](#p2svpngateways_createorupdate) +- [Delete](#p2svpngateways_delete) +- [DisconnectP2SVpnConnections](#p2svpngateways_disconnectp2svpnconnections) +- [GenerateVpnProfile](#p2svpngateways_generatevpnprofile) +- [GetByResourceGroup](#p2svpngateways_getbyresourcegroup) +- [GetP2SVpnConnectionHealth](#p2svpngateways_getp2svpnconnectionhealth) +- [GetP2SVpnConnectionHealthDetailed](#p2svpngateways_getp2svpnconnectionhealthdetailed) +- [List](#p2svpngateways_list) +- [ListByResourceGroup](#p2svpngateways_listbyresourcegroup) +- [Reset](#p2svpngateways_reset) +- [UpdateTags](#p2svpngateways_updatetags) + +## PacketCaptures + +- [Create](#packetcaptures_create) +- [Delete](#packetcaptures_delete) +- [Get](#packetcaptures_get) +- [GetStatus](#packetcaptures_getstatus) +- [List](#packetcaptures_list) +- [Stop](#packetcaptures_stop) + +## PeerExpressRouteCircuitConnections + +- [Get](#peerexpressroutecircuitconnections_get) +- [List](#peerexpressroutecircuitconnections_list) + +## PrivateDnsZoneGroups + +- [CreateOrUpdate](#privatednszonegroups_createorupdate) +- [Delete](#privatednszonegroups_delete) +- [Get](#privatednszonegroups_get) +- [List](#privatednszonegroups_list) + +## PrivateEndpoints + +- [CreateOrUpdate](#privateendpoints_createorupdate) +- [Delete](#privateendpoints_delete) +- [GetByResourceGroup](#privateendpoints_getbyresourcegroup) +- [List](#privateendpoints_list) +- [ListByResourceGroup](#privateendpoints_listbyresourcegroup) + +## PrivateLinkServices + +- [CheckPrivateLinkServiceVisibility](#privatelinkservices_checkprivatelinkservicevisibility) +- [CheckPrivateLinkServiceVisibilityByResourceGroup](#privatelinkservices_checkprivatelinkservicevisibilitybyresourcegroup) +- [CreateOrUpdate](#privatelinkservices_createorupdate) +- [Delete](#privatelinkservices_delete) +- [DeletePrivateEndpointConnection](#privatelinkservices_deleteprivateendpointconnection) +- [GetByResourceGroup](#privatelinkservices_getbyresourcegroup) +- [GetPrivateEndpointConnection](#privatelinkservices_getprivateendpointconnection) +- [List](#privatelinkservices_list) +- [ListAutoApprovedPrivateLinkServices](#privatelinkservices_listautoapprovedprivatelinkservices) +- [ListAutoApprovedPrivateLinkServicesByResourceGroup](#privatelinkservices_listautoapprovedprivatelinkservicesbyresourcegroup) +- [ListByResourceGroup](#privatelinkservices_listbyresourcegroup) +- [ListPrivateEndpointConnections](#privatelinkservices_listprivateendpointconnections) +- [UpdatePrivateEndpointConnection](#privatelinkservices_updateprivateendpointconnection) + +## PublicIpAddresses + +- [CreateOrUpdate](#publicipaddresses_createorupdate) +- [DdosProtectionStatus](#publicipaddresses_ddosprotectionstatus) +- [Delete](#publicipaddresses_delete) +- [GetByResourceGroup](#publicipaddresses_getbyresourcegroup) +- [GetCloudServicePublicIpAddress](#publicipaddresses_getcloudservicepublicipaddress) +- [GetVirtualMachineScaleSetPublicIpAddress](#publicipaddresses_getvirtualmachinescalesetpublicipaddress) +- [List](#publicipaddresses_list) +- [ListByResourceGroup](#publicipaddresses_listbyresourcegroup) +- [ListCloudServicePublicIpAddresses](#publicipaddresses_listcloudservicepublicipaddresses) +- [ListCloudServiceRoleInstancePublicIpAddresses](#publicipaddresses_listcloudserviceroleinstancepublicipaddresses) +- [ListVirtualMachineScaleSetPublicIpAddresses](#publicipaddresses_listvirtualmachinescalesetpublicipaddresses) +- [ListVirtualMachineScaleSetVMPublicIpAddresses](#publicipaddresses_listvirtualmachinescalesetvmpublicipaddresses) +- [UpdateTags](#publicipaddresses_updatetags) + +## PublicIpPrefixes + +- [CreateOrUpdate](#publicipprefixes_createorupdate) +- [Delete](#publicipprefixes_delete) +- [GetByResourceGroup](#publicipprefixes_getbyresourcegroup) +- [List](#publicipprefixes_list) +- [ListByResourceGroup](#publicipprefixes_listbyresourcegroup) +- [UpdateTags](#publicipprefixes_updatetags) + +## ResourceNavigationLinks + +- [List](#resourcenavigationlinks_list) + +## ResourceProvider + +- [CheckDnsNameAvailability](#resourceprovider_checkdnsnameavailability) +- [DeleteBastionShareableLink](#resourceprovider_deletebastionshareablelink) +- [DeleteBastionShareableLinkByToken](#resourceprovider_deletebastionshareablelinkbytoken) +- [DisconnectActiveSessions](#resourceprovider_disconnectactivesessions) +- [ExpressRouteProviderPort](#resourceprovider_expressrouteproviderport) +- [Generatevirtualwanvpnserverconfigurationvpnprofile](#resourceprovider_generatevirtualwanvpnserverconfigurationvpnprofile) +- [GetActiveSessions](#resourceprovider_getactivesessions) +- [GetBastionShareableLink](#resourceprovider_getbastionshareablelink) +- [ListActiveConnectivityConfigurations](#resourceprovider_listactiveconnectivityconfigurations) +- [ListActiveSecurityAdminRules](#resourceprovider_listactivesecurityadminrules) +- [ListNetworkManagerEffectiveConnectivityConfigurations](#resourceprovider_listnetworkmanagereffectiveconnectivityconfigurations) +- [ListNetworkManagerEffectiveSecurityAdminRules](#resourceprovider_listnetworkmanagereffectivesecurityadminrules) +- [PutBastionShareableLink](#resourceprovider_putbastionshareablelink) +- [SupportedSecurityProviders](#resourceprovider_supportedsecurityproviders) + +## RouteFilterRules + +- [CreateOrUpdate](#routefilterrules_createorupdate) +- [Delete](#routefilterrules_delete) +- [Get](#routefilterrules_get) +- [ListByRouteFilter](#routefilterrules_listbyroutefilter) + +## RouteFilters + +- [CreateOrUpdate](#routefilters_createorupdate) +- [Delete](#routefilters_delete) +- [GetByResourceGroup](#routefilters_getbyresourcegroup) +- [List](#routefilters_list) +- [ListByResourceGroup](#routefilters_listbyresourcegroup) +- [UpdateTags](#routefilters_updatetags) + +## RouteMaps + +- [CreateOrUpdate](#routemaps_createorupdate) +- [Delete](#routemaps_delete) +- [Get](#routemaps_get) +- [List](#routemaps_list) + +## RouteTables + +- [CreateOrUpdate](#routetables_createorupdate) +- [Delete](#routetables_delete) +- [GetByResourceGroup](#routetables_getbyresourcegroup) +- [List](#routetables_list) +- [ListByResourceGroup](#routetables_listbyresourcegroup) +- [UpdateTags](#routetables_updatetags) + +## Routes + +- [CreateOrUpdate](#routes_createorupdate) +- [Delete](#routes_delete) +- [Get](#routes_get) +- [List](#routes_list) + +## RoutingIntent + +- [CreateOrUpdate](#routingintent_createorupdate) +- [Delete](#routingintent_delete) +- [Get](#routingintent_get) +- [List](#routingintent_list) + +## RoutingRuleCollections + +- [CreateOrUpdate](#routingrulecollections_createorupdate) +- [Delete](#routingrulecollections_delete) +- [Get](#routingrulecollections_get) +- [List](#routingrulecollections_list) + +## RoutingRules + +- [CreateOrUpdate](#routingrules_createorupdate) +- [Delete](#routingrules_delete) +- [Get](#routingrules_get) +- [List](#routingrules_list) + +## ScopeConnections + +- [CreateOrUpdate](#scopeconnections_createorupdate) +- [Delete](#scopeconnections_delete) +- [Get](#scopeconnections_get) +- [List](#scopeconnections_list) + +## SecurityAdminConfigurations + +- [CreateOrUpdate](#securityadminconfigurations_createorupdate) +- [Delete](#securityadminconfigurations_delete) +- [Get](#securityadminconfigurations_get) +- [List](#securityadminconfigurations_list) + +## SecurityPartnerProviders + +- [CreateOrUpdate](#securitypartnerproviders_createorupdate) +- [Delete](#securitypartnerproviders_delete) +- [GetByResourceGroup](#securitypartnerproviders_getbyresourcegroup) +- [List](#securitypartnerproviders_list) +- [ListByResourceGroup](#securitypartnerproviders_listbyresourcegroup) +- [UpdateTags](#securitypartnerproviders_updatetags) + +## SecurityRules + +- [CreateOrUpdate](#securityrules_createorupdate) +- [Delete](#securityrules_delete) +- [Get](#securityrules_get) +- [List](#securityrules_list) + +## SecurityUserConfigurations + +- [CreateOrUpdate](#securityuserconfigurations_createorupdate) +- [Delete](#securityuserconfigurations_delete) +- [Get](#securityuserconfigurations_get) +- [List](#securityuserconfigurations_list) + +## SecurityUserRuleCollections + +- [CreateOrUpdate](#securityuserrulecollections_createorupdate) +- [Delete](#securityuserrulecollections_delete) +- [Get](#securityuserrulecollections_get) +- [List](#securityuserrulecollections_list) + +## SecurityUserRules + +- [CreateOrUpdate](#securityuserrules_createorupdate) +- [Delete](#securityuserrules_delete) +- [Get](#securityuserrules_get) +- [List](#securityuserrules_list) + +## ServiceAssociationLinks + +- [List](#serviceassociationlinks_list) + +## ServiceEndpointPolicies + +- [CreateOrUpdate](#serviceendpointpolicies_createorupdate) +- [Delete](#serviceendpointpolicies_delete) +- [GetByResourceGroup](#serviceendpointpolicies_getbyresourcegroup) +- [List](#serviceendpointpolicies_list) +- [ListByResourceGroup](#serviceendpointpolicies_listbyresourcegroup) +- [UpdateTags](#serviceendpointpolicies_updatetags) + +## ServiceEndpointPolicyDefinitions + +- [CreateOrUpdate](#serviceendpointpolicydefinitions_createorupdate) +- [Delete](#serviceendpointpolicydefinitions_delete) +- [Get](#serviceendpointpolicydefinitions_get) +- [ListByResourceGroup](#serviceendpointpolicydefinitions_listbyresourcegroup) + +## ServiceTagInformation + +- [List](#servicetaginformation_list) + +## ServiceTags + +- [List](#servicetags_list) + +## StaticMembers + +- [CreateOrUpdate](#staticmembers_createorupdate) +- [Delete](#staticmembers_delete) +- [Get](#staticmembers_get) +- [List](#staticmembers_list) + +## Subnets + +- [CreateOrUpdate](#subnets_createorupdate) +- [Delete](#subnets_delete) +- [Get](#subnets_get) +- [List](#subnets_list) +- [PrepareNetworkPolicies](#subnets_preparenetworkpolicies) +- [UnprepareNetworkPolicies](#subnets_unpreparenetworkpolicies) + +## SubscriptionNetworkManagerConnections + +- [CreateOrUpdate](#subscriptionnetworkmanagerconnections_createorupdate) +- [Delete](#subscriptionnetworkmanagerconnections_delete) +- [Get](#subscriptionnetworkmanagerconnections_get) +- [List](#subscriptionnetworkmanagerconnections_list) + +## Usages + +- [List](#usages_list) + +## VipSwap + +- [Create](#vipswap_create) +- [Get](#vipswap_get) +- [List](#vipswap_list) + +## VirtualApplianceSites + +- [CreateOrUpdate](#virtualappliancesites_createorupdate) +- [Delete](#virtualappliancesites_delete) +- [Get](#virtualappliancesites_get) +- [List](#virtualappliancesites_list) + +## VirtualApplianceSkus + +- [Get](#virtualapplianceskus_get) +- [List](#virtualapplianceskus_list) + +## VirtualHubBgpConnections + +- [CreateOrUpdate](#virtualhubbgpconnections_createorupdate) +- [Delete](#virtualhubbgpconnections_delete) +- [Get](#virtualhubbgpconnections_get) +- [List](#virtualhubbgpconnections_list) +- [ListAdvertisedRoutes](#virtualhubbgpconnections_listadvertisedroutes) +- [ListLearnedRoutes](#virtualhubbgpconnections_listlearnedroutes) + +## VirtualHubIpConfiguration + +- [CreateOrUpdate](#virtualhubipconfiguration_createorupdate) +- [Delete](#virtualhubipconfiguration_delete) +- [Get](#virtualhubipconfiguration_get) +- [List](#virtualhubipconfiguration_list) + +## VirtualHubRouteTableV2S + +- [CreateOrUpdate](#virtualhubroutetablev2s_createorupdate) +- [Delete](#virtualhubroutetablev2s_delete) +- [Get](#virtualhubroutetablev2s_get) +- [List](#virtualhubroutetablev2s_list) + +## VirtualHubs + +- [CreateOrUpdate](#virtualhubs_createorupdate) +- [Delete](#virtualhubs_delete) +- [GetByResourceGroup](#virtualhubs_getbyresourcegroup) +- [GetEffectiveVirtualHubRoutes](#virtualhubs_geteffectivevirtualhubroutes) +- [GetInboundRoutes](#virtualhubs_getinboundroutes) +- [GetOutboundRoutes](#virtualhubs_getoutboundroutes) +- [List](#virtualhubs_list) +- [ListByResourceGroup](#virtualhubs_listbyresourcegroup) +- [UpdateTags](#virtualhubs_updatetags) + +## VirtualNetworkGatewayConnections + +- [CreateOrUpdate](#virtualnetworkgatewayconnections_createorupdate) +- [Delete](#virtualnetworkgatewayconnections_delete) +- [GetByResourceGroup](#virtualnetworkgatewayconnections_getbyresourcegroup) +- [GetIkeSas](#virtualnetworkgatewayconnections_getikesas) +- [GetSharedKey](#virtualnetworkgatewayconnections_getsharedkey) +- [ListByResourceGroup](#virtualnetworkgatewayconnections_listbyresourcegroup) +- [ResetConnection](#virtualnetworkgatewayconnections_resetconnection) +- [ResetSharedKey](#virtualnetworkgatewayconnections_resetsharedkey) +- [SetSharedKey](#virtualnetworkgatewayconnections_setsharedkey) +- [StartPacketCapture](#virtualnetworkgatewayconnections_startpacketcapture) +- [StopPacketCapture](#virtualnetworkgatewayconnections_stoppacketcapture) +- [UpdateTags](#virtualnetworkgatewayconnections_updatetags) + +## VirtualNetworkGatewayNatRules + +- [CreateOrUpdate](#virtualnetworkgatewaynatrules_createorupdate) +- [Delete](#virtualnetworkgatewaynatrules_delete) +- [Get](#virtualnetworkgatewaynatrules_get) +- [ListByVirtualNetworkGateway](#virtualnetworkgatewaynatrules_listbyvirtualnetworkgateway) + +## VirtualNetworkGateways + +- [CreateOrUpdate](#virtualnetworkgateways_createorupdate) +- [Delete](#virtualnetworkgateways_delete) +- [DisconnectVirtualNetworkGatewayVpnConnections](#virtualnetworkgateways_disconnectvirtualnetworkgatewayvpnconnections) +- [GenerateVpnProfile](#virtualnetworkgateways_generatevpnprofile) +- [Generatevpnclientpackage](#virtualnetworkgateways_generatevpnclientpackage) +- [GetAdvertisedRoutes](#virtualnetworkgateways_getadvertisedroutes) +- [GetBgpPeerStatus](#virtualnetworkgateways_getbgppeerstatus) +- [GetByResourceGroup](#virtualnetworkgateways_getbyresourcegroup) +- [GetLearnedRoutes](#virtualnetworkgateways_getlearnedroutes) +- [GetVpnProfilePackageUrl](#virtualnetworkgateways_getvpnprofilepackageurl) +- [GetVpnclientConnectionHealth](#virtualnetworkgateways_getvpnclientconnectionhealth) +- [GetVpnclientIpsecParameters](#virtualnetworkgateways_getvpnclientipsecparameters) +- [ListByResourceGroup](#virtualnetworkgateways_listbyresourcegroup) +- [ListConnections](#virtualnetworkgateways_listconnections) +- [Reset](#virtualnetworkgateways_reset) +- [ResetVpnClientSharedKey](#virtualnetworkgateways_resetvpnclientsharedkey) +- [SetVpnclientIpsecParameters](#virtualnetworkgateways_setvpnclientipsecparameters) +- [StartPacketCapture](#virtualnetworkgateways_startpacketcapture) +- [StopPacketCapture](#virtualnetworkgateways_stoppacketcapture) +- [SupportedVpnDevices](#virtualnetworkgateways_supportedvpndevices) +- [UpdateTags](#virtualnetworkgateways_updatetags) +- [VpnDeviceConfigurationScript](#virtualnetworkgateways_vpndeviceconfigurationscript) + +## VirtualNetworkPeerings + +- [CreateOrUpdate](#virtualnetworkpeerings_createorupdate) +- [Delete](#virtualnetworkpeerings_delete) +- [Get](#virtualnetworkpeerings_get) +- [List](#virtualnetworkpeerings_list) + +## VirtualNetworkTaps + +- [CreateOrUpdate](#virtualnetworktaps_createorupdate) +- [Delete](#virtualnetworktaps_delete) +- [GetByResourceGroup](#virtualnetworktaps_getbyresourcegroup) +- [List](#virtualnetworktaps_list) +- [ListByResourceGroup](#virtualnetworktaps_listbyresourcegroup) +- [UpdateTags](#virtualnetworktaps_updatetags) + +## VirtualNetworks + +- [CheckIpAddressAvailability](#virtualnetworks_checkipaddressavailability) +- [CreateOrUpdate](#virtualnetworks_createorupdate) +- [Delete](#virtualnetworks_delete) +- [GetByResourceGroup](#virtualnetworks_getbyresourcegroup) +- [List](#virtualnetworks_list) +- [ListByResourceGroup](#virtualnetworks_listbyresourcegroup) +- [ListDdosProtectionStatus](#virtualnetworks_listddosprotectionstatus) +- [ListUsage](#virtualnetworks_listusage) +- [UpdateTags](#virtualnetworks_updatetags) + +## VirtualRouterPeerings + +- [CreateOrUpdate](#virtualrouterpeerings_createorupdate) +- [Delete](#virtualrouterpeerings_delete) +- [Get](#virtualrouterpeerings_get) +- [List](#virtualrouterpeerings_list) + +## VirtualRouters + +- [CreateOrUpdate](#virtualrouters_createorupdate) +- [Delete](#virtualrouters_delete) +- [GetByResourceGroup](#virtualrouters_getbyresourcegroup) +- [List](#virtualrouters_list) +- [ListByResourceGroup](#virtualrouters_listbyresourcegroup) + +## VirtualWans + +- [CreateOrUpdate](#virtualwans_createorupdate) +- [Delete](#virtualwans_delete) +- [GetByResourceGroup](#virtualwans_getbyresourcegroup) +- [List](#virtualwans_list) +- [ListByResourceGroup](#virtualwans_listbyresourcegroup) +- [UpdateTags](#virtualwans_updatetags) + +## VpnConnections + +- [CreateOrUpdate](#vpnconnections_createorupdate) +- [Delete](#vpnconnections_delete) +- [Get](#vpnconnections_get) +- [ListByVpnGateway](#vpnconnections_listbyvpngateway) +- [StartPacketCapture](#vpnconnections_startpacketcapture) +- [StopPacketCapture](#vpnconnections_stoppacketcapture) + +## VpnGateways + +- [CreateOrUpdate](#vpngateways_createorupdate) +- [Delete](#vpngateways_delete) +- [GetByResourceGroup](#vpngateways_getbyresourcegroup) +- [List](#vpngateways_list) +- [ListByResourceGroup](#vpngateways_listbyresourcegroup) +- [Reset](#vpngateways_reset) +- [StartPacketCapture](#vpngateways_startpacketcapture) +- [StopPacketCapture](#vpngateways_stoppacketcapture) +- [UpdateTags](#vpngateways_updatetags) + +## VpnLinkConnections + +- [GetAllSharedKeys](#vpnlinkconnections_getallsharedkeys) +- [GetDefaultSharedKey](#vpnlinkconnections_getdefaultsharedkey) +- [GetIkeSas](#vpnlinkconnections_getikesas) +- [ListByVpnConnection](#vpnlinkconnections_listbyvpnconnection) +- [ListDefaultSharedKey](#vpnlinkconnections_listdefaultsharedkey) +- [ResetConnection](#vpnlinkconnections_resetconnection) +- [SetOrInitDefaultSharedKey](#vpnlinkconnections_setorinitdefaultsharedkey) + +## VpnServerConfigurations + +- [CreateOrUpdate](#vpnserverconfigurations_createorupdate) +- [Delete](#vpnserverconfigurations_delete) +- [GetByResourceGroup](#vpnserverconfigurations_getbyresourcegroup) +- [List](#vpnserverconfigurations_list) +- [ListByResourceGroup](#vpnserverconfigurations_listbyresourcegroup) +- [UpdateTags](#vpnserverconfigurations_updatetags) + +## VpnServerConfigurationsAssociatedWithVirtualWan + +- [List](#vpnserverconfigurationsassociatedwithvirtualwan_list) + +## VpnSiteLinkConnections + +- [Get](#vpnsitelinkconnections_get) + +## VpnSiteLinks + +- [Get](#vpnsitelinks_get) +- [ListByVpnSite](#vpnsitelinks_listbyvpnsite) + +## VpnSites + +- [CreateOrUpdate](#vpnsites_createorupdate) +- [Delete](#vpnsites_delete) +- [GetByResourceGroup](#vpnsites_getbyresourcegroup) +- [List](#vpnsites_list) +- [ListByResourceGroup](#vpnsites_listbyresourcegroup) +- [UpdateTags](#vpnsites_updatetags) + +## VpnSitesConfiguration + +- [Download](#vpnsitesconfiguration_download) + +## WebApplicationFirewallPolicies + +- [CreateOrUpdate](#webapplicationfirewallpolicies_createorupdate) +- [Delete](#webapplicationfirewallpolicies_delete) +- [GetByResourceGroup](#webapplicationfirewallpolicies_getbyresourcegroup) +- [List](#webapplicationfirewallpolicies_list) +- [ListByResourceGroup](#webapplicationfirewallpolicies_listbyresourcegroup) + +## WebCategories + +- [Get](#webcategories_get) +- [List](#webcategories_list) +### AdminRuleCollections_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.NetworkManagerSecurityGroupItem; +import java.util.Arrays; + +/** + * Samples for AdminRuleCollections CreateOrUpdate. + */ +public final class AdminRuleCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionPut.json + */ + /** + * Sample code: Create or Update an admin rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateAnAdminRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .define("testRuleCollection") + .withExistingSecurityAdminConfiguration("rg1", "testNetworkManager", "myTestSecurityConfig") + .withDescription("A sample policy") + .withAppliesToGroups(Arrays.asList(new NetworkManagerSecurityGroupItem().withNetworkGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"))) + .create(); + } +} +``` + +### AdminRuleCollections_Delete + +```java +/** + * Samples for AdminRuleCollections Delete. + */ +public final class AdminRuleCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionDelete.json + */ + /** + * Sample code: Deletes an admin rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesAnAdminRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", false, + com.azure.core.util.Context.NONE); + } +} +``` + +### AdminRuleCollections_Get + +```java +/** + * Samples for AdminRuleCollections Get. + */ +public final class AdminRuleCollectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionGet.json + */ + /** + * Sample code: Gets security admin rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsSecurityAdminRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + com.azure.core.util.Context.NONE); + } +} +``` + +### AdminRuleCollections_List + +```java +/** + * Samples for AdminRuleCollections List. + */ +public final class AdminRuleCollectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionList.json + */ + /** + * Sample code: List security admin rule collections. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listSecurityAdminRuleCollections(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### AdminRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.AddressPrefixType; +import com.azure.resourcemanager.network.generated.models.AdminRule; +import com.azure.resourcemanager.network.generated.models.DefaultAdminRule; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.util.Arrays; + +/** + * Samples for AdminRules CreateOrUpdate. + */ +public final class AdminRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRulePut. + * json + */ + /** + * Sample code: Create an admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAnAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .createOrUpdateWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleAdminRule", + new AdminRule().withDescription("This is Sample Admin Rule") + .withProtocol(SecurityConfigurationRuleProtocol.TCP) + .withSources(Arrays.asList(new AddressPrefixItem().withAddressPrefix("Internet") + .withAddressPrefixType(AddressPrefixType.SERVICE_TAG))) + .withDestinations(Arrays.asList(new AddressPrefixItem().withAddressPrefix("*") + .withAddressPrefixType(AddressPrefixType.IPPREFIX))) + .withSourcePortRanges(Arrays.asList("0-65535")) + .withDestinationPortRanges(Arrays.asList("22")) + .withAccess(SecurityConfigurationRuleAccess.DENY) + .withPriority(1) + .withDirection(SecurityConfigurationRuleDirection.INBOUND), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerDefaultAdminRulePut.json + */ + /** + * Sample code: Create a default admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createADefaultAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .createOrUpdateWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleDefaultAdminRule", new DefaultAdminRule().withFlag("AllowVnetInbound"), + com.azure.core.util.Context.NONE); + } +} +``` + +### AdminRules_Delete + +```java +/** + * Samples for AdminRules Delete. + */ +public final class AdminRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRuleDelete + * .json + */ + /** + * Sample code: Deletes an admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletesAnAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", false, + com.azure.core.util.Context.NONE); + } +} +``` + +### AdminRules_Get + +```java +/** + * Samples for AdminRules Get. + */ +public final class AdminRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerDefaultAdminRuleGet.json + */ + /** + * Sample code: Gets security default admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsSecurityDefaultAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleDefaultAdminRule", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRuleGet. + * json + */ + /** + * Sample code: Gets security admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsSecurityAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleAdminRule", com.azure.core.util.Context.NONE); + } +} +``` + +### AdminRules_List + +```java +/** + * Samples for AdminRules List. + */ +public final class AdminRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRuleList. + * json + */ + /** + * Sample code: List security admin rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityAdminRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateEndpointConnections_Delete + +```java +/** + * Samples for ApplicationGatewayPrivateEndpointConnections Delete. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Delete Application Gateway Private Endpoint Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteApplicationGatewayPrivateEndpointConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections() + .delete("rg1", "appgw", "connection1", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateEndpointConnections_Get + +```java +/** + * Samples for ApplicationGatewayPrivateEndpointConnections Get. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionGet.json + */ + /** + * Sample code: Get Application Gateway Private Endpoint Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void getApplicationGatewayPrivateEndpointConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections() + .getWithResponse("rg1", "appgw", "connection1", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateEndpointConnections_List + +```java +/** + * Samples for ApplicationGatewayPrivateEndpointConnections List. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionList.json + */ + /** + * Sample code: Lists all private endpoint connections on application gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void listsAllPrivateEndpointConnectionsOnApplicationGateway( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections().list("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateEndpointConnections_Update + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for ApplicationGatewayPrivateEndpointConnections Update. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Update Application Gateway Private Endpoint Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateApplicationGatewayPrivateEndpointConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections() + .update("rg1", "appgw", "connection1", + new ApplicationGatewayPrivateEndpointConnectionInner().withName("connection1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus("Approved") + .withDescription("approved it for some reason.")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGatewayPrivateLinkResources_List + +```java +/** + * Samples for ApplicationGatewayPrivateLinkResources List. + */ +public final class ApplicationGatewayPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateLinkResourceList.json + */ + /** + * Sample code: Lists all private link resources on application gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void listsAllPrivateLinkResourcesOnApplicationGateway( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateLinkResources().list("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGatewayWafDynamicManifests_Get + +```java +/** + * Samples for ApplicationGatewayWafDynamicManifests Get. + */ +public final class ApplicationGatewayWafDynamicManifestsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GetApplicationGatewayWafDynamicManifests.json + */ + /** + * Sample code: Gets WAF manifests. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsWAFManifests(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayWafDynamicManifests().get("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGatewayWafDynamicManifestsDefault_Get + +```java +/** + * Samples for ApplicationGatewayWafDynamicManifestsDefault Get. + */ +public final class ApplicationGatewayWafDynamicManifestsDefaultGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GetApplicationGatewayWafDynamicManifestsDefault.json + */ + /** + * Sample code: Gets WAF default manifest. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsWAFDefaultManifest(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayWafDynamicManifestsDefaults() + .getWithResponse("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_BackendHealth + +```java +/** + * Samples for ApplicationGateways BackendHealth. + */ +public final class ApplicationGatewaysBackendHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayBackendHealthGet.json + */ + /** + * Sample code: Get Backend Health. + * + * @param manager Entry point to NetworkManager. + */ + public static void getBackendHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().backendHealth("appgw", "appgw", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_BackendHealthOnDemand + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; + +/** + * Samples for ApplicationGateways BackendHealthOnDemand. + */ +public final class ApplicationGatewaysBackendHealthOnDemandSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayBackendHealthTest.json + */ + /** + * Sample code: Test Backend Health. + * + * @param manager Entry point to NetworkManager. + */ + public static void testBackendHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways() + .backendHealthOnDemand("rg1", "appgw", new ApplicationGatewayOnDemandProbe() + .withProtocol(ApplicationGatewayProtocol.HTTP) + .withPath("/") + .withTimeout(30) + .withPickHostnameFromBackendHttpSettings(true) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool")) + .withBackendHttpSettings(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings")), + null, com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddress; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayClientAuthConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCookieBasedAffinity; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHeaderConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRule; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRule; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleActionSet; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleCondition; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleSet; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySku; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySkuName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyType; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProfile; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTier; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedClientCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedRootCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlConfiguration; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApplicationGateways CreateOrUpdate. + */ +public final class ApplicationGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayCreate.json + */ + /** + * Sample code: Create Application Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void createApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways() + .define("appgw") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withSku(new ApplicationGatewaySku().withName(ApplicationGatewaySkuName.STANDARD_V2) + .withTier(ApplicationGatewayTier.STANDARD_V2) + .withCapacity(3)) + .withGatewayIpConfigurations(Arrays.asList(new ApplicationGatewayIpConfiguration().withName("appgwipc") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/appgwsubnet")))) + .withTrustedRootCertificates( + Arrays.asList(new ApplicationGatewayTrustedRootCertificate().withName("rootcert").withData("****"), + new ApplicationGatewayTrustedRootCertificate().withName("rootcert1") + .withKeyVaultSecretId("fakeTokenPlaceholder"))) + .withTrustedClientCertificates( + Arrays.asList(new ApplicationGatewayTrustedClientCertificate().withName("clientcert").withData("****"))) + .withSslCertificates(Arrays.asList( + new ApplicationGatewaySslCertificate().withName("sslcert") + .withData("****") + .withPassword("fakeTokenPlaceholder"), + new ApplicationGatewaySslCertificate().withName("sslcert2") + .withKeyVaultSecretId("fakeTokenPlaceholder"))) + .withFrontendIpConfigurations(Arrays.asList(new ApplicationGatewayFrontendIpConfiguration() + .withName("appgwfip") + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip")))) + .withFrontendPorts(Arrays.asList(new ApplicationGatewayFrontendPort().withName("appgwfp").withPort(443), + new ApplicationGatewayFrontendPort().withName("appgwfp80").withPort(80))) + .withBackendAddressPools(Arrays.asList(new ApplicationGatewayBackendAddressPool().withName("appgwpool") + .withBackendAddresses(Arrays.asList(new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.1"), + new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.2"))), + new ApplicationGatewayBackendAddressPool().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1") + .withName("appgwpool1") + .withBackendAddresses( + Arrays.asList(new ApplicationGatewayBackendAddress().withIpAddress("10.0.0.1"), + new ApplicationGatewayBackendAddress().withIpAddress("10.0.0.2"))))) + .withBackendHttpSettingsCollection( + Arrays.asList(new ApplicationGatewayBackendHttpSettings().withName("appgwbhs") + .withPort(80) + .withProtocol(ApplicationGatewayProtocol.HTTP) + .withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity.DISABLED) + .withRequestTimeout(30))) + .withHttpListeners(Arrays.asList(new ApplicationGatewayHttpListener().withName("appgwhl") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip")) + .withFrontendPort(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp")) + .withProtocol(ApplicationGatewayProtocol.HTTPS) + .withSslCertificate(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert")) + .withSslProfile(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1")) + .withRequireServerNameIndication(false), + new ApplicationGatewayHttpListener().withName("appgwhttplistener") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip")) + .withFrontendPort(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80")) + .withProtocol(ApplicationGatewayProtocol.HTTP))) + .withSslProfiles(Arrays.asList(new ApplicationGatewaySslProfile().withName("sslProfile1") + .withTrustedClientCertificates(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"))) + .withSslPolicy(new ApplicationGatewaySslPolicy().withPolicyType(ApplicationGatewaySslPolicyType.CUSTOM) + .withCipherSuites( + Arrays.asList(ApplicationGatewaySslCipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256)) + .withMinProtocolVersion(ApplicationGatewaySslProtocol.TLSV1_1)) + .withClientAuthConfiguration( + new ApplicationGatewayClientAuthConfiguration().withVerifyClientCertIssuerDN(true)))) + .withRequestRoutingRules(Arrays.asList(new ApplicationGatewayRequestRoutingRule().withName("appgwrule") + .withRuleType(ApplicationGatewayRequestRoutingRuleType.BASIC) + .withPriority(10) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")) + .withBackendHttpSettings(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs")) + .withHttpListener(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl")) + .withRewriteRuleSet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1")))) + .withRewriteRuleSets( + Arrays + .asList( + new ApplicationGatewayRewriteRuleSet().withName("rewriteRuleSet1") + .withRewriteRules(Arrays.asList(new ApplicationGatewayRewriteRule() + .withName("Set X-Forwarded-For") + .withRuleSequence(102) + .withConditions(Arrays.asList(new ApplicationGatewayRewriteRuleCondition() + .withVariable("http_req_Authorization") + .withPattern("^Bearer") + .withIgnoreCase(true) + .withNegate(false))) + .withActionSet(new ApplicationGatewayRewriteRuleActionSet() + .withRequestHeaderConfigurations(Arrays.asList( + new ApplicationGatewayHeaderConfiguration().withHeaderName("X-Forwarded-For") + .withHeaderValue("{var_add_x_forwarded_for_proxy}"))) + .withResponseHeaderConfigurations( + Arrays.asList(new ApplicationGatewayHeaderConfiguration() + .withHeaderName("Strict-Transport-Security") + .withHeaderValue("max-age=31536000"))) + .withUrlConfiguration( + new ApplicationGatewayUrlConfiguration().withModifiedPath("/abc"))))))) + .withGlobalConfiguration(new ApplicationGatewayGlobalConfiguration().withEnableRequestBuffering(true) + .withEnableResponseBuffering(true)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ApplicationGateways_Delete + +```java +/** + * Samples for ApplicationGateways Delete. + */ +public final class ApplicationGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayDelete.json + */ + /** + * Sample code: Delete ApplicationGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().delete("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_GetByResourceGroup + +```java +/** + * Samples for ApplicationGateways GetByResourceGroup. + */ +public final class ApplicationGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayGet.json + */ + /** + * Sample code: Get ApplicationGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().getByResourceGroupWithResponse("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_GetSslPredefinedPolicy + +```java +/** + * Samples for ApplicationGateways GetSslPredefinedPolicy. + */ +public final class ApplicationGatewaysGetSslPredefinedPolicySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json + */ + /** + * Sample code: Get Available Ssl Predefined Policy by name. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailableSslPredefinedPolicyByName(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways() + .getSslPredefinedPolicyWithResponse("AppGwSslPolicy20150501", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_List + +```java +/** + * Samples for ApplicationGateways List. + */ +public final class ApplicationGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayListAll. + * json + */ + /** + * Sample code: Lists all application gateways in a subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listsAllApplicationGatewaysInASubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableRequestHeaders + +```java +/** + * Samples for ApplicationGateways ListAvailableRequestHeaders. + */ +public final class ApplicationGatewaysListAvailableRequestHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableRequestHeadersGet.json + */ + /** + * Sample code: Get Available Request Headers. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableRequestHeaders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableRequestHeadersWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableResponseHeaders + +```java +/** + * Samples for ApplicationGateways ListAvailableResponseHeaders. + */ +public final class ApplicationGatewaysListAvailableResponseHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableResponseHeadersGet.json + */ + /** + * Sample code: Get Available Response Headers. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableResponseHeaders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableResponseHeadersWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableServerVariables + +```java +/** + * Samples for ApplicationGateways ListAvailableServerVariables. + */ +public final class ApplicationGatewaysListAvailableServerVariablesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableServerVariablesGet.json + */ + /** + * Sample code: Get Available Server Variables. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableServerVariables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableServerVariablesWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableSslOptions + +```java +/** + * Samples for ApplicationGateways ListAvailableSslOptions. + */ +public final class ApplicationGatewaysListAvailableSslOptionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableSslOptionsGet.json + */ + /** + * Sample code: Get Available Ssl Options. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableSslOptions(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableSslOptionsWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableSslPredefinedPolicies + +```java +/** + * Samples for ApplicationGateways ListAvailableSslPredefinedPolicies. + */ +public final class ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json + */ + /** + * Sample code: Get Available Ssl Predefined Policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailableSslPredefinedPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableSslPredefinedPolicies(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_ListAvailableWafRuleSets + +```java +/** + * Samples for ApplicationGateways ListAvailableWafRuleSets. + */ +public final class ApplicationGatewaysListAvailableWafRuleSetsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableWafRuleSetsGet.json + */ + /** + * Sample code: Get Available Waf Rule Sets. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableWafRuleSets(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableWafRuleSetsWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_ListByResourceGroup + +```java +/** + * Samples for ApplicationGateways ListByResourceGroup. + */ +public final class ApplicationGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayList.json + */ + /** + * Sample code: Lists all application gateways in a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listsAllApplicationGatewaysInAResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_Start + +```java +/** + * Samples for ApplicationGateways Start. + */ +public final class ApplicationGatewaysStartSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayStart.json + */ + /** + * Sample code: Start Application Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void startApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().start("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_Stop + +```java +/** + * Samples for ApplicationGateways Stop. + */ +public final class ApplicationGatewaysStopSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayStop.json + */ + /** + * Sample code: Stop Application Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().stop("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationGateways_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApplicationGateways UpdateTags. + */ +public final class ApplicationGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayUpdateTags. + * json + */ + /** + * Sample code: Update Application Gateway tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateApplicationGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ApplicationGateway resource = manager.applicationGateways() + .getByResourceGroupWithResponse("rg1", "AppGw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ApplicationSecurityGroups_CreateOrUpdate + +```java +/** + * Samples for ApplicationSecurityGroups CreateOrUpdate. + */ +public final class ApplicationSecurityGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupCreate.json + */ + /** + * Sample code: Create application security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createApplicationSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups() + .define("test-asg") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .create(); + } +} +``` + +### ApplicationSecurityGroups_Delete + +```java +/** + * Samples for ApplicationSecurityGroups Delete. + */ +public final class ApplicationSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupDelete.json + */ + /** + * Sample code: Delete application security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteApplicationSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups().delete("rg1", "test-asg", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_GetByResourceGroup + +```java +/** + * Samples for ApplicationSecurityGroups GetByResourceGroup. + */ +public final class ApplicationSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationSecurityGroupGet. + * json + */ + /** + * Sample code: Get application security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getApplicationSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups() + .getByResourceGroupWithResponse("rg1", "test-asg", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_List + +```java +/** + * Samples for ApplicationSecurityGroups List. + */ +public final class ApplicationSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupListAll.json + */ + /** + * Sample code: List all application security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllApplicationSecurityGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_ListByResourceGroup + +```java +/** + * Samples for ApplicationSecurityGroups ListByResourceGroup. + */ +public final class ApplicationSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationSecurityGroupList. + * json + */ + /** + * Sample code: List load balancers in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listLoadBalancersInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationSecurityGroups_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApplicationSecurityGroups UpdateTags. + */ +public final class ApplicationSecurityGroupsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupUpdateTags.json + */ + /** + * Sample code: Update application security group tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateApplicationSecurityGroupTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ApplicationSecurityGroup resource = manager.applicationSecurityGroups() + .getByResourceGroupWithResponse("rg1", "test-asg", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AvailableDelegations_List + +```java +/** + * Samples for AvailableDelegations List. + */ +public final class AvailableDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailableDelegationsSubscriptionGet.json + */ + /** + * Sample code: Get available delegations. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableDelegations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableDelegations().list("westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailableEndpointServices_List + +```java +/** + * Samples for AvailableEndpointServices List. + */ +public final class AvailableEndpointServicesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/EndpointServicesList.json + */ + /** + * Sample code: EndpointServicesList. + * + * @param manager Entry point to NetworkManager. + */ + public static void endpointServicesList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableEndpointServices().list("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailablePrivateEndpointTypes_List + +```java +/** + * Samples for AvailablePrivateEndpointTypes List. + */ +public final class AvailablePrivateEndpointTypesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailablePrivateEndpointTypesGet.json + */ + /** + * Sample code: Get available PrivateEndpoint types. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailablePrivateEndpointTypes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availablePrivateEndpointTypes().list("regionName", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailablePrivateEndpointTypes_ListByResourceGroup + +```java +/** + * Samples for AvailablePrivateEndpointTypes ListByResourceGroup. + */ +public final class AvailablePrivateEndpointTypesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailablePrivateEndpointTypesResourceGroupGet.json + */ + /** + * Sample code: Get available PrivateEndpoint types in the resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailablePrivateEndpointTypesInTheResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availablePrivateEndpointTypes() + .listByResourceGroup("regionName", "rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailableResourceGroupDelegations_List + +```java +/** + * Samples for AvailableResourceGroupDelegations List. + */ +public final class AvailableResourceGroupDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailableDelegationsResourceGroupGet.json + */ + /** + * Sample code: Get available delegations in the resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailableDelegationsInTheResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableResourceGroupDelegations().list("westcentralus", "rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailableServiceAliases_List + +```java +/** + * Samples for AvailableServiceAliases List. + */ +public final class AvailableServiceAliasesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AvailableServiceAliasesList. + * json + */ + /** + * Sample code: Get available service aliases. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableServiceAliases(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableServiceAliases().list("westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailableServiceAliases_ListByResourceGroup + +```java +/** + * Samples for AvailableServiceAliases ListByResourceGroup. + */ +public final class AvailableServiceAliasesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailableServiceAliasesListByResourceGroup.json + */ + /** + * Sample code: Get available service aliases in the resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableServiceAliasesInTheResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableServiceAliases().listByResourceGroup("rg1", "westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewallFqdnTags_List + +```java +/** + * Samples for AzureFirewallFqdnTags List. + */ +public final class AzureFirewallFqdnTagsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallFqdnTagsListBySubscription.json + */ + /** + * Sample code: List all Azure Firewall FQDN Tags for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllAzureFirewallFQDNTagsForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewallFqdnTags().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewalls_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleProtocol; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleProtocolType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRCAction; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRCActionType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleProtocol; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCAction; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCActionType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSkuName; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSkuTier; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.HubPublicIpAddresses; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AzureFirewalls CreateOrUpdate. + */ +public final class AzureFirewallsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPutWithIpGroups. + * json + */ + /** + * Sample code: Create Azure Firewall With IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallWithIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPutWithZones. + * json + */ + /** + * Sample code: Create Azure Firewall With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US 2") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList("1", "2", "3")) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPut.json + */ + /** + * Sample code: Create Azure Firewall. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallPutWithAdditionalProperties.json + */ + /** + * Sample code: Create Azure Firewall With Additional Properties. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAzureFirewallWithAdditionalProperties( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .withAdditionalProperties(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPutInHub.json + */ + /** + * Sample code: Create Azure Firewall in virtual Hub. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallInVirtualHub(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .withFirewallPolicy(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1")) + .withHubIpAddresses(new HubIpAddresses() + .withPublicIPs(new HubPublicIpAddresses().withAddresses(Arrays.asList()).withCount(1))) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_HUB).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallPutWithMgmtSubnet.json + */ + /** + * Sample code: Create Azure Firewall With management subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallWithManagementSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withManagementIpConfiguration(new AzureFirewallIpConfiguration() + .withName("azureFirewallMgmtIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AzureFirewalls_Delete + +```java +/** + * Samples for AzureFirewalls Delete. + */ +public final class AzureFirewallsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallDelete.json + */ + /** + * Sample code: Delete Azure Firewall. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().delete("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewalls_GetByResourceGroup + +```java +/** + * Samples for AzureFirewalls GetByResourceGroup. + */ +public final class AzureFirewallsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallGetWithAdditionalProperties.json + */ + /** + * Sample code: Get Azure Firewall With Additional Properties. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAzureFirewallWithAdditionalProperties(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallGetWithIpGroups. + * json + */ + /** + * Sample code: Get Azure Firewall With IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAzureFirewallWithIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallGetWithZones. + * json + */ + /** + * Sample code: Get Azure Firewall With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureFirewallWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallGetWithMgmtSubnet.json + */ + /** + * Sample code: Get Azure Firewall With management subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAzureFirewallWithManagementSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallGet.json + */ + /** + * Sample code: Get Azure Firewall. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewalls_List + +```java +/** + * Samples for AzureFirewalls List. + */ +public final class AzureFirewallsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallListBySubscription.json + */ + /** + * Sample code: List all Azure Firewalls for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllAzureFirewallsForAGivenSubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewalls_ListByResourceGroup + +```java +/** + * Samples for AzureFirewalls ListByResourceGroup. + */ +public final class AzureFirewallsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallListByResourceGroup.json + */ + /** + * Sample code: List all Azure Firewalls for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllAzureFirewallsForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewalls_ListLearnedPrefixes + +```java +/** + * Samples for AzureFirewalls ListLearnedPrefixes. + */ +public final class AzureFirewallsListLearnedPrefixesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallListLearnedIPPrefixes.json + */ + /** + * Sample code: AzureFirewallListLearnedPrefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + azureFirewallListLearnedPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().listLearnedPrefixes("rg1", "azureFirewall1", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewalls_PacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleProtocol; +import com.azure.resourcemanager.network.generated.models.AzureFirewallPacketCaptureFlags; +import com.azure.resourcemanager.network.generated.models.AzureFirewallPacketCaptureFlagsType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallPacketCaptureRule; +import com.azure.resourcemanager.network.generated.models.FirewallPacketCaptureParameters; +import java.util.Arrays; + +/** + * Samples for AzureFirewalls PacketCapture. + */ +public final class AzureFirewallsPacketCaptureSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPacketCapture. + * json + */ + /** + * Sample code: AzureFirewallPacketCapture. + * + * @param manager Entry point to NetworkManager. + */ + public static void azureFirewallPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .packetCapture("rg1", "azureFirewall1", + new FirewallPacketCaptureParameters().withDurationInSeconds(300) + .withNumberOfPacketsToCapture(5000) + .withSasUrl("someSASURL") + .withFileName("azureFirewallPacketCapture") + .withProtocol(AzureFirewallNetworkRuleProtocol.ANY) + .withFlags(Arrays.asList( + new AzureFirewallPacketCaptureFlags().withType(AzureFirewallPacketCaptureFlagsType.SYN), + new AzureFirewallPacketCaptureFlags().withType(AzureFirewallPacketCaptureFlagsType.FIN))) + .withFilters(Arrays.asList( + new AzureFirewallPacketCaptureRule().withSources(Arrays.asList("20.1.1.0")) + .withDestinations(Arrays.asList("20.1.2.0")) + .withDestinationPorts(Arrays.asList("4500")), + new AzureFirewallPacketCaptureRule().withSources(Arrays.asList("10.1.1.0", "10.1.1.1")) + .withDestinations(Arrays.asList("10.1.2.0")) + .withDestinationPorts(Arrays.asList("123", "80")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### AzureFirewalls_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AzureFirewalls UpdateTags. + */ +public final class AzureFirewallsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallUpdateTags.json + */ + /** + * Sample code: Update Azure Firewall Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateAzureFirewallTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + AzureFirewall resource = manager.azureFirewalls() + .getByResourceGroupWithResponse("azfwtest", "fw1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BastionHosts_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.BastionHostPropertiesFormatNetworkAcls; +import com.azure.resourcemanager.network.generated.models.IpRule; +import java.util.Arrays; + +/** + * Samples for BastionHosts CreateOrUpdate. + */ +public final class BastionHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDeveloperPut.json + */ + /** + * Sample code: Create Developer Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDeveloperBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .define("bastionhostdeveloper") + .withRegion((String) null) + .withExistingResourceGroup("rg2") + .withIpConfigurations(Arrays.asList()) + .withVirtualNetwork(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withNetworkAcls(new BastionHostPropertiesFormatNetworkAcls() + .withIpRules(Arrays.asList(new IpRule().withAddressPrefix("1.1.1.1/16")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostPut.json + */ + /** + * Sample code: Create Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void createBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .define("bastionhosttenant") + .withRegion((String) null) + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new BastionHostIpConfiguration().withName("bastionHostIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostPutWithZones.json + */ + /** + * Sample code: Create Bastion Host With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void createBastionHostWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .define("bastionhosttenant") + .withRegion((String) null) + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new BastionHostIpConfiguration().withName("bastionHostIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .create(); + } +} +``` + +### BastionHosts_Delete + +```java +/** + * Samples for BastionHosts Delete. + */ +public final class BastionHostsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDeveloperDelete. + * json + */ + /** + * Sample code: Delete Developer Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDeveloperBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().delete("rg2", "bastionhostdeveloper", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDelete.json + */ + /** + * Sample code: Delete Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().delete("rg1", "bastionhosttenant", com.azure.core.util.Context.NONE); + } +} +``` + +### BastionHosts_GetByResourceGroup + +```java +/** + * Samples for BastionHosts GetByResourceGroup. + */ +public final class BastionHostsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDeveloperGet.json + */ + /** + * Sample code: Get Developer Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDeveloperBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhostdeveloper'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostGetWithZones.json + */ + /** + * Sample code: Get Bastion Host With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void getBastionHostWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhosttenant'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostGet.json + */ + /** + * Sample code: Get Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void getBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhosttenant'", com.azure.core.util.Context.NONE); + } +} +``` + +### BastionHosts_List + +```java +/** + * Samples for BastionHosts List. + */ +public final class BastionHostsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostListBySubscription + * .json + */ + /** + * Sample code: List all Bastion Hosts for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllBastionHostsForAGivenSubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### BastionHosts_ListByResourceGroup + +```java +/** + * Samples for BastionHosts ListByResourceGroup. + */ +public final class BastionHostsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * BastionHostListByResourceGroup.json + */ + /** + * Sample code: List all Bastion Hosts for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllBastionHostsForAGivenResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### BastionHosts_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.BastionHost; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BastionHosts UpdateTags. + */ +public final class BastionHostsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostPatch.json + */ + /** + * Sample code: Patch Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void patchBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + BastionHost resource = manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhosttenant", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BgpServiceCommunities_List + +```java +/** + * Samples for BgpServiceCommunities List. + */ +public final class BgpServiceCommunitiesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceCommunityList.json + */ + /** + * Sample code: ServiceCommunityList. + * + * @param manager Entry point to NetworkManager. + */ + public static void serviceCommunityList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bgpServiceCommunities().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationPolicyGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.VpnPolicyMemberAttributeType; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroupMember; +import java.util.Arrays; + +/** + * Samples for ConfigurationPolicyGroups CreateOrUpdate. + */ +public final class ConfigurationPolicyGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ConfigurationPolicyGroupPut. + * json + */ + /** + * Sample code: ConfigurationPolicyGroupPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void configurationPolicyGroupPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .define("policyGroup1") + .withExistingVpnServerConfiguration("rg1", "vpnServerConfiguration1") + .withIsDefault(true) + .withPriority(0) + .withPolicyMembers(Arrays.asList( + new VpnServerConfigurationPolicyGroupMember().withName("policy1") + .withAttributeType(VpnPolicyMemberAttributeType.RADIUS_AZURE_GROUP_ID) + .withAttributeValue("6ad1bd08"), + new VpnServerConfigurationPolicyGroupMember().withName("policy2") + .withAttributeType(VpnPolicyMemberAttributeType.CERTIFICATE_GROUP_ID) + .withAttributeValue("red.com"))) + .create(); + } +} +``` + +### ConfigurationPolicyGroups_Delete + +```java +/** + * Samples for ConfigurationPolicyGroups Delete. + */ +public final class ConfigurationPolicyGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ConfigurationPolicyGroupDelete.json + */ + /** + * Sample code: ConfigurationPolicyGroupDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + configurationPolicyGroupDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .delete("rg1", "vpnServerConfiguration1", "policyGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationPolicyGroups_Get + +```java +/** + * Samples for ConfigurationPolicyGroups Get. + */ +public final class ConfigurationPolicyGroupsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ConfigurationPolicyGroupGet. + * json + */ + /** + * Sample code: ConfigurationPolicyGroupGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void configurationPolicyGroupGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .getWithResponse("rg1", "vpnServerConfiguration1", "policyGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationPolicyGroups_ListByVpnServerConfiguration + +```java +/** + * Samples for ConfigurationPolicyGroups ListByVpnServerConfiguration. + */ +public final class ConfigurationPolicyGroupsListByVpnServerConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ConfigurationPolicyGroupListByVpnServerConfiguration.json + */ + /** + * Sample code: ConfigurationPolicyGroupListByVpnServerConfiguration. + * + * @param manager Entry point to NetworkManager. + */ + public static void configurationPolicyGroupListByVpnServerConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .listByVpnServerConfiguration("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectionMonitors_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilter; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterItem; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterItemType; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterType; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointLocationDetails; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointScope; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointScopeItem; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTcpConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfigurationProtocol; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.EndpointType; +import java.util.Arrays; + +/** + * Samples for ConnectionMonitors CreateOrUpdate. + */ +public final class ConnectionMonitorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorCreate.json + */ + /** + * Sample code: Create connection monitor V1. + * + * @param manager Entry point to NetworkManager. + */ + public static void createConnectionMonitorV1(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors() + .define("cm1") + .withExistingNetworkWatcher("rg1", "nw1") + .withRegion("eastus") + .withEndpoints(Arrays.asList( + new ConnectionMonitorEndpoint().withName("source") + .withResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + new ConnectionMonitorEndpoint().withName("destination").withAddress("bing.com"))) + .withTestConfigurations(Arrays.asList(new ConnectionMonitorTestConfiguration().withName("tcp") + .withTestFrequencySec(60) + .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP) + .withTcpConfiguration(new ConnectionMonitorTcpConfiguration().withPort(80)))) + .withTestGroups(Arrays.asList(new ConnectionMonitorTestGroup().withName("tg") + .withTestConfigurations(Arrays.asList("tcp")) + .withSources(Arrays.asList("source")) + .withDestinations(Arrays.asList("destination")))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorCreateWithArcNetwork.json + */ + /** + * Sample code: Create connection monitor with Arc Network. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createConnectionMonitorWithArcNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors() + .define("cm1") + .withExistingNetworkWatcher("rg1", "nw1") + .withEndpoints(Arrays.asList(new ConnectionMonitorEndpoint().withName("vm1") + .withType(EndpointType.AZURE_VM) + .withResourceId( + "/subscriptions/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), + new ConnectionMonitorEndpoint().withName("bing") + .withType(EndpointType.EXTERNAL_ADDRESS) + .withAddress("bing.com"), + new ConnectionMonitorEndpoint().withName("google") + .withType(EndpointType.EXTERNAL_ADDRESS) + .withAddress("google.com"), + new ConnectionMonitorEndpoint().withName("ArcBasedNetwork") + .withType(EndpointType.AZURE_ARC_NETWORK) + .withScope(new ConnectionMonitorEndpointScope().withInclude( + Arrays.asList(new ConnectionMonitorEndpointScopeItem().withAddress("172.21.128.0/20")))) + .withLocationDetails(new ConnectionMonitorEndpointLocationDetails().withRegion("eastus")) + .withSubscriptionId("9cece3e3-0f7d-47ca-af0e-9772773f90b7"))) + .withTestConfigurations(Arrays.asList(new ConnectionMonitorTestConfiguration().withName("testConfig1") + .withTestFrequencySec(60) + .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP) + .withTcpConfiguration( + new ConnectionMonitorTcpConfiguration().withPort(80).withDisableTraceRoute(false)))) + .withTestGroups(Arrays.asList(new ConnectionMonitorTestGroup().withName("test1") + .withDisable(false) + .withTestConfigurations(Arrays.asList("testConfig1")) + .withSources(Arrays.asList("vm1", "ArcBasedNetwork")) + .withDestinations(Arrays.asList("bing", "google")))) + .withOutputs(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorV2Create.json + */ + /** + * Sample code: Create connection monitor V2. + * + * @param manager Entry point to NetworkManager. + */ + public static void createConnectionMonitorV2(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors() + .define("cm1") + .withExistingNetworkWatcher("rg1", "nw1") + .withEndpoints(Arrays.asList(new ConnectionMonitorEndpoint().withName("vm1") + .withResourceId( + "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), + new ConnectionMonitorEndpoint().withName("CanaryWorkspaceVamshi") + .withResourceId( + "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace") + .withFilter( + new ConnectionMonitorEndpointFilter().withType(ConnectionMonitorEndpointFilterType.INCLUDE) + .withItems(Arrays.asList(new ConnectionMonitorEndpointFilterItem() + .withType(ConnectionMonitorEndpointFilterItemType.AGENT_ADDRESS) + .withAddress("npmuser")))), + new ConnectionMonitorEndpoint().withName("bing").withAddress("bing.com"), + new ConnectionMonitorEndpoint().withName("google").withAddress("google.com"))) + .withTestConfigurations(Arrays.asList(new ConnectionMonitorTestConfiguration().withName("testConfig1") + .withTestFrequencySec(60) + .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP) + .withTcpConfiguration( + new ConnectionMonitorTcpConfiguration().withPort(80).withDisableTraceRoute(false)))) + .withTestGroups(Arrays.asList(new ConnectionMonitorTestGroup().withName("test1") + .withDisable(false) + .withTestConfigurations(Arrays.asList("testConfig1")) + .withSources(Arrays.asList("vm1", "CanaryWorkspaceVamshi")) + .withDestinations(Arrays.asList("bing", "google")))) + .withOutputs(Arrays.asList()) + .create(); + } +} +``` + +### ConnectionMonitors_Delete + +```java +/** + * Samples for ConnectionMonitors Delete. + */ +public final class ConnectionMonitorsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorDelete.json + */ + /** + * Sample code: Delete connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().delete("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectionMonitors_Get + +```java +/** + * Samples for ConnectionMonitors Get. + */ +public final class ConnectionMonitorsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorGet.json + */ + /** + * Sample code: Get connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void getConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().getWithResponse("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectionMonitors_List + +```java +/** + * Samples for ConnectionMonitors List. + */ +public final class ConnectionMonitorsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorList.json + */ + /** + * Sample code: List connection monitors. + * + * @param manager Entry point to NetworkManager. + */ + public static void listConnectionMonitors(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().list("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectionMonitors_Query + +```java +/** + * Samples for ConnectionMonitors Query. + */ +public final class ConnectionMonitorsQuerySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorQuery.json + */ + /** + * Sample code: Query connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void queryConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().query("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectionMonitors_Start + +```java +/** + * Samples for ConnectionMonitors Start. + */ +public final class ConnectionMonitorsStartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorStart.json + */ + /** + * Sample code: Start connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void startConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().start("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectionMonitors_Stop + +```java +/** + * Samples for ConnectionMonitors Stop. + */ +public final class ConnectionMonitorsStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorStop.json + */ + /** + * Sample code: Stop connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().stop("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectionMonitors_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorResult; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConnectionMonitors UpdateTags. + */ +public final class ConnectionMonitorsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorUpdateTags.json + */ + /** + * Sample code: Update connection monitor tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateConnectionMonitorTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ConnectionMonitorResult resource = manager.connectionMonitors() + .getWithResponse("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ConnectivityConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ConnectivityGroupItem; +import com.azure.resourcemanager.network.generated.models.ConnectivityTopology; +import com.azure.resourcemanager.network.generated.models.DeleteExistingPeering; +import com.azure.resourcemanager.network.generated.models.GroupConnectivity; +import com.azure.resourcemanager.network.generated.models.Hub; +import com.azure.resourcemanager.network.generated.models.IsGlobal; +import com.azure.resourcemanager.network.generated.models.UseHubGateway; +import java.util.Arrays; + +/** + * Samples for ConnectivityConfigurations CreateOrUpdate. + */ +public final class ConnectivityConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationPut.json + */ + /** + * Sample code: ConnectivityConfigurationsPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .define("myTestConnectivityConfig") + .withExistingNetworkManager("myResourceGroup", "testNetworkManager") + .withDescription("Sample Configuration") + .withConnectivityTopology(ConnectivityTopology.HUB_AND_SPOKE) + .withHubs(Arrays.asList(new Hub().withResourceId( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig") + .withResourceType("Microsoft.Network/virtualNetworks"))) + .withIsGlobal(IsGlobal.TRUE) + .withAppliesToGroups(Arrays.asList(new ConnectivityGroupItem().withNetworkGroupId( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1") + .withUseHubGateway(UseHubGateway.TRUE) + .withIsGlobal(IsGlobal.FALSE) + .withGroupConnectivity(GroupConnectivity.NONE))) + .withDeleteExistingPeering(DeleteExistingPeering.TRUE) + .create(); + } +} +``` + +### ConnectivityConfigurations_Delete + +```java +/** + * Samples for ConnectivityConfigurations Delete. + */ +public final class ConnectivityConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationDelete.json + */ + /** + * Sample code: ConnectivityConfigurationsDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .delete("myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", false, + com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectivityConfigurations_Get + +```java +/** + * Samples for ConnectivityConfigurations Get. + */ +public final class ConnectivityConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationGet.json + */ + /** + * Sample code: ConnectivityConfigurationsGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .getWithResponse("myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", + com.azure.core.util.Context.NONE); + } +} +``` + +### ConnectivityConfigurations_List + +```java +/** + * Samples for ConnectivityConfigurations List. + */ +public final class ConnectivityConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationList.json + */ + /** + * Sample code: ConnectivityConfigurationsList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .list("myResourceGroup", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### CustomIpPrefixes_CreateOrUpdate + +```java +/** + * Samples for CustomIpPrefixes CreateOrUpdate. + */ +public final class CustomIpPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CustomIpPrefixCreateCustomizedValues.json + */ + /** + * Sample code: Create custom IP prefix allocation method. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createCustomIPPrefixAllocationMethod(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes() + .define("test-customipprefix") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withCidr("0.0.0.0/24") + .create(); + } +} +``` + +### CustomIpPrefixes_Delete + +```java +/** + * Samples for CustomIpPrefixes Delete. + */ +public final class CustomIpPrefixesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixDelete.json + */ + /** + * Sample code: Delete custom IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteCustomIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes().delete("rg1", "test-customipprefix", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomIpPrefixes_GetByResourceGroup + +```java +/** + * Samples for CustomIpPrefixes GetByResourceGroup. + */ +public final class CustomIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixGet.json + */ + /** + * Sample code: Get custom IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void getCustomIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-customipprefix", null, com.azure.core.util.Context.NONE); + } +} +``` + +### CustomIpPrefixes_List + +```java +/** + * Samples for CustomIpPrefixes List. + */ +public final class CustomIpPrefixesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixListAll.json + */ + /** + * Sample code: List all custom IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllCustomIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### CustomIpPrefixes_ListByResourceGroup + +```java +/** + * Samples for CustomIpPrefixes ListByResourceGroup. + */ +public final class CustomIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixList.json + */ + /** + * Sample code: List resource group Custom IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupCustomIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomIpPrefixes_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.CustomIpPrefix; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CustomIpPrefixes UpdateTags. + */ +public final class CustomIpPrefixesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixUpdateTags.json + */ + /** + * Sample code: Update public IP address tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updatePublicIPAddressTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + CustomIpPrefix resource = manager.customIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-customipprefix", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DdosCustomPolicies_CreateOrUpdate + +```java +/** + * Samples for DdosCustomPolicies CreateOrUpdate. + */ +public final class DdosCustomPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyCreate.json + */ + /** + * Sample code: Create DDoS custom policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosCustomPolicies() + .define("test-ddos-custom-policy") + .withRegion("centraluseuap") + .withExistingResourceGroup("rg1") + .create(); + } +} +``` + +### DdosCustomPolicies_Delete + +```java +/** + * Samples for DdosCustomPolicies Delete. + */ +public final class DdosCustomPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyDelete.json + */ + /** + * Sample code: Delete DDoS custom policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosCustomPolicies().delete("rg1", "test-ddos-custom-policy", com.azure.core.util.Context.NONE); + } +} +``` + +### DdosCustomPolicies_GetByResourceGroup + +```java +/** + * Samples for DdosCustomPolicies GetByResourceGroup. + */ +public final class DdosCustomPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyGet.json + */ + /** + * Sample code: Get DDoS custom policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosCustomPolicies() + .getByResourceGroupWithResponse("rg1", "test-ddos-custom-policy", com.azure.core.util.Context.NONE); + } +} +``` + +### DdosCustomPolicies_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DdosCustomPolicies UpdateTags. + */ +public final class DdosCustomPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyUpdateTags. + * json + */ + /** + * Sample code: DDoS Custom policy Update tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void dDoSCustomPolicyUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + DdosCustomPolicy resource = manager.ddosCustomPolicies() + .getByResourceGroupWithResponse("rg1", "test-ddos-custom-policy", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DdosProtectionPlans_CreateOrUpdate + +```java +/** + * Samples for DdosProtectionPlans CreateOrUpdate. + */ +public final class DdosProtectionPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanCreate.json + */ + /** + * Sample code: Create DDoS protection plan. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans() + .define("test-plan") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .create(); + } +} +``` + +### DdosProtectionPlans_Delete + +```java +/** + * Samples for DdosProtectionPlans Delete. + */ +public final class DdosProtectionPlansDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanDelete.json + */ + /** + * Sample code: Delete DDoS protection plan. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans().delete("rg1", "test-plan", com.azure.core.util.Context.NONE); + } +} +``` + +### DdosProtectionPlans_GetByResourceGroup + +```java +/** + * Samples for DdosProtectionPlans GetByResourceGroup. + */ +public final class DdosProtectionPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanGet.json + */ + /** + * Sample code: Get DDoS protection plan. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans() + .getByResourceGroupWithResponse("rg1", "test-plan", com.azure.core.util.Context.NONE); + } +} +``` + +### DdosProtectionPlans_List + +```java +/** + * Samples for DdosProtectionPlans List. + */ +public final class DdosProtectionPlansListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanListAll. + * json + */ + /** + * Sample code: List all DDoS protection plans. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllDDoSProtectionPlans(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DdosProtectionPlans_ListByResourceGroup + +```java +/** + * Samples for DdosProtectionPlans ListByResourceGroup. + */ +public final class DdosProtectionPlansListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanList.json + */ + /** + * Sample code: List DDoS protection plans in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listDDoSProtectionPlansInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### DdosProtectionPlans_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlan; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DdosProtectionPlans UpdateTags. + */ +public final class DdosProtectionPlansUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanUpdateTags. + * json + */ + /** + * Sample code: DDoS protection plan Update tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + dDoSProtectionPlanUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + DdosProtectionPlan resource = manager.ddosProtectionPlans() + .getByResourceGroupWithResponse("rg1", "test-plan", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DefaultSecurityRules_Get + +```java +/** + * Samples for DefaultSecurityRules Get. + */ +public final class DefaultSecurityRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DefaultSecurityRuleGet.json + */ + /** + * Sample code: DefaultSecurityRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void defaultSecurityRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.defaultSecurityRules() + .getWithResponse("testrg", "nsg1", "AllowVnetInBound", com.azure.core.util.Context.NONE); + } +} +``` + +### DefaultSecurityRules_List + +```java +/** + * Samples for DefaultSecurityRules List. + */ +public final class DefaultSecurityRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DefaultSecurityRuleList.json + */ + /** + * Sample code: DefaultSecurityRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void defaultSecurityRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.defaultSecurityRules().list("testrg", "nsg1", com.azure.core.util.Context.NONE); + } +} +``` + +### DscpConfiguration_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.QosDefinition; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import java.util.Arrays; + +/** + * Samples for DscpConfiguration CreateOrUpdate. + */ +public final class DscpConfigurationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationCreate.json + */ + /** + * Sample code: Create DSCP Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDSCPConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations() + .define("mydscpconfig") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withQosDefinitionCollection(Arrays.asList( + new QosDefinition().withMarkings(Arrays.asList(1)) + .withSourceIpRanges(Arrays.asList(new QosIpRange().withStartIp("127.0.0.1").withEndIp("127.0.0.2"))) + .withDestinationIpRanges( + Arrays.asList(new QosIpRange().withStartIp("127.0.10.1").withEndIp("127.0.10.2"))) + .withSourcePortRanges(Arrays.asList(new QosPortRange().withStart(10).withEnd(11), + new QosPortRange().withStart(20).withEnd(21))) + .withDestinationPortRanges(Arrays.asList(new QosPortRange().withStart(15).withEnd(15))) + .withProtocol(ProtocolType.TCP), + new QosDefinition().withMarkings(Arrays.asList(2)) + .withSourceIpRanges(Arrays.asList(new QosIpRange().withStartIp("12.0.0.1").withEndIp("12.0.0.2"))) + .withDestinationIpRanges( + Arrays.asList(new QosIpRange().withStartIp("12.0.10.1").withEndIp("12.0.10.2"))) + .withSourcePortRanges(Arrays.asList(new QosPortRange().withStart(11).withEnd(12))) + .withDestinationPortRanges(Arrays.asList(new QosPortRange().withStart(51).withEnd(52))) + .withProtocol(ProtocolType.UDP))) + .create(); + } +} +``` + +### DscpConfiguration_Delete + +```java +/** + * Samples for DscpConfiguration Delete. + */ +public final class DscpConfigurationDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationDelete.json + */ + /** + * Sample code: Delete DSCP Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDSCPConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations().delete("rg1", "mydscpConfig", com.azure.core.util.Context.NONE); + } +} +``` + +### DscpConfiguration_GetByResourceGroup + +```java +/** + * Samples for DscpConfiguration GetByResourceGroup. + */ +public final class DscpConfigurationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationGet.json + */ + /** + * Sample code: Get Dscp Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDscpConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations() + .getByResourceGroupWithResponse("rg1", "mydscpConfig", com.azure.core.util.Context.NONE); + } +} +``` + +### DscpConfiguration_List + +```java +/** + * Samples for DscpConfiguration List. + */ +public final class DscpConfigurationListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationListAll.json + */ + /** + * Sample code: List all network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### DscpConfiguration_ListByResourceGroup + +```java +/** + * Samples for DscpConfiguration ListByResourceGroup. + */ +public final class DscpConfigurationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationList.json + */ + /** + * Sample code: Get Dscp Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDscpConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitAuthorizations_CreateOrUpdate + +```java +/** + * Samples for ExpressRouteCircuitAuthorizations CreateOrUpdate. + */ +public final class ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationCreate.json + */ + /** + * Sample code: Create ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations() + .define("authorizatinName") + .withExistingExpressRouteCircuit("rg1", "circuitName") + .create(); + } +} +``` + +### ExpressRouteCircuitAuthorizations_Delete + +```java +/** + * Samples for ExpressRouteCircuitAuthorizations Delete. + */ +public final class ExpressRouteCircuitAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationDelete.json + */ + /** + * Sample code: Delete ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations() + .delete("rg1", "circuitName", "authorizationName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitAuthorizations_Get + +```java +/** + * Samples for ExpressRouteCircuitAuthorizations Get. + */ +public final class ExpressRouteCircuitAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationGet.json + */ + /** + * Sample code: Get ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations() + .getWithResponse("rg1", "circuitName", "authorizationName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitAuthorizations_List + +```java +/** + * Samples for ExpressRouteCircuitAuthorizations List. + */ +public final class ExpressRouteCircuitAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationList.json + */ + /** + * Sample code: List ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations().list("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitConnections_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; + +/** + * Samples for ExpressRouteCircuitConnections CreateOrUpdate. + */ +public final class ExpressRouteCircuitConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionCreate.json + */ + /** + * Sample code: ExpressRouteCircuitConnectionCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCircuitConnectionCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .define("circuitConnectionUSAUS") + .withExistingPeering("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering") + .withExpressRouteCircuitPeering(new SubResource().withId( + "/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering")) + .withPeerExpressRouteCircuitPeering(new SubResource().withId( + "/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering")) + .withAddressPrefix("10.0.0.0/29") + .withAuthorizationKey("946a1918-b7a2-4917-b43c-8c4cdaee006a") + .withIpv6CircuitConnectionConfig(new Ipv6CircuitConnectionConfig().withAddressPrefix("aa:bb::/125")) + .create(); + } +} +``` + +### ExpressRouteCircuitConnections_Delete + +```java +/** + * Samples for ExpressRouteCircuitConnections Delete. + */ +public final class ExpressRouteCircuitConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionDelete.json + */ + /** + * Sample code: Delete ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .delete("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitConnections_Get + +```java +/** + * Samples for ExpressRouteCircuitConnections Get. + */ +public final class ExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionGet.json + */ + /** + * Sample code: ExpressRouteCircuitConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCircuitConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .getWithResponse("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitConnections_List + +```java +/** + * Samples for ExpressRouteCircuitConnections List. + */ +public final class ExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionList.json + */ + /** + * Sample code: List ExpressRouteCircuit Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .list("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitPeerings_CreateOrUpdate + +```java +/** + * Samples for ExpressRouteCircuitPeerings CreateOrUpdate. + */ +public final class ExpressRouteCircuitPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringCreate.json + */ + /** + * Sample code: Create ExpressRouteCircuit Peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createExpressRouteCircuitPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings() + .define("AzurePrivatePeering") + .withExistingExpressRouteCircuit("rg1", "circuitName") + .withPeerAsn(200L) + .withPrimaryPeerAddressPrefix("192.168.16.252/30") + .withSecondaryPeerAddressPrefix("192.168.18.252/30") + .withVlanId(200) + .create(); + } +} +``` + +### ExpressRouteCircuitPeerings_Delete + +```java +/** + * Samples for ExpressRouteCircuitPeerings Delete. + */ +public final class ExpressRouteCircuitPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringDelete.json + */ + /** + * Sample code: Delete ExpressRouteCircuit Peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteExpressRouteCircuitPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings() + .delete("rg1", "circuitName", "peeringName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitPeerings_Get + +```java +/** + * Samples for ExpressRouteCircuitPeerings Get. + */ +public final class ExpressRouteCircuitPeeringsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitPeeringGet + * .json + */ + /** + * Sample code: Get ExpressRouteCircuit Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings() + .getWithResponse("rg1", "circuitName", "MicrosoftPeering", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuitPeerings_List + +```java +/** + * Samples for ExpressRouteCircuitPeerings List. + */ +public final class ExpressRouteCircuitPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringList.json + */ + /** + * Sample code: List ExpressRouteCircuit Peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings().list("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSku; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSkuFamily; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSkuTier; +import java.util.Arrays; + +/** + * Samples for ExpressRouteCircuits CreateOrUpdate. + */ +public final class ExpressRouteCircuitsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitCreate. + * json + */ + /** + * Sample code: Create ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void createExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .define("circuitName") + .withRegion("Brazil South") + .withExistingResourceGroup("rg1") + .withSku(new ExpressRouteCircuitSku().withName("Standard_MeteredData") + .withTier(ExpressRouteCircuitSkuTier.STANDARD) + .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA)) + .withAllowClassicOperations(false) + .withAuthorizations(Arrays.asList()) + .withPeerings(Arrays.asList()) + .withServiceProviderProperties( + new ExpressRouteCircuitServiceProviderProperties().withServiceProviderName("Equinix") + .withPeeringLocation("Silicon Valley") + .withBandwidthInMbps(200)) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitCreateOnExpressRoutePort.json + */ + /** + * Sample code: Create ExpressRouteCircuit on ExpressRoutePort. + * + * @param manager Entry point to NetworkManager. + */ + public static void createExpressRouteCircuitOnExpressRoutePort( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .define("expressRouteCircuit1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new ExpressRouteCircuitSku().withName("Premium_MeteredData") + .withTier(ExpressRouteCircuitSkuTier.PREMIUM) + .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA)) + .withExpressRoutePort(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName")) + .withBandwidthInGbps(10.0F) + .withAuthorizationKey("b0be57f5-1fba-463b-adec-ffe767354cdd") + .withEnableDirectPortRateLimit(false) + .create(); + } +} +``` + +### ExpressRouteCircuits_Delete + +```java +/** + * Samples for ExpressRouteCircuits Delete. + */ +public final class ExpressRouteCircuitsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitDelete. + * json + */ + /** + * Sample code: Delete ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().delete("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_GetByResourceGroup + +```java +/** + * Samples for ExpressRouteCircuits GetByResourceGroup. + */ +public final class ExpressRouteCircuitsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitGet.json + */ + /** + * Sample code: Get ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void getExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .getByResourceGroupWithResponse("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_GetPeeringStats + +```java +/** + * Samples for ExpressRouteCircuits GetPeeringStats. + */ +public final class ExpressRouteCircuitsGetPeeringStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringStats.json + */ + /** + * Sample code: Get ExpressRoute Circuit Peering Traffic Stats. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitPeeringTrafficStats(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .getPeeringStatsWithResponse("rg1", "circuitName", "peeringName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_GetStats + +```java +/** + * Samples for ExpressRouteCircuits GetStats. + */ +public final class ExpressRouteCircuitsGetStatsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitStats.json + */ + /** + * Sample code: Get ExpressRoute Circuit Traffic Stats. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitTrafficStats(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().getStatsWithResponse("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_List + +```java +/** + * Samples for ExpressRouteCircuits List. + */ +public final class ExpressRouteCircuitsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitListBySubscription.json + */ + /** + * Sample code: List ExpressRouteCircuits in a subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitsInASubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListArpTable + +```java +/** + * Samples for ExpressRouteCircuits ListArpTable. + */ +public final class ExpressRouteCircuitsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitARPTableList.json + */ + /** + * Sample code: List ARP Table. + * + * @param manager Entry point to NetworkManager. + */ + public static void listARPTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .listArpTable("rg1", "circuitName", "peeringName", "devicePath", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListByResourceGroup + +```java +/** + * Samples for ExpressRouteCircuits ListByResourceGroup. + */ +public final class ExpressRouteCircuitsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitListByResourceGroup.json + */ + /** + * Sample code: List ExpressRouteCircuits in a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitsInAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListRoutesTable + +```java +/** + * Samples for ExpressRouteCircuits ListRoutesTable. + */ +public final class ExpressRouteCircuitsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitRouteTableList.json + */ + /** + * Sample code: List Route Tables. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .listRoutesTable("rg1", "circuitName", "peeringName", "devicePath", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_ListRoutesTableSummary + +```java +/** + * Samples for ExpressRouteCircuits ListRoutesTableSummary. + */ +public final class ExpressRouteCircuitsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitRouteTableSummaryList.json + */ + /** + * Sample code: List Route Table Summary. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRouteTableSummary(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .listRoutesTableSummary("rg1", "circuitName", "peeringName", "devicePath", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCircuits_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuit; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRouteCircuits UpdateTags. + */ +public final class ExpressRouteCircuitsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitUpdateTags + * .json + */ + /** + * Sample code: Update Express Route Circuit Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateExpressRouteCircuitTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRouteCircuit resource = manager.expressRouteCircuits() + .getByResourceGroupWithResponse("ertest", "er1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ExpressRouteConnections_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.util.Arrays; + +/** + * Samples for ExpressRouteConnections CreateOrUpdate. + */ +public final class ExpressRouteConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionCreate. + * json + */ + /** + * Sample code: ExpressRouteConnectionCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteConnectionCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .createOrUpdate("resourceGroupName", "gateway-2", "connectionName", new ExpressRouteConnectionInner() + .withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName") + .withName("connectionName") + .withExpressRouteCircuitPeering(new ExpressRouteCircuitPeeringId().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering")) + .withAuthorizationKey("fakeTokenPlaceholder") + .withRoutingWeight(2) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteConnections_Delete + +```java +/** + * Samples for ExpressRouteConnections Delete. + */ +public final class ExpressRouteConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionDelete. + * json + */ + /** + * Sample code: ExpressRouteConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .delete("resourceGroupName", "expressRouteGatewayName", "connectionName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteConnections_Get + +```java +/** + * Samples for ExpressRouteConnections Get. + */ +public final class ExpressRouteConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionGet. + * json + */ + /** + * Sample code: ExpressRouteConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .getWithResponse("resourceGroupName", "expressRouteGatewayName", "connectionName", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteConnections_List + +```java +/** + * Samples for ExpressRouteConnections List. + */ +public final class ExpressRouteConnectionsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionList. + * json + */ + /** + * Sample code: ExpressRouteConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .listWithResponse("resourceGroupName", "expressRouteGatewayName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; + +/** + * Samples for ExpressRouteCrossConnectionPeerings CreateOrUpdate. + */ +public final class ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringCreate.json + */ + /** + * Sample code: ExpressRouteCrossConnectionBgpPeeringCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteCrossConnectionBgpPeeringCreate( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .createOrUpdate("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + new ExpressRouteCrossConnectionPeeringInner().withPeerAsn(200L) + .withPrimaryPeerAddressPrefix("192.168.16.252/30") + .withSecondaryPeerAddressPrefix("192.168.18.252/30") + .withVlanId(200) + .withIpv6PeeringConfig(new Ipv6ExpressRouteCircuitPeeringConfig() + .withPrimaryPeerAddressPrefix("3FFE:FFFF:0:CD30::/126") + .withSecondaryPeerAddressPrefix("3FFE:FFFF:0:CD30::4/126")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_Delete + +```java +/** + * Samples for ExpressRouteCrossConnectionPeerings Delete. + */ +public final class ExpressRouteCrossConnectionPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringDelete.json + */ + /** + * Sample code: DeleteExpressRouteCrossConnectionBgpPeering. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteExpressRouteCrossConnectionBgpPeering( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .delete("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_Get + +```java +/** + * Samples for ExpressRouteCrossConnectionPeerings Get. + */ +public final class ExpressRouteCrossConnectionPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringGet.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionBgpPeering. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnectionBgpPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .getWithResponse("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnectionPeerings_List + +```java +/** + * Samples for ExpressRouteCrossConnectionPeerings List. + */ +public final class ExpressRouteCrossConnectionPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringList.json + */ + /** + * Sample code: ExpressRouteCrossConnectionBgpPeeringList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCrossConnectionBgpPeeringList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .list("CrossConnection-SiliconValley", "", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; + +/** + * Samples for ExpressRouteCrossConnections CreateOrUpdate. + */ +public final class ExpressRouteCrossConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionUpdate.json + */ + /** + * Sample code: UpdateExpressRouteCrossConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateExpressRouteCrossConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .define("") + .withRegion((String) null) + .withExistingResourceGroup("CrossConnection-SiliconValley") + .withServiceProviderProvisioningState(ServiceProviderProvisioningState.NOT_PROVISIONED) + .create(); + } +} +``` + +### ExpressRouteCrossConnections_GetByResourceGroup + +```java +/** + * Samples for ExpressRouteCrossConnections GetByResourceGroup. + */ +public final class ExpressRouteCrossConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionGet.json + */ + /** + * Sample code: GetExpressRouteCrossConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .getByResourceGroupWithResponse("CrossConnection-SiliconValley", "", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_List + +```java +/** + * Samples for ExpressRouteCrossConnections List. + */ +public final class ExpressRouteCrossConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionList.json + */ + /** + * Sample code: ExpressRouteCrossConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCrossConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections().list(null, com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListArpTable + +```java +/** + * Samples for ExpressRouteCrossConnections ListArpTable. + */ +public final class ExpressRouteCrossConnectionsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionsArpTable.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionsArpTable. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnectionsArpTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listArpTable("CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListByResourceGroup + +```java +/** + * Samples for ExpressRouteCrossConnections ListByResourceGroup. + */ +public final class ExpressRouteCrossConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionListByResourceGroup.json + */ + /** + * Sample code: ExpressRouteCrossConnectionListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteCrossConnectionListByResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listByResourceGroup("CrossConnection-SiliconValley", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListRoutesTable + +```java +/** + * Samples for ExpressRouteCrossConnections ListRoutesTable. + */ +public final class ExpressRouteCrossConnectionsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionsRouteTable.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionsRouteTable. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnectionsRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listRoutesTable("CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_ListRoutesTableSummary + +```java +/** + * Samples for ExpressRouteCrossConnections ListRoutesTableSummary. + */ +public final class ExpressRouteCrossConnectionsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionsRouteTableSummary.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionsRouteTableSummary. + * + * @param manager Entry point to NetworkManager. + */ + public static void getExpressRouteCrossConnectionsRouteTableSummary( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listRoutesTableSummary("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + "primary", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteCrossConnections_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnection; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRouteCrossConnections UpdateTags. + */ +public final class ExpressRouteCrossConnectionsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionUpdateTags.json + */ + /** + * Sample code: UpdateExpressRouteCrossConnectionTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateExpressRouteCrossConnectionTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRouteCrossConnection resource = manager.expressRouteCrossConnections() + .getByResourceGroupWithResponse("CrossConnection-SiliconValley", "", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ExpressRouteGateways_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; + +/** + * Samples for ExpressRouteGateways CreateOrUpdate. + */ +public final class ExpressRouteGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayCreate. + * json + */ + /** + * Sample code: ExpressRouteGatewayCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .define("gateway-2") + .withRegion("westus") + .withExistingResourceGroup("resourceGroupName") + .withAutoScaleConfiguration(new ExpressRouteGatewayPropertiesAutoScaleConfiguration() + .withBounds(new ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds().withMin(3))) + .withVirtualHub(new VirtualHubId().withId( + "/subscriptions/subid/resourceGroups/resourceGroupId/providers/Microsoft.Network/virtualHubs/virtualHubName")) + .withAllowNonVirtualWanTraffic(false) + .create(); + } +} +``` + +### ExpressRouteGateways_Delete + +```java +/** + * Samples for ExpressRouteGateways Delete. + */ +public final class ExpressRouteGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayDelete. + * json + */ + /** + * Sample code: ExpressRouteGatewayDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .delete("resourceGroupName", "expressRouteGatewayName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteGateways_GetByResourceGroup + +```java +/** + * Samples for ExpressRouteGateways GetByResourceGroup. + */ +public final class ExpressRouteGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayGet.json + */ + /** + * Sample code: ExpressRouteGatewayGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .getByResourceGroupWithResponse("resourceGroupName", "expressRouteGatewayName", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteGateways_ListByResourceGroup + +```java +/** + * Samples for ExpressRouteGateways ListByResourceGroup. + */ +public final class ExpressRouteGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteGatewayListByResourceGroup.json + */ + /** + * Sample code: ExpressRouteGatewayListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteGatewayListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .listByResourceGroupWithResponse("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteGateways_ListBySubscription + +```java +/** + * Samples for ExpressRouteGateways ListBySubscription. + */ +public final class ExpressRouteGatewaysListBySubscriptionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteGatewayListBySubscription.json + */ + /** + * Sample code: ExpressRouteGatewayListBySubscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteGatewayListBySubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways().listBySubscriptionWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteGateways_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRouteGateways UpdateTags. + */ +public final class ExpressRouteGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayUpdateTags + * .json + */ + /** + * Sample code: ExpressRouteGatewayUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRouteGateway resource = manager.expressRouteGateways() + .getByResourceGroupWithResponse("resourceGroupName", "expressRouteGatewayName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ExpressRouteLinks_Get + +```java +/** + * Samples for ExpressRouteLinks Get. + */ +public final class ExpressRouteLinksGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteLinkGet.json + */ + /** + * Sample code: ExpressRouteLinkGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteLinkGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteLinks().getWithResponse("rg1", "portName", "linkName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteLinks_List + +```java +/** + * Samples for ExpressRouteLinks List. + */ +public final class ExpressRouteLinksListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteLinkList.json + */ + /** + * Sample code: ExpressRouteLinkGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteLinkGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteLinks().list("rg1", "portName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePortAuthorizations_CreateOrUpdate + +```java +/** + * Samples for ExpressRoutePortAuthorizations CreateOrUpdate. + */ +public final class ExpressRoutePortAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationCreate.json + */ + /** + * Sample code: Create ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations() + .define("authorizatinName") + .withExistingExpressRoutePort("rg1", "expressRoutePortName") + .create(); + } +} +``` + +### ExpressRoutePortAuthorizations_Delete + +```java +/** + * Samples for ExpressRoutePortAuthorizations Delete. + */ +public final class ExpressRoutePortAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationDelete.json + */ + /** + * Sample code: Delete ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations() + .delete("rg1", "expressRoutePortName", "authorizationName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePortAuthorizations_Get + +```java +/** + * Samples for ExpressRoutePortAuthorizations Get. + */ +public final class ExpressRoutePortAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationGet.json + */ + /** + * Sample code: Get ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations() + .getWithResponse("rg1", "expressRoutePortName", "authorizationName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePortAuthorizations_List + +```java +/** + * Samples for ExpressRoutePortAuthorizations List. + */ +public final class ExpressRoutePortAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationList.json + */ + /** + * Sample code: List ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations().list("rg1", "expressRoutePortName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePorts_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsBillingType; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import java.util.Arrays; + +/** + * Samples for ExpressRoutePorts CreateOrUpdate. + */ +public final class ExpressRoutePortsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortUpdateLink. + * json + */ + /** + * Sample code: ExpressRoutePortUpdateLink. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortUpdateLink(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts() + .define("portName") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withPeeringLocation("peeringLocationName") + .withBandwidthInGbps(100) + .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ) + .withLinks(Arrays.asList( + new ExpressRouteLinkInner().withName("link1").withAdminState(ExpressRouteLinkAdminState.ENABLED))) + .withBillingType(ExpressRoutePortsBillingType.UNLIMITED_DATA) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortCreate.json + */ + /** + * Sample code: ExpressRoutePortCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts() + .define("portName") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withPeeringLocation("peeringLocationName") + .withBandwidthInGbps(100) + .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ) + .withBillingType(ExpressRoutePortsBillingType.UNLIMITED_DATA) + .create(); + } +} +``` + +### ExpressRoutePorts_Delete + +```java +/** + * Samples for ExpressRoutePorts Delete. + */ +public final class ExpressRoutePortsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortDelete.json + */ + /** + * Sample code: ExpressRoutePortDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().delete("rg1", "portName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePorts_GenerateLoa + +```java +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; + +/** + * Samples for ExpressRoutePorts GenerateLoa. + */ +public final class ExpressRoutePortsGenerateLoaSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/GenerateExpressRoutePortsLOA. + * json + */ + /** + * Sample code: GenerateExpressRoutePortLOA. + * + * @param manager Entry point to NetworkManager. + */ + public static void generateExpressRoutePortLOA(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts() + .generateLoaWithResponse("rg1", "portName", + new GenerateExpressRoutePortsLoaRequest().withCustomerName("customerName"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePorts_GetByResourceGroup + +```java +/** + * Samples for ExpressRoutePorts GetByResourceGroup. + */ +public final class ExpressRoutePortsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortGet.json + */ + /** + * Sample code: ExpressRoutePortGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().getByResourceGroupWithResponse("rg1", "portName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePorts_List + +```java +/** + * Samples for ExpressRoutePorts List. + */ +public final class ExpressRoutePortsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortList.json + */ + /** + * Sample code: ExpressRoutePortList. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePorts_ListByResourceGroup + +```java +/** + * Samples for ExpressRoutePorts ListByResourceGroup. + */ +public final class ExpressRoutePortsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortListByResourceGroup.json + */ + /** + * Sample code: ExpressRoutePortListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRoutePortListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePorts_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ExpressRoutePort; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRoutePorts UpdateTags. + */ +public final class ExpressRoutePortsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortUpdateTags. + * json + */ + /** + * Sample code: ExpressRoutePortUpdateTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRoutePort resource = manager.expressRoutePorts() + .getByResourceGroupWithResponse("rg1", "portName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ExpressRoutePortsLocations_Get + +```java +/** + * Samples for ExpressRoutePortsLocations Get. + */ +public final class ExpressRoutePortsLocationsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortsLocationGet. + * json + */ + /** + * Sample code: ExpressRoutePortsLocationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRoutePortsLocationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortsLocations().getWithResponse("locationName", com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRoutePortsLocations_List + +```java +/** + * Samples for ExpressRoutePortsLocations List. + */ +public final class ExpressRoutePortsLocationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortsLocationList + * .json + */ + /** + * Sample code: ExpressRoutePortsLocationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRoutePortsLocationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortsLocations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteProviderPortsLocation_List + +```java +/** + * Samples for ExpressRouteProviderPortsLocation List. + */ +public final class ExpressRouteProviderPortsLocationListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/expressRouteProviderPortList. + * json + */ + /** + * Sample code: ExpressRouteProviderPortList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteProviderPortList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteProviderPortsLocations().listWithResponse(null, com.azure.core.util.Context.NONE); + } +} +``` + +### ExpressRouteServiceProviders_List + +```java +/** + * Samples for ExpressRouteServiceProviders List. + */ +public final class ExpressRouteServiceProvidersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteProviderList.json + */ + /** + * Sample code: List ExpressRoute providers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listExpressRouteProviders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteServiceProviders().list(com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicies_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyCertificateAuthority; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionConfiguration; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProfileType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProtocol; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionSignatureSpecification; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionStateType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsResources; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsWorkspace; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySku; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySkuTier; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyTransportSecurity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicies CreateOrUpdate. + */ +public final class FirewallPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyPut.json + */ + /** + * Sample code: Create FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies() + .define("firewallPolicy") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withThreatIntelWhitelist( + new FirewallPolicyThreatIntelWhitelist().withIpAddresses(Arrays.asList("20.3.4.5")) + .withFqdns(Arrays.asList("*.microsoft.com"))) + .withInsights(new FirewallPolicyInsights().withIsEnabled(true) + .withRetentionDays(100) + .withLogAnalyticsResources(new FirewallPolicyLogAnalyticsResources().withWorkspaces(Arrays.asList( + new FirewallPolicyLogAnalyticsWorkspace().withRegion("westus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1")), + new FirewallPolicyLogAnalyticsWorkspace().withRegion("eastus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2")))) + .withDefaultWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace")))) + .withSnat(new FirewallPolicySnat().withPrivateRanges(Arrays.asList("IANAPrivateRanges"))) + .withSql(new FirewallPolicySql().withAllowSqlRedirect(true)) + .withDnsSettings(new DnsSettings().withServers(Arrays.asList("30.3.4.5")) + .withEnableProxy(true) + .withRequireProxyForNetworkRules(false)) + .withExplicitProxy(new ExplicitProxy().withEnableExplicitProxy(true) + .withHttpPort(8087) + .withHttpsPort(8087) + .withEnablePacFile(true) + .withPacFilePort(8087) + .withPacFile( + "https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D")) + .withIntrusionDetection( + new FirewallPolicyIntrusionDetection().withMode(FirewallPolicyIntrusionDetectionStateType.ALERT) + .withProfile(FirewallPolicyIntrusionDetectionProfileType.fromString("Balanced")) + .withConfiguration(new FirewallPolicyIntrusionDetectionConfiguration() + .withSignatureOverrides( + Arrays.asList(new FirewallPolicyIntrusionDetectionSignatureSpecification().withId("2525004") + .withMode(FirewallPolicyIntrusionDetectionStateType.DENY))) + .withBypassTrafficSettings(Arrays.asList( + new FirewallPolicyIntrusionDetectionBypassTrafficSpecifications().withName("bypassRule1") + .withDescription("Rule 1") + .withProtocol(FirewallPolicyIntrusionDetectionProtocol.TCP) + .withSourceAddresses(Arrays.asList("1.2.3.4")) + .withDestinationAddresses(Arrays.asList("5.6.7.8")) + .withDestinationPorts(Arrays.asList("*")))))) + .withTransportSecurity(new FirewallPolicyTransportSecurity().withCertificateAuthority( + new FirewallPolicyCertificateAuthority().withKeyVaultSecretId("fakeTokenPlaceholder") + .withName("clientcert"))) + .withSku(new FirewallPolicySku().withTier(FirewallPolicySkuTier.PREMIUM)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FirewallPolicies_Delete + +```java +/** + * Samples for FirewallPolicies Delete. + */ +public final class FirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDelete.json + */ + /** + * Sample code: Delete Firewall Policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies().delete("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicies_GetByResourceGroup + +```java +/** + * Samples for FirewallPolicies GetByResourceGroup. + */ +public final class FirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyGet.json + */ + /** + * Sample code: Get FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies() + .getByResourceGroupWithResponse("rg1", "firewallPolicy", null, com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicies_List + +```java +/** + * Samples for FirewallPolicies List. + */ +public final class FirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyListBySubscription.json + */ + /** + * Sample code: List all Firewall Policies for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPoliciesForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicies_ListByResourceGroup + +```java +/** + * Samples for FirewallPolicies ListByResourceGroup. + */ +public final class FirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyListByResourceGroup.json + */ + /** + * Sample code: List all Firewall Policies for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPoliciesForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicies_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.FirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicies UpdateTags. + */ +public final class FirewallPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyPatch.json + */ + /** + * Sample code: Update FirewallPolicy Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateFirewallPolicyTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + FirewallPolicy resource = manager.firewallPolicies() + .getByResourceGroupWithResponse("myResourceGroup", "firewallPolicy", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FirewallPolicyDeployments_Deploy + +```java +/** + * Samples for FirewallPolicyDeployments Deploy. + */ +public final class FirewallPolicyDeploymentsDeploySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftDeploy. + * json + */ + /** + * Sample code: deploy firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void deployFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDeployments().deploy("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyDrafts_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyDraftInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionConfiguration; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProfileType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProtocol; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionSignatureSpecification; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionStateType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsResources; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsWorkspace; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyDrafts CreateOrUpdate. + */ +public final class FirewallPolicyDraftsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftPut.json + */ + /** + * Sample code: create or update firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDrafts() + .createOrUpdateWithResponse("rg1", "firewallPolicy", new FirewallPolicyDraftInner() + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withThreatIntelWhitelist( + new FirewallPolicyThreatIntelWhitelist().withIpAddresses(Arrays.asList("20.3.4.5")) + .withFqdns(Arrays.asList("*.microsoft.com"))) + .withInsights(new FirewallPolicyInsights().withIsEnabled(true) + .withRetentionDays(100) + .withLogAnalyticsResources(new FirewallPolicyLogAnalyticsResources().withWorkspaces(Arrays.asList( + new FirewallPolicyLogAnalyticsWorkspace().withRegion("westus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1")), + new FirewallPolicyLogAnalyticsWorkspace().withRegion("eastus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2")))) + .withDefaultWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace")))) + .withSnat(new FirewallPolicySnat().withPrivateRanges(Arrays.asList("IANAPrivateRanges"))) + .withSql(new FirewallPolicySql().withAllowSqlRedirect(true)) + .withDnsSettings(new DnsSettings().withServers(Arrays.asList("30.3.4.5")) + .withEnableProxy(true) + .withRequireProxyForNetworkRules(false)) + .withExplicitProxy(new ExplicitProxy().withEnableExplicitProxy(true) + .withHttpPort(8087) + .withHttpsPort(8087) + .withEnablePacFile(true) + .withPacFilePort(8087) + .withPacFile( + "https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D")) + .withIntrusionDetection(new FirewallPolicyIntrusionDetection() + .withMode(FirewallPolicyIntrusionDetectionStateType.ALERT) + .withProfile(FirewallPolicyIntrusionDetectionProfileType.fromString("Balanced")) + .withConfiguration(new FirewallPolicyIntrusionDetectionConfiguration() + .withSignatureOverrides( + Arrays.asList(new FirewallPolicyIntrusionDetectionSignatureSpecification().withId("2525004") + .withMode(FirewallPolicyIntrusionDetectionStateType.DENY))) + .withBypassTrafficSettings(Arrays.asList( + new FirewallPolicyIntrusionDetectionBypassTrafficSpecifications().withName("bypassRule1") + .withDescription("Rule 1") + .withProtocol(FirewallPolicyIntrusionDetectionProtocol.TCP) + .withSourceAddresses(Arrays.asList("1.2.3.4")) + .withDestinationAddresses(Arrays.asList("5.6.7.8")) + .withDestinationPorts(Arrays.asList("*")))))), + com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyDrafts_Delete + +```java +/** + * Samples for FirewallPolicyDrafts Delete. + */ +public final class FirewallPolicyDraftsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftDelete. + * json + */ + /** + * Sample code: delete firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDrafts() + .deleteByResourceGroupWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyDrafts_Get + +```java +/** + * Samples for FirewallPolicyDrafts Get. + */ +public final class FirewallPolicyDraftsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftGet.json + */ + /** + * Sample code: get firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDrafts().getWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignatures_List + +```java +import com.azure.resourcemanager.network.generated.models.FilterItems; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsQuerySortOrder; +import com.azure.resourcemanager.network.generated.models.IdpsQueryObject; +import com.azure.resourcemanager.network.generated.models.OrderBy; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyIdpsSignatures List. + */ +public final class FirewallPolicyIdpsSignaturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyQuerySignatureOverrides.json + */ + /** + * Sample code: query signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void querySignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignatures() + .listWithResponse("rg1", "firewallPolicy", new IdpsQueryObject() + .withFilters(Arrays.asList(new FilterItems().withField("Mode").withValues(Arrays.asList("Deny")))) + .withSearch("") + .withOrderBy(new OrderBy().withField("severity").withOrder(FirewallPolicyIdpsQuerySortOrder.ASCENDING)) + .withResultsPerPage(20) + .withSkip(0), com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesFilterValues_List + +```java +import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesQuery; + +/** + * Samples for FirewallPolicyIdpsSignaturesFilterValues List. + */ +public final class FirewallPolicyIdpsSignaturesFilterValuesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyQuerySignatureOverridesFilterValues.json + */ + /** + * Sample code: query signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void querySignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesFilterValues() + .listWithResponse("rg1", "firewallPolicy", + new SignatureOverridesFilterValuesQuery().withFilterName("severity"), com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesOverrides_Get + +```java +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides Get. + */ +public final class FirewallPolicyIdpsSignaturesOverridesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesGet.json + */ + /** + * Sample code: get signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .getWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesOverrides_List + +```java +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides List. + */ +public final class FirewallPolicyIdpsSignaturesOverridesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesList.json + */ + /** + * Sample code: get signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .listWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyIdpsSignaturesOverrides_Patch + +```java +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides Patch. + */ +public final class FirewallPolicyIdpsSignaturesOverridesPatchSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesPatch.json + */ + /** + * Sample code: patch signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void patchSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .patchWithResponse("rg1", "firewallPolicy", new SignaturesOverridesInner().withName("default") + .withId( + "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default") + .withType("Microsoft.Network/firewallPolicies/signatureOverrides") + .withProperties( + new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FirewallPolicyIdpsSignaturesOverrides_Put + +```java +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides Put. + */ +public final class FirewallPolicyIdpsSignaturesOverridesPutSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesPut.json + */ + /** + * Sample code: put signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void putSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .putWithResponse("rg1", "firewallPolicy", new SignaturesOverridesInner().withName("default") + .withId( + "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default") + .withType("Microsoft.Network/firewallPolicies/signatureOverrides") + .withProperties( + new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FirewallPolicyRuleCollectionGroupDrafts_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionAction; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionActionType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleNetworkProtocol; +import com.azure.resourcemanager.network.generated.models.NetworkRule; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyRuleCollectionGroupDrafts CreateOrUpdate. + */ +public final class FirewallPolicyRuleCollectionGroupDraftsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDraftPut.json + */ + /** + * Sample code: create or update rule collection group draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateRuleCollectionGroupDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroupDrafts() + .createOrUpdateWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", + new FirewallPolicyRuleCollectionGroupDraftInner().withPriority(100) + .withRuleCollections(Arrays + .asList(new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withPriority(100) + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new NetworkRule().withName("network-rule1") + .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.1.25.0/24")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("*")))))), + com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyRuleCollectionGroupDrafts_Delete + +```java +/** + * Samples for FirewallPolicyRuleCollectionGroupDrafts Delete. + */ +public final class FirewallPolicyRuleCollectionGroupDraftsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDraftDelete.json + */ + /** + * Sample code: delete firewall rule collection group draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteFirewallRuleCollectionGroupDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroupDrafts() + .deleteWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyRuleCollectionGroupDrafts_Get + +```java +/** + * Samples for FirewallPolicyRuleCollectionGroupDrafts Get. + */ +public final class FirewallPolicyRuleCollectionGroupDraftsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDraftGet.json + */ + /** + * Sample code: get rule collection group draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRuleCollectionGroupDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroupDrafts() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyRuleCollectionGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ApplicationRule; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionAction; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionActionType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyHttpHeaderToInsert; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollectionAction; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollectionActionType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleApplicationProtocol; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleApplicationProtocolType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleNetworkProtocol; +import com.azure.resourcemanager.network.generated.models.NatRule; +import com.azure.resourcemanager.network.generated.models.NetworkRule; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate. + */ +public final class FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupPut.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(100) + .withRuleCollections( + Arrays.asList(new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withPriority(100) + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new NetworkRule().withName("network-rule1") + .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.1.25.0/24")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("*")))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group With Web Categories. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicyRuleCollectionGroupWithWebCategories( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(110) + .withRuleCollections( + Arrays.asList(new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new ApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new FirewallPolicyRuleApplicationProtocol() + .withProtocolType(FirewallPolicyRuleApplicationProtocolType.HTTPS) + .withPort(443))) + .withWebCategories(Arrays.asList("Hacking")))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyNatRuleCollectionGroupPut.json + */ + /** + * Sample code: Create Firewall Policy Nat Rule Collection Group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createFirewallPolicyNatRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(100) + .withRuleCollections( + Arrays.asList(new FirewallPolicyNatRuleCollection().withName("Example-Nat-Rule-Collection") + .withPriority(100) + .withAction(new FirewallPolicyNatRuleCollectionAction() + .withType(FirewallPolicyNatRuleCollectionActionType.DNAT)) + .withRules(Arrays.asList(new NatRule().withName("nat-rule1") + .withIpProtocols( + Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP, FirewallPolicyRuleNetworkProtocol.UDP)) + .withSourceAddresses(Arrays.asList("2.2.2.2")) + .withDestinationAddresses(Arrays.asList("152.23.32.23")) + .withDestinationPorts(Arrays.asList("8080")) + .withTranslatedPort("8080") + .withSourceIpGroups(Arrays.asList()) + .withTranslatedFqdn("internalhttp.server.net"))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group With IP Groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicyRuleCollectionGroupWithIPGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(110) + .withRuleCollections(Arrays.asList(new FirewallPolicyFilterRuleCollection() + .withName("Example-Filter-Rule-Collection") + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new NetworkRule().withName("network-1") + .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP)) + .withDestinationPorts(Arrays.asList("*")) + .withSourceIpGroups(Arrays.asList( + "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")) + .withDestinationIpGroups(Arrays.asList( + "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group With http header to insert. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(110) + .withRuleCollections( + Arrays + .asList( + new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.ALLOW)) + .withRules( + Arrays.asList(new ApplicationRule().withName("rule1") + .withDescription("Insert trusted tenants header") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new FirewallPolicyRuleApplicationProtocol() + .withProtocolType(FirewallPolicyRuleApplicationProtocolType.HTTP) + .withPort(80))) + .withFqdnTags(Arrays.asList("WindowsVirtualDesktop")) + .withHttpHeadersToInsert(Arrays.asList(new FirewallPolicyHttpHeaderToInsert() + .withHeaderName("Restrict-Access-To-Tenants") + .withHeaderValue("contoso.com,fabrikam.onmicrosoft.com"))))))) + .create(); + } +} +``` + +### FirewallPolicyRuleCollectionGroups_Delete + +```java +/** + * Samples for FirewallPolicyRuleCollectionGroups Delete. + */ +public final class FirewallPolicyRuleCollectionGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDelete.json + */ + /** + * Sample code: Delete FirewallPolicyRuleCollectionGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .delete("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyRuleCollectionGroups_Get + +```java +/** + * Samples for FirewallPolicyRuleCollectionGroups Get. + */ +public final class FirewallPolicyRuleCollectionGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyNatRuleCollectionGroupGet.json + */ + /** + * Sample code: Get FirewallPolicyNatRuleCollectionGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getFirewallPolicyNatRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithWebCategoriesGet.json + */ + /** + * Sample code: Get FirewallPolicyRuleCollectionGroup With Web Categories. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicyRuleCollectionGroupWithWebCategories( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupGet.json + */ + /** + * Sample code: Get FirewallPolicyRuleCollectionGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithIpGroupsGet.json + */ + /** + * Sample code: Get FirewallPolicyRuleCollectionGroup With IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicyRuleCollectionGroupWithIpGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleGroup1", com.azure.core.util.Context.NONE); + } +} +``` + +### FirewallPolicyRuleCollectionGroups_List + +```java +/** + * Samples for FirewallPolicyRuleCollectionGroups List. + */ +public final class FirewallPolicyRuleCollectionGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupList.json + */ + /** + * Sample code: List all FirewallPolicyRuleCollectionGroups for a given FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPolicyRuleCollectionGroupsForAGivenFirewallPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithIpGroupsList.json + */ + /** + * Sample code: List all FirewallPolicyRuleCollectionGroups with IpGroups for a given FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPolicyRuleCollectionGroupsWithIpGroupsForAGivenFirewallPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithWebCategoriesList.json + */ + /** + * Sample code: List all FirewallPolicyRuleCollectionGroup With Web Categories. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPolicyRuleCollectionGroupWithWebCategories( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### FlowLogs_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatType; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FlowLogs CreateOrUpdate. + */ +public final class FlowLogsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogCreate. + * json + */ + /** + * Sample code: Create or update flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs() + .define("fl") + .withRegion("centraluseuap") + .withExistingNetworkWatcher("rg1", "nw1") + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe") + .withEnabledFilteringCriteria("srcIP=158.255.7.8 || dstPort=56891") + .withEnabled(true) + .withFormat(new FlowLogFormatParameters().withType(FlowLogFormatType.JSON).withVersion(1)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FlowLogs_Delete + +```java +/** + * Samples for FlowLogs Delete. + */ +public final class FlowLogsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogDelete. + * json + */ + /** + * Sample code: Delete flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs().delete("rg1", "nw1", "fl", com.azure.core.util.Context.NONE); + } +} +``` + +### FlowLogs_Get + +```java +/** + * Samples for FlowLogs Get. + */ +public final class FlowLogsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogGet.json + */ + /** + * Sample code: Get flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs().getWithResponse("rg1", "nw1", "flowLog1", com.azure.core.util.Context.NONE); + } +} +``` + +### FlowLogs_List + +```java +/** + * Samples for FlowLogs List. + */ +public final class FlowLogsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogList. + * json + */ + /** + * Sample code: List connection monitors. + * + * @param manager Entry point to NetworkManager. + */ + public static void listConnectionMonitors(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs().list("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} +``` + +### FlowLogs_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.FlowLog; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FlowLogs UpdateTags. + */ +public final class FlowLogsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherFlowLogUpdateTags.json + */ + /** + * Sample code: Update flow log tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateFlowLogTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + FlowLog resource + = manager.flowLogs().getWithResponse("rg1", "nw", "fl", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### HubRouteTables_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.HubRoute; +import java.util.Arrays; + +/** + * Samples for HubRouteTables CreateOrUpdate. + */ +public final class HubRouteTablesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTablePut.json + */ + /** + * Sample code: RouteTablePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTablePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables() + .define("hubRouteTable1") + .withExistingVirtualHub("rg1", "virtualHub1") + .withRoutes(Arrays.asList(new HubRoute().withName("route1") + .withDestinationType("CIDR") + .withDestinations(Arrays.asList("10.0.0.0/8", "20.0.0.0/8", "30.0.0.0/8")) + .withNextHopType("ResourceId") + .withNextHop( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"))) + .withLabels(Arrays.asList("label1", "label2")) + .create(); + } +} +``` + +### HubRouteTables_Delete + +```java +/** + * Samples for HubRouteTables Delete. + */ +public final class HubRouteTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTableDelete.json + */ + /** + * Sample code: RouteTableDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables().delete("rg1", "virtualHub1", "hubRouteTable1", com.azure.core.util.Context.NONE); + } +} +``` + +### HubRouteTables_Get + +```java +/** + * Samples for HubRouteTables Get. + */ +public final class HubRouteTablesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTableGet.json + */ + /** + * Sample code: RouteTableGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables() + .getWithResponse("rg1", "virtualHub1", "hubRouteTable1", com.azure.core.util.Context.NONE); + } +} +``` + +### HubRouteTables_List + +```java +/** + * Samples for HubRouteTables List. + */ +public final class HubRouteTablesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTableList.json + */ + /** + * Sample code: RouteTableList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.StaticRoute; +import com.azure.resourcemanager.network.generated.models.StaticRoutesConfig; +import com.azure.resourcemanager.network.generated.models.VnetLocalRouteOverrideCriteria; +import com.azure.resourcemanager.network.generated.models.VnetRoute; +import java.util.Arrays; + +/** + * Samples for HubVirtualNetworkConnections CreateOrUpdate. + */ +public final class HubVirtualNetworkConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionPut.json + */ + /** + * Sample code: HubVirtualNetworkConnectionPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections() + .createOrUpdate("rg1", "virtualHub1", "connection1", new HubVirtualNetworkConnectionInner() + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1")) + .withEnableInternetSecurity(false) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")))) + .withVnetRoutes(new VnetRoute() + .withStaticRoutesConfig(new StaticRoutesConfig() + .withVnetLocalRouteOverrideCriteria(VnetLocalRouteOverrideCriteria.EQUAL)) + .withStaticRoutes(Arrays.asList( + new StaticRoute().withName("route1") + .withAddressPrefixes(Arrays.asList("10.1.0.0/16", "10.2.0.0/16")) + .withNextHopIpAddress("10.0.0.68"), + new StaticRoute().withName("route2") + .withAddressPrefixes(Arrays.asList("10.3.0.0/16", "10.4.0.0/16")) + .withNextHopIpAddress("10.0.0.65")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_Delete + +```java +/** + * Samples for HubVirtualNetworkConnections Delete. + */ +public final class HubVirtualNetworkConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionDelete.json + */ + /** + * Sample code: HubVirtualNetworkConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections() + .delete("rg1", "virtualHub1", "connection1", com.azure.core.util.Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_Get + +```java +/** + * Samples for HubVirtualNetworkConnections Get. + */ +public final class HubVirtualNetworkConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionGet.json + */ + /** + * Sample code: HubVirtualNetworkConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections() + .getWithResponse("rg1", "virtualHub1", "connection1", com.azure.core.util.Context.NONE); + } +} +``` + +### HubVirtualNetworkConnections_List + +```java +/** + * Samples for HubVirtualNetworkConnections List. + */ +public final class HubVirtualNetworkConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionList.json + */ + /** + * Sample code: HubVirtualNetworkConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} +``` + +### InboundNatRules_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; + +/** + * Samples for InboundNatRules CreateOrUpdate. + */ +public final class InboundNatRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleCreate.json + */ + /** + * Sample code: InboundNatRuleCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules() + .define("natRule1.1") + .withExistingLoadBalancer("testrg", "lb1") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3390) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(4) + .withEnableFloatingIp(false) + .withEnableTcpReset(false) + .create(); + } +} +``` + +### InboundNatRules_Delete + +```java +/** + * Samples for InboundNatRules Delete. + */ +public final class InboundNatRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleDelete.json + */ + /** + * Sample code: InboundNatRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules().delete("testrg", "lb1", "natRule1.1", com.azure.core.util.Context.NONE); + } +} +``` + +### InboundNatRules_Get + +```java +/** + * Samples for InboundNatRules Get. + */ +public final class InboundNatRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleGet.json + */ + /** + * Sample code: InboundNatRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules() + .getWithResponse("testrg", "lb1", "natRule1.1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### InboundNatRules_List + +```java +/** + * Samples for InboundNatRules List. + */ +public final class InboundNatRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleList.json + */ + /** + * Sample code: InboundNatRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules().list("testrg", "lb1", com.azure.core.util.Context.NONE); + } +} +``` + +### InboundSecurityRuleOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleType; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRulesProtocol; +import java.util.Arrays; + +/** + * Samples for InboundSecurityRuleOperation CreateOrUpdate. + */ +public final class InboundSecurityRuleOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundSecurityRulePut.json + */ + /** + * Sample code: Create Network Virtual Appliance Inbound Security Rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkVirtualApplianceInboundSecurityRules( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundSecurityRuleOperations() + .define("rule1") + .withExistingNetworkVirtualAppliance("rg1", "nva") + .withRuleType(InboundSecurityRuleType.PERMANENT) + .withRules(Arrays.asList(new InboundSecurityRules().withName("inboundRule1") + .withProtocol(InboundSecurityRulesProtocol.TCP) + .withSourceAddressPrefix("50.20.121.5/32") + .withDestinationPortRange(22) + .withDestinationPortRanges(Arrays.asList("80-100")) + .withAppliesOn(Arrays.asList("slbip1")))) + .create(); + } +} +``` + +### InboundSecurityRuleOperation_Get + +```java +/** + * Samples for InboundSecurityRuleOperation Get. + */ +public final class InboundSecurityRuleOperationGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundSecurityRuleGet.json + */ + /** + * Sample code: Create Network Virtual Appliance Inbound Security Rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkVirtualApplianceInboundSecurityRules( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundSecurityRuleOperations() + .getWithResponse("rg1", "nva", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpAllocations_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpAllocations CreateOrUpdate. + */ +public final class IpAllocationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationCreate.json + */ + /** + * Sample code: Create IpAllocation. + * + * @param manager Entry point to NetworkManager. + */ + public static void createIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations() + .define("test-ipallocation") + .withRegion("centraluseuap") + .withExistingResourceGroup("rg1") + .withTypePropertiesType(IpAllocationType.HYPERNET) + .withPrefix("3.2.5.0/24") + .withAllocationTags(mapOf("VNetID", + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### IpAllocations_Delete + +```java +/** + * Samples for IpAllocations Delete. + */ +public final class IpAllocationsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationDelete.json + */ + /** + * Sample code: Delete IpAllocation. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations().delete("rg1", "test-ipallocation", com.azure.core.util.Context.NONE); + } +} +``` + +### IpAllocations_GetByResourceGroup + +```java +/** + * Samples for IpAllocations GetByResourceGroup. + */ +public final class IpAllocationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationGet.json + */ + /** + * Sample code: Get IpAllocation. + * + * @param manager Entry point to NetworkManager. + */ + public static void getIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations() + .getByResourceGroupWithResponse("rg1", "test-ipallocation", null, com.azure.core.util.Context.NONE); + } +} +``` + +### IpAllocations_List + +```java +/** + * Samples for IpAllocations List. + */ +public final class IpAllocationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationList.json + */ + /** + * Sample code: List all IpAllocations. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllIpAllocations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IpAllocations_ListByResourceGroup + +```java +/** + * Samples for IpAllocations ListByResourceGroup. + */ +public final class IpAllocationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * IpAllocationListByResourceGroup.json + */ + /** + * Sample code: List IpAllocations in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listIpAllocationsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpAllocations_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.IpAllocation; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpAllocations UpdateTags. + */ +public final class IpAllocationsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationUpdateTags.json + */ + /** + * Sample code: Update virtual network tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + IpAllocation resource = manager.ipAllocations() + .getByResourceGroupWithResponse("rg1", "test-ipallocation", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### IpGroups_CreateOrUpdate + +```java +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpGroups CreateOrUpdate. + */ +public final class IpGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsCreate.json + */ + /** + * Sample code: CreateOrUpdate_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups() + .define("ipGroups1") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIpAddresses(Arrays.asList("13.64.39.16/32", "40.74.146.80/31", "40.74.147.32/28")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### IpGroups_Delete + +```java +/** + * Samples for IpGroups Delete. + */ +public final class IpGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsDelete.json + */ + /** + * Sample code: Delete_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups().delete("myResourceGroup", "ipGroups1", com.azure.core.util.Context.NONE); + } +} +``` + +### IpGroups_GetByResourceGroup + +```java +/** + * Samples for IpGroups GetByResourceGroup. + */ +public final class IpGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsGet.json + */ + /** + * Sample code: Get_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void getIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups() + .getByResourceGroupWithResponse("myResourceGroup", "ipGroups1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### IpGroups_List + +```java +/** + * Samples for IpGroups List. + */ +public final class IpGroupsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsListBySubscription. + * json + */ + /** + * Sample code: List_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void listIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### IpGroups_ListByResourceGroup + +```java +/** + * Samples for IpGroups ListByResourceGroup. + */ +public final class IpGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsListByResourceGroup. + * json + */ + /** + * Sample code: ListByResourceGroup_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void listByResourceGroupIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### IpGroups_UpdateGroups + +```java +import com.azure.resourcemanager.network.generated.models.IpGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpGroups UpdateGroups. + */ +public final class IpGroupsUpdateGroupsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsUpdateTags.json + */ + /** + * Sample code: Update_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + IpGroup resource = manager.ipGroups() + .getByResourceGroupWithResponse("myResourceGroup", "ipGroups1", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LoadBalancerBackendAddressPools_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import java.util.Arrays; + +/** + * Samples for LoadBalancerBackendAddressPools CreateOrUpdate. + */ +public final class LoadBalancerBackendAddressPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LBBackendAddressPoolWithBackendAddressesPut.json + */ + /** + * Sample code: Update load balancer backend pool with backend addresses containing virtual network and IP address. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateLoadBalancerBackendPoolWithBackendAddressesContainingVirtualNetworkAndIPAddress( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + BackendAddressPool resource = manager.loadBalancerBackendAddressPools() + .getWithResponse("testrg", "lb", "backend", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withLoadBalancerBackendAddresses(Arrays.asList( + new LoadBalancerBackendAddress().withName("address1") + .withVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb")) + .withIpAddress("10.0.0.4"), + new LoadBalancerBackendAddress().withName("address2") + .withVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb")) + .withIpAddress("10.0.0.5"))) + .apply(); + } +} +``` + +### LoadBalancerBackendAddressPools_Delete + +```java +/** + * Samples for LoadBalancerBackendAddressPools Delete. + */ +public final class LoadBalancerBackendAddressPoolsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerBackendAddressPoolDelete.json + */ + /** + * Sample code: BackendAddressPoolDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void backendAddressPoolDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools().delete("testrg", "lb", "backend", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerBackendAddressPools_Get + +```java +/** + * Samples for LoadBalancerBackendAddressPools Get. + */ +public final class LoadBalancerBackendAddressPoolsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerBackendAddressPoolGet.json + */ + /** + * Sample code: LoadBalancerBackendAddressPoolGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerBackendAddressPoolGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools() + .getWithResponse("testrg", "lb", "backend", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LBBackendAddressPoolWithBackendAddressesGet.json + */ + /** + * Sample code: LoadBalancer with BackendAddressPool with BackendAddresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerWithBackendAddressPoolWithBackendAddresses( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools() + .getWithResponse("testrg", "lb", "backend", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerBackendAddressPools_List + +```java +/** + * Samples for LoadBalancerBackendAddressPools List. + */ +public final class LoadBalancerBackendAddressPoolsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LBBackendAddressPoolListWithBackendAddressesPoolType.json + */ + /** + * Sample code: Load balancer with BackendAddressPool containing BackendAddresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerWithBackendAddressPoolContainingBackendAddresses( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools().list("testrg", "lb", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerBackendAddressPoolList.json + */ + /** + * Sample code: LoadBalancerBackendAddressPoolList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerBackendAddressPoolList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerFrontendIpConfigurations_Get + +```java +/** + * Samples for LoadBalancerFrontendIpConfigurations Get. + */ +public final class LoadBalancerFrontendIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerFrontendIPConfigurationGet.json + */ + /** + * Sample code: LoadBalancerFrontendIPConfigurationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerFrontendIPConfigurationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerFrontendIpConfigurations() + .getWithResponse("testrg", "lb", "frontend", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerFrontendIpConfigurations_List + +```java +/** + * Samples for LoadBalancerFrontendIpConfigurations List. + */ +public final class LoadBalancerFrontendIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerFrontendIPConfigurationList.json + */ + /** + * Sample code: LoadBalancerFrontendIPConfigurationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerFrontendIPConfigurationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerFrontendIpConfigurations().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerLoadBalancingRules_Get + +```java +/** + * Samples for LoadBalancerLoadBalancingRules Get. + */ +public final class LoadBalancerLoadBalancingRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerLoadBalancingRuleGet.json + */ + /** + * Sample code: LoadBalancerLoadBalancingRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerLoadBalancingRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerLoadBalancingRules() + .getWithResponse("testrg", "lb1", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerLoadBalancingRules_List + +```java +/** + * Samples for LoadBalancerLoadBalancingRules List. + */ +public final class LoadBalancerLoadBalancingRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerLoadBalancingRuleList.json + */ + /** + * Sample code: LoadBalancerLoadBalancingRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerLoadBalancingRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerLoadBalancingRules().list("testrg", "lb1", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerNetworkInterfaces_List + +```java +/** + * Samples for LoadBalancerNetworkInterfaces List. + */ +public final class LoadBalancerNetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerNetworkInterfaceListVmss.json + */ + /** + * Sample code: LoadBalancerNetworkInterfaceListVmss. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerNetworkInterfaceListVmss(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerNetworkInterfaces().list("testrg", "lb", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerNetworkInterfaceListSimple.json + */ + /** + * Sample code: LoadBalancerNetworkInterfaceListSimple. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerNetworkInterfaceListSimple(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerNetworkInterfaces().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerOutboundRules_Get + +```java +/** + * Samples for LoadBalancerOutboundRules Get. + */ +public final class LoadBalancerOutboundRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerOutboundRuleGet. + * json + */ + /** + * Sample code: LoadBalancerOutboundRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerOutboundRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerOutboundRules().getWithResponse("testrg", "lb1", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerOutboundRules_List + +```java +/** + * Samples for LoadBalancerOutboundRules List. + */ +public final class LoadBalancerOutboundRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerOutboundRuleList. + * json + */ + /** + * Sample code: LoadBalancerOutboundRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerOutboundRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerOutboundRules().list("testrg", "lb1", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerProbes_Get + +```java +/** + * Samples for LoadBalancerProbes Get. + */ +public final class LoadBalancerProbesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerProbeGet.json + */ + /** + * Sample code: LoadBalancerProbeGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerProbeGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerProbes().getWithResponse("testrg", "lb", "probe1", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancerProbes_List + +```java +/** + * Samples for LoadBalancerProbes List. + */ +public final class LoadBalancerProbesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerProbeList.json + */ + /** + * Sample code: LoadBalancerProbeList. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerProbeList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerProbes().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +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.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.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterfaceType; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelProtocol; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSkuName; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSkuTier; +import com.azure.resourcemanager.network.generated.models.LoadDistribution; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.SyncMode; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import java.util.Arrays; + +/** + * Samples for LoadBalancers CreateOrUpdate. + */ +public final class LoadBalancersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateWithSyncModePropertyOnPool.json + */ + /** + * Sample code: Create load balancer with Sync Mode Property on Pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithSyncModePropertyOnPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb") + .withVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb")) + .withSyncMode(SyncMode.AUTOMATIC))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json + */ + /** + * Sample code: Create load balancer with Gateway Load Balancer Provider configured with two Backend Pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.GATEWAY)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb1"), + new BackendAddressPoolInner().withName("be-lb2"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource()) + .withBackendAddressPools(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"))) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.ALL) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(0) + .withBackendPort(0) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateWithInboundNatPool.json + */ + /** + * Sample code: Create load balancer with inbound nat pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithInboundNatPool(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test") + .withName("test") + .withZones(Arrays.asList()) + .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet")))) + .withBackendAddressPools(Arrays.asList()) + .withLoadBalancingRules(Arrays.asList()) + .withProbes(Arrays.asList()) + .withInboundNatRules(Arrays.asList()) + .withInboundNatPools(Arrays.asList(new InboundNatPool().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test") + .withName("test") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPortRangeStart(8080) + .withFrontendPortRangeEnd(8085) + .withBackendPort(8888) + .withIdleTimeoutInMinutes(10) + .withEnableFloatingIp(true) + .withEnableTcpReset(true))) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreateWithZones. + * json + */ + /** + * Sample code: Create load balancer with Frontend IP in Zone 1. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithFrontendIPInZone1(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withZones(Arrays.asList("1")) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateWithOutboundRules.json + */ + /** + * Sample code: Create load balancer with outbound rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithOutboundRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withPublicIpAddress(new PublicIpAddressInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true) + .withDisableOutboundSnat(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList(new OutboundRuleInner().withName("rule1") + .withFrontendIpConfigurations(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProtocol(LoadBalancerOutboundRuleProtocol.ALL))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json + */ + /** + * Sample code: Create load balancer with Gateway Load Balancer Provider configured with one Backend Pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.GATEWAY)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb") + .withTunnelInterfaces(Arrays.asList( + new GatewayLoadBalancerTunnelInterface().withPort(15000) + .withIdentifier(900) + .withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN) + .withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL), + new GatewayLoadBalancerTunnelInterface().withPort(15001) + .withIdentifier(901) + .withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN) + .withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL))))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPools(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.ALL) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(0) + .withBackendPort(0) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreate.json + */ + /** + * Sample code: Create load balancer. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true) + .withEnableTcpReset(false))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true) + .withEnableTcpReset(false))) + .withInboundNatPools(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreateGlobalTier. + * json + */ + /** + * Sample code: Create load balancer with Global Tier and one regional load balancer in its backend pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD).withTier(LoadBalancerSkuTier.GLOBAL)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb") + .withLoadBalancerBackendAddresses(Arrays.asList(new LoadBalancerBackendAddress() + .withName("regional-lb1-address") + .withLoadBalancerFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb")))))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(false))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateGatewayLoadBalancerConsumer.json + */ + /** + * Sample code: Create load balancer with Gateway Load Balancer Consumer configured. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGatewayLoadBalancerConsumerConfigured( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")) + .withGatewayLoadBalancer(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreateStandardSku + * .json + */ + /** + * Sample code: Create load balancer with Standard SKU. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithStandardSKU(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } +} +``` + +### LoadBalancers_Delete + +```java +/** + * Samples for LoadBalancers Delete. + */ +public final class LoadBalancersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerDelete.json + */ + /** + * Sample code: Delete load balancer. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().delete("rg1", "lb", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_GetByResourceGroup + +```java +/** + * Samples for LoadBalancers GetByResourceGroup. + */ +public final class LoadBalancersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerGet.json + */ + /** + * Sample code: Get load balancer. + * + * @param manager Entry point to NetworkManager. + */ + public static void getLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().getByResourceGroupWithResponse("rg1", "lb", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerGetInboundNatRulePortMapping.json + */ + /** + * Sample code: Get load balancer with inbound NAT rule port mapping. + * + * @param manager Entry point to NetworkManager. + */ + public static void getLoadBalancerWithInboundNATRulePortMapping( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().getByResourceGroupWithResponse("rg1", "lb", null, com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_List + +```java +/** + * Samples for LoadBalancers List. + */ +public final class LoadBalancersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerListAll.json + */ + /** + * Sample code: List all load balancers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllLoadBalancers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_ListByResourceGroup + +```java +/** + * Samples for LoadBalancers ListByResourceGroup. + */ +public final class LoadBalancersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerList.json + */ + /** + * Sample code: List load balancers in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listLoadBalancersInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_ListInboundNatRulePortMappings + +```java +import com.azure.resourcemanager.network.generated.models.QueryInboundNatRulePortMappingRequest; + +/** + * Samples for LoadBalancers ListInboundNatRulePortMappings. + */ +public final class LoadBalancersListInboundNatRulePortMappingsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * QueryInboundNatRulePortMapping.json + */ + /** + * Sample code: Query inbound NAT rule port mapping. + * + * @param manager Entry point to NetworkManager. + */ + public static void + queryInboundNATRulePortMapping(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .listInboundNatRulePortMappings("rg1", "lb1", "bp1", + new QueryInboundNatRulePortMappingRequest().withIpAddress("10.0.0.4"), + com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_MigrateToIpBased + +```java +import com.azure.resourcemanager.network.generated.models.MigrateLoadBalancerToIpBasedRequest; +import java.util.Arrays; + +/** + * Samples for LoadBalancers MigrateToIpBased. + */ +public final class LoadBalancersMigrateToIpBasedSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/MigrateLoadBalancerToIPBased. + * json + */ + /** + * Sample code: Migrate load balancer to IP Based. + * + * @param manager Entry point to NetworkManager. + */ + public static void + migrateLoadBalancerToIPBased(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .migrateToIpBasedWithResponse("rg1", "lb1", + new MigrateLoadBalancerToIpBasedRequest().withPools(Arrays.asList("pool1", "pool2")), + com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_SwapPublicIpAddresses + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequestFrontendIpConfiguration; +import java.util.Arrays; + +/** + * Samples for LoadBalancers SwapPublicIpAddresses. + */ +public final class LoadBalancersSwapPublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancersSwapPublicIpAddresses.json + */ + /** + * Sample code: Swap VIPs between two load balancers. + * + * @param manager Entry point to NetworkManager. + */ + public static void + swapVIPsBetweenTwoLoadBalancers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .swapPublicIpAddresses("westus", new LoadBalancerVipSwapRequest().withFrontendIpConfigurations( + Arrays.asList(new LoadBalancerVipSwapRequestFrontendIpConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfe1") + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/pip2")), + new LoadBalancerVipSwapRequestFrontendIpConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb2/frontendIPConfigurations/lbfe2") + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### LoadBalancers_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.LoadBalancer; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LoadBalancers UpdateTags. + */ +public final class LoadBalancersUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerUpdateTags.json + */ + /** + * Sample code: Update load balancer tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateLoadBalancerTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + LoadBalancer resource = manager.loadBalancers() + .getByResourceGroupWithResponse("rg1", "lb", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LocalNetworkGateways_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import java.util.Arrays; + +/** + * Samples for LocalNetworkGateways CreateOrUpdate. + */ +public final class LocalNetworkGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayCreate. + * json + */ + /** + * Sample code: CreateLocalNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways() + .define("localgw") + .withRegion("Central US") + .withExistingResourceGroup("rg1") + .withLocalNetworkAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.1.0.0/16"))) + .withGatewayIpAddress("11.12.13.14") + .withFqdn("site1.contoso.com") + .create(); + } +} +``` + +### LocalNetworkGateways_Delete + +```java +/** + * Samples for LocalNetworkGateways Delete. + */ +public final class LocalNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayDelete. + * json + */ + /** + * Sample code: DeleteLocalNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways().delete("rg1", "localgw", com.azure.core.util.Context.NONE); + } +} +``` + +### LocalNetworkGateways_GetByResourceGroup + +```java +/** + * Samples for LocalNetworkGateways GetByResourceGroup. + */ +public final class LocalNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayGet.json + */ + /** + * Sample code: GetLocalNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways() + .getByResourceGroupWithResponse("rg1", "localgw", com.azure.core.util.Context.NONE); + } +} +``` + +### LocalNetworkGateways_ListByResourceGroup + +```java +/** + * Samples for LocalNetworkGateways ListByResourceGroup. + */ +public final class LocalNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayList.json + */ + /** + * Sample code: ListLocalNetworkGateways. + * + * @param manager Entry point to NetworkManager. + */ + public static void listLocalNetworkGateways(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### LocalNetworkGateways_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LocalNetworkGateways UpdateTags. + */ +public final class LocalNetworkGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayUpdateTags + * .json + */ + /** + * Sample code: UpdateLocalNetworkGatewayTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateLocalNetworkGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + LocalNetworkGateway resource = manager.localNetworkGateways() + .getByResourceGroupWithResponse("rg1", "lgw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagementGroupNetworkManagerConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; + +/** + * Samples for ManagementGroupNetworkManagerConnections CreateOrUpdate. + */ +public final class ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupPut.json + */ + /** + * Sample code: Create or Update Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateManagementGroupNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .createOrUpdateWithResponse("managementGroupA", "TestNMConnection", + new NetworkManagerConnectionInner().withNetworkManagerId( + "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagementGroupNetworkManagerConnections_Delete + +```java +/** + * Samples for ManagementGroupNetworkManagerConnections Delete. + */ +public final class ManagementGroupNetworkManagerConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupDelete.json + */ + /** + * Sample code: Delete Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteManagementGroupNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .deleteByResourceGroupWithResponse("managementGroupA", "TestNMConnection", + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagementGroupNetworkManagerConnections_Get + +```java +/** + * Samples for ManagementGroupNetworkManagerConnections Get. + */ +public final class ManagementGroupNetworkManagerConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupGet.json + */ + /** + * Sample code: Get Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getManagementGroupNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .getWithResponse("managementGroupA", "TestNMConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagementGroupNetworkManagerConnections_List + +```java +/** + * Samples for ManagementGroupNetworkManagerConnections List. + */ +public final class ManagementGroupNetworkManagerConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupList.json + */ + /** + * Sample code: List Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void listManagementGroupNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .list("managementGroupA", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### NatGateways_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.NatGatewaySkuName; +import java.util.Arrays; + +/** + * Samples for NatGateways CreateOrUpdate. + */ +public final class NatGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayCreateOrUpdate.json + */ + /** + * Sample code: Create nat gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways() + .define("test-natgateway") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new NatGatewaySku().withName(NatGatewaySkuName.STANDARD)) + .withPublicIpAddresses(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"))) + .withPublicIpPrefixes(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"))) + .create(); + } +} +``` + +### NatGateways_Delete + +```java +/** + * Samples for NatGateways Delete. + */ +public final class NatGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayDelete.json + */ + /** + * Sample code: Delete nat gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways().delete("rg1", "test-natGateway", com.azure.core.util.Context.NONE); + } +} +``` + +### NatGateways_GetByResourceGroup + +```java +/** + * Samples for NatGateways GetByResourceGroup. + */ +public final class NatGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayGet.json + */ + /** + * Sample code: Get nat gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways() + .getByResourceGroupWithResponse("rg1", "test-natGateway", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NatGateways_List + +```java +/** + * Samples for NatGateways List. + */ +public final class NatGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayListAll.json + */ + /** + * Sample code: List all nat gateways. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNatGateways(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NatGateways_ListByResourceGroup + +```java +/** + * Samples for NatGateways ListByResourceGroup. + */ +public final class NatGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayList.json + */ + /** + * Sample code: List nat gateways in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNatGatewaysInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### NatGateways_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.NatGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NatGateways UpdateTags. + */ +public final class NatGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayUpdateTags.json + */ + /** + * Sample code: Update nat gateway tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNatGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NatGateway resource = manager.natGateways() + .getByResourceGroupWithResponse("rg1", "test-natGateway", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NatRules_CreateOrUpdate + +```java +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.Arrays; + +/** + * Samples for NatRules CreateOrUpdate. + */ +public final class NatRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRulePut.json + */ + /** + * Sample code: NatRulePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRulePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules() + .define("natRule1") + .withExistingVpnGateway("rg1", "gateway1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.4.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.21.0/24"))) + .withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default") + .create(); + } +} +``` + +### NatRules_Delete + +```java +/** + * Samples for NatRules Delete. + */ +public final class NatRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRuleDelete.json + */ + /** + * Sample code: NatRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules().delete("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} +``` + +### NatRules_Get + +```java +/** + * Samples for NatRules Get. + */ +public final class NatRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRuleGet.json + */ + /** + * Sample code: NatRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules().getWithResponse("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} +``` + +### NatRules_ListByVpnGateway + +```java +/** + * Samples for NatRules ListByVpnGateway. + */ +public final class NatRulesListByVpnGatewaySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRuleList.json + */ + /** + * Sample code: NatRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules().listByVpnGateway("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.GroupMemberType; + +/** + * Samples for NetworkGroups CreateOrUpdate. + */ +public final class NetworkGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupPut.json + */ + /** + * Sample code: NetworkGroupsPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups() + .define("testNetworkGroup") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample group") + .withMemberType(GroupMemberType.VIRTUAL_NETWORK) + .create(); + } +} +``` + +### NetworkGroups_Delete + +```java +/** + * Samples for NetworkGroups Delete. + */ +public final class NetworkGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupDelete. + * json + */ + /** + * Sample code: NetworkGroupsDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups() + .delete("rg1", "testNetworkManager", "testNetworkGroup", false, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkGroups_Get + +```java +/** + * Samples for NetworkGroups Get. + */ +public final class NetworkGroupsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupGet.json + */ + /** + * Sample code: NetworkGroupsGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups() + .getWithResponse("rg1", "testNetworkManager", "testNetworkGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkGroups_List + +```java +/** + * Samples for NetworkGroups List. + */ +public final class NetworkGroupsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupList.json + */ + /** + * Sample code: NetworkGroupsList. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups().list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaceIpConfigurations_Get + +```java +/** + * Samples for NetworkInterfaceIpConfigurations Get. + */ +public final class NetworkInterfaceIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceIPConfigurationGet.json + */ + /** + * Sample code: NetworkInterfaceIPConfigurationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkInterfaceIPConfigurationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceIpConfigurations() + .getWithResponse("testrg", "mynic", "ipconfig1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaceIpConfigurations_List + +```java +/** + * Samples for NetworkInterfaceIpConfigurations List. + */ +public final class NetworkInterfaceIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceIPConfigurationList.json + */ + /** + * Sample code: NetworkInterfaceIPConfigurationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkInterfaceIPConfigurationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceIpConfigurations().list("testrg", "nic1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaceLoadBalancers_List + +```java +/** + * Samples for NetworkInterfaceLoadBalancers List. + */ +public final class NetworkInterfaceLoadBalancersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceLoadBalancerList.json + */ + /** + * Sample code: NetworkInterfaceLoadBalancerList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkInterfaceLoadBalancerList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceLoadBalancers().list("testrg", "nic1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaceTapConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; + +/** + * Samples for NetworkInterfaceTapConfigurations CreateOrUpdate. + */ +public final class NetworkInterfaceTapConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationCreate.json + */ + /** + * Sample code: Create Network Interface Tap Configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkInterfaceTapConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations() + .define("tapconfiguration1") + .withExistingNetworkInterface("testrg", "mynic") + .withVirtualNetworkTap(new VirtualNetworkTapInner().withId( + "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap")) + .create(); + } +} +``` + +### NetworkInterfaceTapConfigurations_Delete + +```java +/** + * Samples for NetworkInterfaceTapConfigurations Delete. + */ +public final class NetworkInterfaceTapConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationDelete.json + */ + /** + * Sample code: Delete tap configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteTapConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations() + .delete("testrg", "mynic", "tapconfiguration1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaceTapConfigurations_Get + +```java +/** + * Samples for NetworkInterfaceTapConfigurations Get. + */ +public final class NetworkInterfaceTapConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationGet.json + */ + /** + * Sample code: Get Network Interface Tap Configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getNetworkInterfaceTapConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations() + .getWithResponse("testrg", "mynic", "tapconfiguration1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaceTapConfigurations_List + +```java +/** + * Samples for NetworkInterfaceTapConfigurations List. + */ +public final class NetworkInterfaceTapConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationList.json + */ + /** + * Sample code: List virtual network tap configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworkTapConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations().list("testrg", "mynic", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +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 java.util.Arrays; + +/** + * Samples for NetworkInterfaces CreateOrUpdate. + */ +public final class NetworkInterfacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceCreateGatewayLoadBalancerConsumer.json + */ + /** + * Sample code: Create network interface with Gateway Load Balancer Consumer configured. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkInterfaceWithGatewayLoadBalancerConsumerConfigured( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .define("test-nic") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new NetworkInterfaceIpConfigurationInner().withName("ipconfig1") + .withGatewayLoadBalancer(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider")) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default")) + .withPublicIpAddress(new PublicIpAddressInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip")))) + .withEnableAcceleratedNetworking(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceCreate.json + */ + /** + * Sample code: Create network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .define("test-nic") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new NetworkInterfaceIpConfigurationInner().withName("ipconfig1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default")) + .withPublicIpAddress(new PublicIpAddressInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip")), + new NetworkInterfaceIpConfigurationInner().withName("ipconfig2").withPrivateIpAddressPrefixLength(28))) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .create(); + } +} +``` + +### NetworkInterfaces_Delete + +```java +/** + * Samples for NetworkInterfaces Delete. + */ +public final class NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceDelete.json + */ + /** + * Sample code: Delete network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().delete("rg1", "test-nic", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_GetByResourceGroup + +```java +/** + * Samples for NetworkInterfaces GetByResourceGroup. + */ +public final class NetworkInterfacesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceGet.json + */ + /** + * Sample code: Get network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getByResourceGroupWithResponse("rg1", "test-nic", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_GetCloudServiceNetworkInterface + +```java +/** + * Samples for NetworkInterfaces GetCloudServiceNetworkInterface. + */ +public final class NetworkInterfacesGetCloudServiceNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceNetworkInterfaceGet.json + */ + /** + * Sample code: Get cloud service network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getCloudServiceNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getCloudServiceNetworkInterfaceWithResponse("rg1", "cs1", "TestVMRole_IN_0", "nic1", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_GetEffectiveRouteTable + +```java +/** + * Samples for NetworkInterfaces GetEffectiveRouteTable. + */ +public final class NetworkInterfacesGetEffectiveRouteTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceEffectiveRouteTableList.json + */ + /** + * Sample code: Show network interface effective route tables. + * + * @param manager Entry point to NetworkManager. + */ + public static void + showNetworkInterfaceEffectiveRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().getEffectiveRouteTable("rg1", "nic1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_GetVirtualMachineScaleSetIpConfiguration + +```java +/** + * Samples for NetworkInterfaces GetVirtualMachineScaleSetIpConfiguration. + */ +public final class NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VmssNetworkInterfaceIpConfigGet.json + */ + /** + * Sample code: Get virtual machine scale set network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualMachineScaleSetNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getVirtualMachineScaleSetIpConfigurationWithResponse("rg1", "vmss1", "2", "nic1", "ip1", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_GetVirtualMachineScaleSetNetworkInterface + +```java +/** + * Samples for NetworkInterfaces GetVirtualMachineScaleSetNetworkInterface. + */ +public final class NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssNetworkInterfaceGet.json + */ + /** + * Sample code: Get virtual machine scale set network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualMachineScaleSetNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getVirtualMachineScaleSetNetworkInterfaceWithResponse("rg1", "vmss1", "1", "nic1", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_List + +```java +/** + * Samples for NetworkInterfaces List. + */ +public final class NetworkInterfacesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceListAll.json + */ + /** + * Sample code: List all network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_ListByResourceGroup + +```java +/** + * Samples for NetworkInterfaces ListByResourceGroup. + */ +public final class NetworkInterfacesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceList.json + */ + /** + * Sample code: List network interfaces in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNetworkInterfacesInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_ListCloudServiceNetworkInterfaces + +```java +/** + * Samples for NetworkInterfaces ListCloudServiceNetworkInterfaces. + */ +public final class NetworkInterfacesListCloudServiceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceNetworkInterfaceList.json + */ + /** + * Sample code: List cloud service network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listCloudServiceNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().listCloudServiceNetworkInterfaces("rg1", "cs1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_ListCloudServiceRoleInstanceNetworkInterfaces + +```java +/** + * Samples for NetworkInterfaces ListCloudServiceRoleInstanceNetworkInterfaces. + */ +public final class NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceRoleInstanceNetworkInterfaceList.json + */ + /** + * Sample code: List cloud service role instance network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listCloudServiceRoleInstanceNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listCloudServiceRoleInstanceNetworkInterfaces("rg1", "cs1", "TestVMRole_IN_0", + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_ListEffectiveNetworkSecurityGroups + +```java +/** + * Samples for NetworkInterfaces ListEffectiveNetworkSecurityGroups. + */ +public final class NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceEffectiveNSGList.json + */ + /** + * Sample code: List network interface effective network security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkInterfaceEffectiveNetworkSecurityGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().listEffectiveNetworkSecurityGroups("rg1", "nic1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_ListVirtualMachineScaleSetIpConfigurations + +```java +/** + * Samples for NetworkInterfaces ListVirtualMachineScaleSetIpConfigurations. + */ +public final class NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VmssNetworkInterfaceIpConfigList.json + */ + /** + * Sample code: List virtual machine scale set network interface ip configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualMachineScaleSetNetworkInterfaceIpConfigurations( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listVirtualMachineScaleSetIpConfigurations("rg1", "vmss1", "2", "nic1", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_ListVirtualMachineScaleSetNetworkInterfaces + +```java +/** + * Samples for NetworkInterfaces ListVirtualMachineScaleSetNetworkInterfaces. + */ +public final class NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssNetworkInterfaceList.json + */ + /** + * Sample code: List virtual machine scale set network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualMachineScaleSetNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listVirtualMachineScaleSetNetworkInterfaces("rg1", "vmss1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_ListVirtualMachineScaleSetVMNetworkInterfaces + +```java +/** + * Samples for NetworkInterfaces ListVirtualMachineScaleSetVMNetworkInterfaces. + */ +public final class NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssVmNetworkInterfaceList. + * json + */ + /** + * Sample code: List virtual machine scale set vm network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualMachineScaleSetVmNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listVirtualMachineScaleSetVMNetworkInterfaces("rg1", "vmss1", "1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkInterfaces_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkInterfaces UpdateTags. + */ +public final class NetworkInterfacesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceUpdateTags. + * json + */ + /** + * Sample code: Update network interface tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNetworkInterfaceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkInterface resource = manager.networkInterfaces() + .getByResourceGroupWithResponse("rg1", "test-nic", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkManagerCommits_Post + +```java +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import java.util.Arrays; + +/** + * Samples for NetworkManagerCommits Post. + */ +public final class NetworkManagerCommitsPostSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerCommitPost.json + */ + /** + * Sample code: NetworkManageCommitPost. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManageCommitPost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerCommits() + .post("resoureGroupSample", "testNetworkManager", new NetworkManagerCommitInner() + .withTargetLocations(Arrays.asList("useast")) + .withConfigurationIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig")) + .withCommitType(ConfigurationType.SECURITY_ADMIN), com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagerDeploymentStatusOperation_List + +```java +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusParameter; +import java.util.Arrays; + +/** + * Samples for NetworkManagerDeploymentStatusOperation List. + */ +public final class NetworkManagerDeploymentStatusOperationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerDeploymentStatusList.json + */ + /** + * Sample code: NetworkManagerDeploymentStatusList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkManagerDeploymentStatusList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerDeploymentStatusOperations() + .listWithResponse("resoureGroupSample", "testNetworkManager", + new NetworkManagerDeploymentStatusParameter().withRegions(Arrays.asList("eastus", "westus")) + .withDeploymentTypes( + Arrays.asList(ConfigurationType.CONNECTIVITY, ConfigurationType.fromString("AdminPolicy"))) + .withSkipToken("fakeTokenPlaceholder"), + null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagerRoutingConfigurations_CreateOrUpdate + +```java +/** + * Samples for NetworkManagerRoutingConfigurations CreateOrUpdate. + */ +public final class NetworkManagerRoutingConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationPut.json + */ + /** + * Sample code: Create network manager routing configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkManagerRoutingConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .define("myTestRoutingConfig") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample policy") + .create(); + } +} +``` + +### NetworkManagerRoutingConfigurations_Delete + +```java +/** + * Samples for NetworkManagerRoutingConfigurations Delete. + */ +public final class NetworkManagerRoutingConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationDelete.json + */ + /** + * Sample code: Delete network manager routing configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkManagerRoutingConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .delete("rg1", "testNetworkManager", "myTestRoutingConfig", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagerRoutingConfigurations_Get + +```java +/** + * Samples for NetworkManagerRoutingConfigurations Get. + */ +public final class NetworkManagerRoutingConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationGet.json + */ + /** + * Sample code: Get routing configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRoutingConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .getWithResponse("rg1", "testNetworkManager", "myTestRoutingConfig", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagerRoutingConfigurations_List + +```java +/** + * Samples for NetworkManagerRoutingConfigurations List. + */ +public final class NetworkManagerRoutingConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationList.json + */ + /** + * Sample code: List routing configurations in a network manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listRoutingConfigurationsInANetworkManager(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagers_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManagerPropertiesNetworkManagerScopes; +import java.util.Arrays; + +/** + * Samples for NetworkManagers CreateOrUpdate. + */ +public final class NetworkManagersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerPut.json + */ + /** + * Sample code: Put Network Manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void putNetworkManager(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers() + .define("TestNetworkManager") + .withRegion((String) null) + .withExistingResourceGroup("rg1") + .withDescription("My Test Network Manager") + .withNetworkManagerScopes(new NetworkManagerPropertiesNetworkManagerScopes() + .withManagementGroups(Arrays.asList("/Microsoft.Management/testmg")) + .withSubscriptions(Arrays.asList("/subscriptions/00000000-0000-0000-0000-000000000000"))) + .withNetworkManagerScopeAccesses(Arrays.asList(ConfigurationType.CONNECTIVITY)) + .create(); + } +} +``` + +### NetworkManagers_Delete + +```java +/** + * Samples for NetworkManagers Delete. + */ +public final class NetworkManagersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerDelete.json + */ + /** + * Sample code: NetworkManagersDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagersDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers().delete("rg1", "testNetworkManager", false, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagers_GetByResourceGroup + +```java +/** + * Samples for NetworkManagers GetByResourceGroup. + */ +public final class NetworkManagersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGet.json + */ + /** + * Sample code: NetworkManagersGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagersGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers() + .getByResourceGroupWithResponse("rg1", "testNetworkManager", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagers_List + +```java +/** + * Samples for NetworkManagers List. + */ +public final class NetworkManagersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerListAll.json + */ + /** + * Sample code: NetworkManagersList. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagersList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers().list(null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagers_ListByResourceGroup + +```java +/** + * Samples for NetworkManagers ListByResourceGroup. + */ +public final class NetworkManagersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerList.json + */ + /** + * Sample code: List Network Manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkManager(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers().listByResourceGroup("rg1", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkManagers_Patch + +```java +import com.azure.resourcemanager.network.generated.models.NetworkManager; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkManagers Patch. + */ +public final class NetworkManagersPatchSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerPatch.json + */ + /** + * Sample code: NetworkManagesPatch. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagesPatch(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkManager resource = manager.networkManagers() + .getByResourceGroupWithResponse("rg1", "testNetworkManager", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkProfiles_CreateOrUpdate + +```java +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.ContainerNetworkInterfaceConfiguration; +import java.util.Arrays; + +/** + * Samples for NetworkProfiles CreateOrUpdate. + */ +public final class NetworkProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkProfileCreateConfigOnly.json + */ + /** + * Sample code: Create network profile defaults. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkProfileDefaults(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles() + .define("networkProfile1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withContainerNetworkInterfaceConfigurations(Arrays.asList(new ContainerNetworkInterfaceConfiguration() + .withName("eth1") + .withIpConfigurations(Arrays.asList(new IpConfigurationProfileInner().withName("ipconfig1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1")))))) + .create(); + } +} +``` + +### NetworkProfiles_Delete + +```java +/** + * Samples for NetworkProfiles Delete. + */ +public final class NetworkProfilesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileDelete.json + */ + /** + * Sample code: Delete network profile. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles().delete("rg1", "networkProfile1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkProfiles_GetByResourceGroup + +```java +/** + * Samples for NetworkProfiles GetByResourceGroup. + */ +public final class NetworkProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkProfileGetWithContainerNic.json + */ + /** + * Sample code: Get network profile with container network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkProfileWithContainerNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles() + .getByResourceGroupWithResponse("rg1", "networkProfile1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileGetConfigOnly. + * json + */ + /** + * Sample code: Get network profile. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles() + .getByResourceGroupWithResponse("rg1", "networkProfile1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkProfiles_List + +```java +/** + * Samples for NetworkProfiles List. + */ +public final class NetworkProfilesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileListAll.json + */ + /** + * Sample code: List all network profiles. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkProfiles(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkProfiles_ListByResourceGroup + +```java +/** + * Samples for NetworkProfiles ListByResourceGroup. + */ +public final class NetworkProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileList.json + */ + /** + * Sample code: List resource group network profiles. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupNetworkProfiles(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkProfiles_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.NetworkProfile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkProfiles UpdateTags. + */ +public final class NetworkProfilesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileUpdateTags.json + */ + /** + * Sample code: Update network profile tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNetworkProfileTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkProfile resource = manager.networkProfiles() + .getByResourceGroupWithResponse("rg1", "test-np", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkSecurityGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +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.Arrays; + +/** + * Samples for NetworkSecurityGroups CreateOrUpdate. + */ +public final class NetworkSecurityGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupCreateWithRule.json + */ + /** + * Sample code: Create network security group with rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkSecurityGroupWithRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups() + .define("testnsg") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSecurityRules(Arrays.asList(new SecurityRuleInner().withName("rule1") + .withProtocol(SecurityRuleProtocol.ASTERISK) + .withSourcePortRange("*") + .withDestinationPortRange("80") + .withSourceAddressPrefix("*") + .withDestinationAddressPrefix("*") + .withAccess(SecurityRuleAccess.ALLOW) + .withPriority(130) + .withDirection(SecurityRuleDirection.INBOUND))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupCreate. + * json + */ + /** + * Sample code: Create network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups() + .define("testnsg") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .create(); + } +} +``` + +### NetworkSecurityGroups_Delete + +```java +/** + * Samples for NetworkSecurityGroups Delete. + */ +public final class NetworkSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupDelete. + * json + */ + /** + * Sample code: Delete network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups().delete("rg1", "testnsg", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkSecurityGroups_GetByResourceGroup + +```java +/** + * Samples for NetworkSecurityGroups GetByResourceGroup. + */ +public final class NetworkSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupGet.json + */ + /** + * Sample code: Get network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups() + .getByResourceGroupWithResponse("rg1", "testnsg", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkSecurityGroups_List + +```java +/** + * Samples for NetworkSecurityGroups List. + */ +public final class NetworkSecurityGroupsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupListAll. + * json + */ + /** + * Sample code: List all network security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllNetworkSecurityGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkSecurityGroups_ListByResourceGroup + +```java +/** + * Samples for NetworkSecurityGroups ListByResourceGroup. + */ +public final class NetworkSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupList.json + */ + /** + * Sample code: List network security groups in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNetworkSecurityGroupsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkSecurityGroups_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkSecurityGroups UpdateTags. + */ +public final class NetworkSecurityGroupsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupUpdateTags.json + */ + /** + * Sample code: Update network security group tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateNetworkSecurityGroupTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkSecurityGroup resource = manager.networkSecurityGroups() + .getByResourceGroupWithResponse("rg1", "testnsg", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkVirtualApplianceConnections_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.util.Arrays; + +/** + * Samples for NetworkVirtualApplianceConnections CreateOrUpdate. + */ +public final class NetworkVirtualApplianceConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionPut.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections() + .createOrUpdate("rg1", "nva1", "connection1", new NetworkVirtualApplianceConnectionInner() + .withNamePropertiesName("connection1") + .withAsn(64512L) + .withTunnelIdentifier(0L) + .withBgpPeerAddress(Arrays.asList("169.254.16.13", "169.254.16.14")) + .withEnableInternetSecurity(false) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualApplianceConnections_Delete + +```java +/** + * Samples for NetworkVirtualApplianceConnections Delete. + */ +public final class NetworkVirtualApplianceConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionDelete.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections() + .delete("rg1", "nva1", "connection1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualApplianceConnections_Get + +```java +/** + * Samples for NetworkVirtualApplianceConnections Get. + */ +public final class NetworkVirtualApplianceConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionGet.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections() + .getWithResponse("rg1", "nva1", "connection1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualApplianceConnections_List + +```java +/** + * Samples for NetworkVirtualApplianceConnections List. + */ +public final class NetworkVirtualApplianceConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionList.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections().list("rg1", "nva1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.InternetIngressPublicIpsProperties; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliancePropertiesFormatNetworkProfile; +import com.azure.resourcemanager.network.generated.models.NicTypeInRequest; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceAdditionalNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceIpConfigurationProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkVirtualAppliances CreateOrUpdate. + */ +public final class NetworkVirtualAppliancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSaaSPut.json + */ + /** + * Sample code: Create SaaS NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSaaSNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances() + .define("nva") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .withDelegation(new DelegationProperties().withServiceName("PaloAltoNetworks.Cloudngfw/firewalls")) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualAppliancePut. + * json + */ + /** + * Sample code: Create NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances() + .define("nva") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withNvaSku(new VirtualApplianceSkuProperties().withVendor("Cisco SDWAN") + .withBundledScaleUnit("1") + .withMarketPlaceVersion("12.1")) + .withBootStrapConfigurationBlobs( + Arrays.asList("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .withCloudInitConfigurationBlobs( + Arrays.asList("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")) + .withVirtualApplianceAsn(10000L) + .withNetworkProfile( + new NetworkVirtualAppliancePropertiesFormatNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualApplianceNetworkInterfaceConfiguration() + .withNicType(NicTypeInRequest.PUBLIC_NIC) + .withProperties( + new VirtualApplianceNetworkInterfaceConfigurationProperties() + .withIpConfigurations( + Arrays.asList( + new VirtualApplianceIpConfiguration().withName("publicnicipconfig") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(true)), + new VirtualApplianceIpConfiguration() + .withName("publicnicipconfig-2") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(false))))), + new VirtualApplianceNetworkInterfaceConfiguration() + .withNicType(NicTypeInRequest.PRIVATE_NIC) + .withProperties( + new VirtualApplianceNetworkInterfaceConfigurationProperties() + .withIpConfigurations(Arrays.asList( + new VirtualApplianceIpConfiguration().withName("privatenicipconfig") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(true)), + new VirtualApplianceIpConfiguration().withName("privatenicipconfig-2") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(false)))))))) + .withAdditionalNics( + Arrays.asList(new VirtualApplianceAdditionalNicProperties().withName("exrsdwan").withHasPublicIp(true))) + .withInternetIngressPublicIps(Arrays.asList(new InternetIngressPublicIpsProperties().withId( + "/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkVirtualAppliances_Delete + +```java +/** + * Samples for NetworkVirtualAppliances Delete. + */ +public final class NetworkVirtualAppliancesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualApplianceDelete + * .json + */ + /** + * Sample code: Delete NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().delete("rg1", "nva", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_GetByResourceGroup + +```java +/** + * Samples for NetworkVirtualAppliances GetByResourceGroup. + */ +public final class NetworkVirtualAppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualApplianceGet. + * json + */ + /** + * Sample code: Get NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances() + .getByResourceGroupWithResponse("rg1", "nva", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_List + +```java +/** + * Samples for NetworkVirtualAppliances List. + */ +public final class NetworkVirtualAppliancesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceListBySubscription.json + */ + /** + * Sample code: List all Network Virtual Appliances for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkVirtualAppliancesForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_ListByResourceGroup + +```java +/** + * Samples for NetworkVirtualAppliances ListByResourceGroup. + */ +public final class NetworkVirtualAppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceListByResourceGroup.json + */ + /** + * Sample code: List all Network Virtual Appliance for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkVirtualApplianceForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_Restart + +```java + +/** + * Samples for NetworkVirtualAppliances Restart. + */ +public final class NetworkVirtualAppliancesRestartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSpecificRestart.json + */ + /** + * Sample code: Restart Specific NetworkVirtualAppliance VMs in VM Scale Set. + * + * @param manager Entry point to NetworkManager. + */ + public static void restartSpecificNetworkVirtualApplianceVMsInVMScaleSet( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().restart("rg1", "nva", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceEmptyRestart.json + */ + /** + * Sample code: Restart All NetworkVirtualAppliance VMs in VM Scale Set. + * + * @param manager Entry point to NetworkManager. + */ + public static void restartAllNetworkVirtualApplianceVMsInVMScaleSet( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().restart("rg1", "nva", null, com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkVirtualAppliances_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkVirtualAppliances UpdateTags. + */ +public final class NetworkVirtualAppliancesUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceUpdateTags.json + */ + /** + * Sample code: Update NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkVirtualAppliance resource = manager.networkVirtualAppliances() + .getByResourceGroupWithResponse("rg1", "nva", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkWatchers_CheckConnectivity + +```java +import com.azure.resourcemanager.network.generated.models.ConnectivityDestination; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivitySource; +import com.azure.resourcemanager.network.generated.models.IpVersion; + +/** + * Samples for NetworkWatchers CheckConnectivity. + */ +public final class NetworkWatchersCheckConnectivitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectivityCheck.json + */ + /** + * Sample code: Check connectivity. + * + * @param manager Entry point to NetworkManager. + */ + public static void checkConnectivity(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .checkConnectivity("rg1", "nw1", + new ConnectivityParameters() + .withSource(new ConnectivitySource().withResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")) + .withDestination(new ConnectivityDestination().withAddress("192.168.100.4").withPort(3389)) + .withPreferredIpVersion(IpVersion.IPV4), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_CreateOrUpdate + +```java +/** + * Samples for NetworkWatchers CreateOrUpdate. + */ +public final class NetworkWatchersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherCreate.json + */ + /** + * Sample code: Create network watcher. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().define("nw1").withRegion("eastus").withExistingResourceGroup("rg1").create(); + } +} +``` + +### NetworkWatchers_Delete + +```java +/** + * Samples for NetworkWatchers Delete. + */ +public final class NetworkWatchersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherDelete.json + */ + /** + * Sample code: Delete network watcher. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().delete("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetAzureReachabilityReport + +```java +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for NetworkWatchers GetAzureReachabilityReport. + */ +public final class NetworkWatchersGetAzureReachabilityReportSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherAzureReachabilityReportGet.json + */ + /** + * Sample code: Get Azure Reachability Report. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureReachabilityReport(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getAzureReachabilityReport("rg1", "nw1", + new AzureReachabilityReportParameters() + .withProviderLocation( + new AzureReachabilityReportLocation().withCountry("United States").withState("washington")) + .withProviders(Arrays.asList("Frontier Communications of America, Inc. - ASN 5650")) + .withAzureLocations(Arrays.asList("West US")) + .withStartTime(OffsetDateTime.parse("2017-09-07T00:00:00Z")) + .withEndTime(OffsetDateTime.parse("2017-09-10T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetByResourceGroup + +```java +/** + * Samples for NetworkWatchers GetByResourceGroup. + */ +public final class NetworkWatchersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherGet.json + */ + /** + * Sample code: Get network watcher. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().getByResourceGroupWithResponse("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetFlowLogStatus + +```java +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; + +/** + * Samples for NetworkWatchers GetFlowLogStatus. + */ +public final class NetworkWatchersGetFlowLogStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherFlowLogStatusQuery.json + */ + /** + * Sample code: Get flow log status. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFlowLogStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getFlowLogStatus("rg1", "nw1", + new FlowLogStatusParameters().withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetNetworkConfigurationDiagnostic + +```java +import com.azure.resourcemanager.network.generated.models.Direction; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticProfile; +import java.util.Arrays; + +/** + * Samples for NetworkWatchers GetNetworkConfigurationDiagnostic. + */ +public final class NetworkWatchersGetNetworkConfigurationDiagnosticSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherNetworkConfigurationDiagnostic.json + */ + /** + * Sample code: Network configuration diagnostic. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkConfigurationDiagnostic(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getNetworkConfigurationDiagnostic("rg1", "nw1", new NetworkConfigurationDiagnosticParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withProfiles(Arrays.asList(new NetworkConfigurationDiagnosticProfile().withDirection(Direction.INBOUND) + .withProtocol("TCP") + .withSource("10.1.0.4") + .withDestination("12.11.12.14") + .withDestinationPort("12100"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetNextHop + +```java +import com.azure.resourcemanager.network.generated.models.NextHopParameters; + +/** + * Samples for NetworkWatchers GetNextHop. + */ +public final class NetworkWatchersGetNextHopSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherNextHopGet.json + */ + /** + * Sample code: Get next hop. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNextHop(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getNextHop("rg1", "nw1", + new NextHopParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withSourceIpAddress("10.0.0.5") + .withDestinationIpAddress("10.0.0.10") + .withTargetNicResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetTopology + +```java +import com.azure.resourcemanager.network.generated.models.TopologyParameters; + +/** + * Samples for NetworkWatchers GetTopology. + */ +public final class NetworkWatchersGetTopologySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherTopologyGet. + * json + */ + /** + * Sample code: Get Topology. + * + * @param manager Entry point to NetworkManager. + */ + public static void getTopology(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getTopologyWithResponse("rg1", "nw1", new TopologyParameters().withTargetResourceGroupName("rg2"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetTroubleshooting + +```java +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; + +/** + * Samples for NetworkWatchers GetTroubleshooting. + */ +public final class NetworkWatchersGetTroubleshootingSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherTroubleshootGet + * .json + */ + /** + * Sample code: Get troubleshooting. + * + * @param manager Entry point to NetworkManager. + */ + public static void getTroubleshooting(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getTroubleshooting("rg1", "nw1", + new TroubleshootingParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1") + .withStoragePath("https://st1.blob.core.windows.net/cn1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetTroubleshootingResult + +```java +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; + +/** + * Samples for NetworkWatchers GetTroubleshootingResult. + */ +public final class NetworkWatchersGetTroubleshootingResultSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherTroubleshootResultQuery.json + */ + /** + * Sample code: Get troubleshoot result. + * + * @param manager Entry point to NetworkManager. + */ + public static void getTroubleshootResult(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getTroubleshootingResult("rg1", "nw1", + new QueryTroubleshootingParameters().withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_GetVMSecurityRules + +```java +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; + +/** + * Samples for NetworkWatchers GetVMSecurityRules. + */ +public final class NetworkWatchersGetVMSecurityRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherSecurityGroupViewGet.json + */ + /** + * Sample code: Get security group view. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSecurityGroupView(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getVMSecurityRules("rg1", "nw1", + new SecurityGroupViewParameters().withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_List + +```java +/** + * Samples for NetworkWatchers List. + */ +public final class NetworkWatchersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherListAll.json + */ + /** + * Sample code: List all network watchers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkWatchers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().list(com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_ListAvailableProviders + +```java +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import java.util.Arrays; + +/** + * Samples for NetworkWatchers ListAvailableProviders. + */ +public final class NetworkWatchersListAvailableProvidersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherAvailableProvidersListGet.json + */ + /** + * Sample code: Get Available Providers List. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableProvidersList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .listAvailableProviders("rg1", "nw1", + new AvailableProvidersListParameters().withAzureLocations(Arrays.asList("West US")) + .withCountry("United States") + .withState("washington") + .withCity("seattle"), + com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_ListByResourceGroup + +```java +/** + * Samples for NetworkWatchers ListByResourceGroup. + */ +public final class NetworkWatchersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherList.json + */ + /** + * Sample code: List network watchers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkWatchers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### NetworkWatchers_SetFlowLogConfiguration + +```java +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkWatchers SetFlowLogConfiguration. + */ +public final class NetworkWatchersSetFlowLogConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherFlowLogConfigure.json + */ + /** + * Sample code: Configure flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void configureFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .setFlowLogConfiguration("rg1", "nw1", new FlowLogInformationInner() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1") + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1") + .withEnabled(true), com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkWatchers_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.NetworkWatcher; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkWatchers UpdateTags. + */ +public final class NetworkWatchersUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherUpdateTags.json + */ + /** + * Sample code: Update network watcher tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNetworkWatcherTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkWatcher resource = manager.networkWatchers() + .getByResourceGroupWithResponse("rg1", "nw1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NetworkWatchers_VerifyIpFlow + +```java +import com.azure.resourcemanager.network.generated.models.Direction; +import com.azure.resourcemanager.network.generated.models.IpFlowProtocol; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; + +/** + * Samples for NetworkWatchers VerifyIpFlow. + */ +public final class NetworkWatchersVerifyIpFlowSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherIpFlowVerify. + * json + */ + /** + * Sample code: Ip flow verify. + * + * @param manager Entry point to NetworkManager. + */ + public static void ipFlowVerify(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .verifyIpFlow("rg1", "nw1", + new VerificationIpFlowParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withDirection(Direction.OUTBOUND) + .withProtocol(IpFlowProtocol.TCP) + .withLocalPort("80") + .withRemotePort("80") + .withLocalIpAddress("10.2.0.4") + .withRemoteIpAddress("121.10.1.1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/OperationList.json + */ + /** + * Sample code: Get a list of operations for a resource provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAListOfOperationsForAResourceProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.VnetRoute; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for P2SVpnGateways CreateOrUpdate. + */ +public final class P2SVpnGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayPut.json + */ + /** + * Sample code: P2SVpnGatewayPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .define("p2sVpnGateway1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1")) + .withP2SConnectionConfigurations(Arrays.asList(new P2SConnectionConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1") + .withName("P2SConnectionConfig1") + .withVpnClientAddressPool(new AddressSpace().withAddressPrefixes(Arrays.asList("101.3.0.0/16"))) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3")))) + .withVnetRoutes(new VnetRoute().withStaticRoutes(Arrays.asList()))))) + .withVpnGatewayScaleUnit(1) + .withVpnServerConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1")) + .withCustomDnsServers(Arrays.asList("1.1.1.1", "2.2.2.2")) + .withIsRoutingPreferenceInternet(false) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### P2SVpnGateways_Delete + +```java +/** + * Samples for P2SVpnGateways Delete. + */ +public final class P2SVpnGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayDelete.json + */ + /** + * Sample code: P2SVpnGatewayDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().delete("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_DisconnectP2SVpnConnections + +```java +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import java.util.Arrays; + +/** + * Samples for P2SVpnGateways DisconnectP2SVpnConnections. + */ +public final class P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2sVpnGatewaysDisconnectP2sVpnConnections.json + */ + /** + * Sample code: Disconnect VpnConnections from P2sVpn Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + disconnectVpnConnectionsFromP2sVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .disconnectP2SVpnConnections("p2s-vpn-gateway-test", "p2svpngateway", + new P2SVpnConnectionRequest().withVpnConnectionIds(Arrays.asList("vpnconnId1", "vpnconnId2")), + com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_GenerateVpnProfile + +```java +import com.azure.resourcemanager.network.generated.models.AuthenticationMethod; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; + +/** + * Samples for P2SVpnGateways GenerateVpnProfile. + */ +public final class P2SVpnGatewaysGenerateVpnProfileSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayGenerateVpnProfile.json + */ + /** + * Sample code: GenerateP2SVpnGatewayVPNProfile. + * + * @param manager Entry point to NetworkManager. + */ + public static void + generateP2SVpnGatewayVPNProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .generateVpnProfile("rg1", "p2sVpnGateway1", + new P2SVpnProfileParameters().withAuthenticationMethod(AuthenticationMethod.EAPTLS), + com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_GetByResourceGroup + +```java +/** + * Samples for P2SVpnGateways GetByResourceGroup. + */ +public final class P2SVpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayGet.json + */ + /** + * Sample code: P2SVpnGatewayGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .getByResourceGroupWithResponse("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_GetP2SVpnConnectionHealth + +```java +/** + * Samples for P2SVpnGateways GetP2SVpnConnectionHealth. + */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayGetConnectionHealth.json + */ + /** + * Sample code: P2SVpnGatewayGetConnectionHealth. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayGetConnectionHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().getP2SVpnConnectionHealth("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_GetP2SVpnConnectionHealthDetailed + +```java +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import java.util.Arrays; + +/** + * Samples for P2SVpnGateways GetP2SVpnConnectionHealthDetailed. + */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayGetConnectionHealthDetailed.json + */ + /** + * Sample code: P2SVpnGatewayGetConnectionHealthDetailed. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayGetConnectionHealthDetailed(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .getP2SVpnConnectionHealthDetailed("p2s-vpn-gateway-test", "p2svpngateway", + new P2SVpnConnectionHealthRequest().withVpnUserNamesFilter(Arrays.asList("vpnUser1", "vpnUser2")) + .withOutputBlobSasUrl( + "https://blobcortextesturl.blob.core.windows.net/folderforconfig/p2sconnectionhealths?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"), + com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_List + +```java +/** + * Samples for P2SVpnGateways List. + */ +public final class P2SVpnGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayList.json + */ + /** + * Sample code: P2SVpnGatewayListBySubscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayListBySubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().list(com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_ListByResourceGroup + +```java +/** + * Samples for P2SVpnGateways ListByResourceGroup. + */ +public final class P2SVpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayListByResourceGroup.json + */ + /** + * Sample code: P2SVpnGatewayListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_Reset + +```java +/** + * Samples for P2SVpnGateways Reset. + */ +public final class P2SVpnGatewaysResetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayReset.json + */ + /** + * Sample code: ResetP2SVpnGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetP2SVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().reset("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### P2SVpnGateways_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for P2SVpnGateways UpdateTags. + */ +public final class P2SVpnGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayUpdateTags.json + */ + /** + * Sample code: P2SVpnGatewayUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + P2SVpnGateway resource = manager.p2SVpnGateways() + .getByResourceGroupWithResponse("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PacketCaptures_Create + +```java +import com.azure.resourcemanager.network.generated.models.PacketCapture; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.PcProtocol; +import java.util.Arrays; + +/** + * Samples for PacketCaptures Create. + */ +public final class PacketCapturesCreateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureCreate.json + */ + /** + * Sample code: Create packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures() + .create("rg1", "nw1", "pc1", new PacketCapture() + .withTarget("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withBytesToCapturePerPacket(10000L) + .withTotalBytesPerSession(100000L) + .withTimeLimitInSeconds(100) + .withStorageLocation(new PacketCaptureStorageLocation() + .withStorageId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore") + .withStoragePath("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap") + .withFilePath("D:\\capture\\pc1.cap")) + .withFilters(Arrays.asList(new PacketCaptureFilter().withProtocol(PcProtocol.TCP) + .withLocalIpAddress("10.0.0.4") + .withLocalPort("80"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### PacketCaptures_Delete + +```java +/** + * Samples for PacketCaptures Delete. + */ +public final class PacketCapturesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureDelete.json + */ + /** + * Sample code: Delete packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().delete("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} +``` + +### PacketCaptures_Get + +```java +/** + * Samples for PacketCaptures Get. + */ +public final class PacketCapturesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureGet.json + */ + /** + * Sample code: Get packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().getWithResponse("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} +``` + +### PacketCaptures_GetStatus + +```java +/** + * Samples for PacketCaptures GetStatus. + */ +public final class PacketCapturesGetStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureQueryStatus.json + */ + /** + * Sample code: Query packet capture status. + * + * @param manager Entry point to NetworkManager. + */ + public static void queryPacketCaptureStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().getStatus("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} +``` + +### PacketCaptures_List + +```java +/** + * Samples for PacketCaptures List. + */ +public final class PacketCapturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCapturesList.json + */ + /** + * Sample code: List packet captures. + * + * @param manager Entry point to NetworkManager. + */ + public static void listPacketCaptures(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().list("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} +``` + +### PacketCaptures_Stop + +```java +/** + * Samples for PacketCaptures Stop. + */ +public final class PacketCapturesStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureStop.json + */ + /** + * Sample code: Stop packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().stop("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} +``` + +### PeerExpressRouteCircuitConnections_Get + +```java +/** + * Samples for PeerExpressRouteCircuitConnections Get. + */ +public final class PeerExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PeerExpressRouteCircuitConnectionGet.json + */ + /** + * Sample code: PeerExpressRouteCircuitConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + peerExpressRouteCircuitConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.peerExpressRouteCircuitConnections() + .getWithResponse("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", + "60aee347-e889-4a42-8c1b-0aae8b1e4013", com.azure.core.util.Context.NONE); + } +} +``` + +### PeerExpressRouteCircuitConnections_List + +```java +/** + * Samples for PeerExpressRouteCircuitConnections List. + */ +public final class PeerExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PeerExpressRouteCircuitConnectionList.json + */ + /** + * Sample code: List Peer ExpressRouteCircuit Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPeerExpressRouteCircuitConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.peerExpressRouteCircuitConnections() + .list("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import java.util.Arrays; + +/** + * Samples for PrivateDnsZoneGroups CreateOrUpdate. + */ +public final class PrivateDnsZoneGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupCreate.json + */ + /** + * Sample code: Create private dns zone group. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups() + .createOrUpdate("rg1", "testPe", "testPdnsgroup", new PrivateDnsZoneGroupInner() + .withPrivateDnsZoneConfigs(Arrays.asList(new PrivateDnsZoneConfig().withPrivateDnsZoneId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_Delete + +```java +/** + * Samples for PrivateDnsZoneGroups Delete. + */ +public final class PrivateDnsZoneGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupDelete.json + */ + /** + * Sample code: Delete private dns zone group. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups().delete("rg1", "testPe", "testPdnsgroup", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_Get + +```java +/** + * Samples for PrivateDnsZoneGroups Get. + */ +public final class PrivateDnsZoneGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupGet.json + */ + /** + * Sample code: Get private dns zone group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups() + .getWithResponse("rg1", "testPe", "testPdnsgroup", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateDnsZoneGroups_List + +```java +/** + * Samples for PrivateDnsZoneGroups List. + */ +public final class PrivateDnsZoneGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupList.json + */ + /** + * Sample code: List private endpoints in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateEndpointsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups().list("testPe", "rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpoints_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection; +import java.util.Arrays; + +/** + * Samples for PrivateEndpoints CreateOrUpdate. + */ +public final class PrivateEndpointsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointCreateWithASG. + * json + */ + /** + * Sample code: Create private endpoint with application security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateEndpointWithApplicationSecurityGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .define("testPe") + .withRegion("eastus2euap") + .withExistingResourceGroup("rg1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .withPrivateLinkServiceConnections(Arrays.asList(new PrivateLinkServiceConnection() + .withPrivateLinkServiceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls") + .withGroupIds(Arrays.asList("groupIdFromResource")) + .withRequestMessage("Please approve my connection."))) + .withApplicationSecurityGroups(Arrays.asList(new ApplicationSecurityGroupInner().withId( + "/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointCreate.json + */ + /** + * Sample code: Create private endpoint. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .define("testPe") + .withRegion("eastus2euap") + .withExistingResourceGroup("rg1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .withPrivateLinkServiceConnections(Arrays.asList(new PrivateLinkServiceConnection() + .withPrivateLinkServiceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls") + .withGroupIds(Arrays.asList("groupIdFromResource")) + .withRequestMessage("Please approve my connection."))) + .withIpConfigurations(Arrays.asList(new PrivateEndpointIpConfiguration().withName("pestaticconfig") + .withGroupId("file") + .withMemberName("file") + .withPrivateIpAddress("192.168.0.6"))) + .withCustomNetworkInterfaceName("testPeNic") + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointCreateForManualApproval.json + */ + /** + * Sample code: Create private endpoint with manual approval connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateEndpointWithManualApprovalConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .define("testPe") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .withManualPrivateLinkServiceConnections(Arrays.asList(new PrivateLinkServiceConnection() + .withPrivateLinkServiceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls") + .withGroupIds(Arrays.asList("groupIdFromResource")) + .withRequestMessage("Please manually approve my connection."))) + .withIpConfigurations(Arrays.asList(new PrivateEndpointIpConfiguration().withName("pestaticconfig") + .withGroupId("file") + .withMemberName("file") + .withPrivateIpAddress("192.168.0.5"))) + .withCustomNetworkInterfaceName("testPeNic") + .create(); + } +} +``` + +### PrivateEndpoints_Delete + +```java +/** + * Samples for PrivateEndpoints Delete. + */ +public final class PrivateEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointDelete.json + */ + /** + * Sample code: Delete private endpoint. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints().delete("rg1", "testPe", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpoints_GetByResourceGroup + +```java +/** + * Samples for PrivateEndpoints GetByResourceGroup. + */ +public final class PrivateEndpointsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointGetWithASG. + * json + */ + /** + * Sample code: Get private endpoint with application security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateEndpointWithApplicationSecurityGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .getByResourceGroupWithResponse("rg1", "testPe", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointGetForManualApproval.json + */ + /** + * Sample code: Get private endpoint with manual approval connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateEndpointWithManualApprovalConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .getByResourceGroupWithResponse("rg1", "testPe", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointGet.json + */ + /** + * Sample code: Get private endpoint. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .getByResourceGroupWithResponse("rg1", "testPe", null, com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpoints_List + +```java +/** + * Samples for PrivateEndpoints List. + */ +public final class PrivateEndpointsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointListAll.json + */ + /** + * Sample code: List all private endpoints. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPrivateEndpoints(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpoints_ListByResourceGroup + +```java +/** + * Samples for PrivateEndpoints ListByResourceGroup. + */ +public final class PrivateEndpointsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointList.json + */ + /** + * Sample code: List private endpoints in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateEndpointsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_CheckPrivateLinkServiceVisibility + +```java +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; + +/** + * Samples for PrivateLinkServices CheckPrivateLinkServiceVisibility. + */ +public final class PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CheckPrivateLinkServiceVisibility.json + */ + /** + * Sample code: Check private link service visibility. + * + * @param manager Entry point to NetworkManager. + */ + public static void + checkPrivateLinkServiceVisibility(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .checkPrivateLinkServiceVisibility("westus", + new CheckPrivateLinkServiceVisibilityRequest() + .withPrivateLinkServiceAlias("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_CheckPrivateLinkServiceVisibilityByResourceGroup + +```java +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; + +/** + * Samples for PrivateLinkServices CheckPrivateLinkServiceVisibilityByResourceGroup. + */ +public final class PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CheckPrivateLinkServiceVisibilityByResourceGroup.json + */ + /** + * Sample code: Check private link service visibility. + * + * @param manager Entry point to NetworkManager. + */ + public static void + checkPrivateLinkServiceVisibility(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .checkPrivateLinkServiceVisibilityByResourceGroup("westus", "rg1", + new CheckPrivateLinkServiceVisibilityRequest() + .withPrivateLinkServiceAlias("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +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.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import java.util.Arrays; + +/** + * Samples for PrivateLinkServices CreateOrUpdate. + */ +public final class PrivateLinkServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceCreate.json + */ + /** + * Sample code: Create private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .define("testPls") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withLoadBalancerFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))) + .withIpConfigurations(Arrays.asList(new PrivateLinkServiceIpConfigurationInner().withName("fe-lb") + .withPrivateIpAddress("10.0.1.4") + .withPrivateIpAllocationMethod(IpAllocationMethod.STATIC) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")) + .withPrivateIpAddressVersion(IpVersion.IPV4))) + .withVisibility(new PrivateLinkServicePropertiesVisibility() + .withSubscriptions(Arrays.asList("subscription1", "subscription2", "subscription3"))) + .withAutoApproval(new PrivateLinkServicePropertiesAutoApproval() + .withSubscriptions(Arrays.asList("subscription1", "subscription2"))) + .withFqdns(Arrays.asList("fqdn1", "fqdn2", "fqdn3")) + .create(); + } +} +``` + +### PrivateLinkServices_Delete + +```java +/** + * Samples for PrivateLinkServices Delete. + */ +public final class PrivateLinkServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceDelete.json + */ + /** + * Sample code: Delete private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices().delete("rg1", "testPls", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_DeletePrivateEndpointConnection + +```java +/** + * Samples for PrivateLinkServices DeletePrivateEndpointConnection. + */ +public final class PrivateLinkServicesDeletePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceDeletePrivateEndpointConnection.json + */ + /** + * Sample code: delete private end point connection for a private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateEndPointConnectionForAPrivateLinkService( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .deletePrivateEndpointConnection("rg1", "testPls", "testPlePeConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_GetByResourceGroup + +```java +/** + * Samples for PrivateLinkServices GetByResourceGroup. + */ +public final class PrivateLinkServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceGet.json + */ + /** + * Sample code: Get private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .getByResourceGroupWithResponse("rg1", "testPls", null, com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_GetPrivateEndpointConnection + +```java +/** + * Samples for PrivateLinkServices GetPrivateEndpointConnection. + */ +public final class PrivateLinkServicesGetPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceGetPrivateEndpointConnection.json + */ + /** + * Sample code: Get private end point connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getPrivateEndPointConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .getPrivateEndpointConnectionWithResponse("rg1", "testPls", "testPlePeConnection", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_List + +```java +/** + * Samples for PrivateLinkServices List. + */ +public final class PrivateLinkServicesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceListAll. + * json + */ + /** + * Sample code: List all private list service. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPrivateListService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_ListAutoApprovedPrivateLinkServices + +```java +/** + * Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServices. + */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AutoApprovedPrivateLinkServicesGet.json + */ + /** + * Sample code: Get list of private link service id that can be linked to a private end point with auto approved. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfPrivateLinkServiceIdThatCanBeLinkedToAPrivateEndPointWithAutoApproved( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .listAutoApprovedPrivateLinkServices("regionName", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_ListAutoApprovedPrivateLinkServicesByResourceGroup + +```java +/** + * Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServicesByResourceGroup. + */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AutoApprovedPrivateLinkServicesResourceGroupGet.json + */ + /** + * Sample code: Get list of private link service id that can be linked to a private end point with auto approved. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfPrivateLinkServiceIdThatCanBeLinkedToAPrivateEndPointWithAutoApproved( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .listAutoApprovedPrivateLinkServicesByResourceGroup("regionName", "rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_ListByResourceGroup + +```java +/** + * Samples for PrivateLinkServices ListByResourceGroup. + */ +public final class PrivateLinkServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceList.json + */ + /** + * Sample code: List private link service in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateLinkServiceInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_ListPrivateEndpointConnections + +```java +/** + * Samples for PrivateLinkServices ListPrivateEndpointConnections. + */ +public final class PrivateLinkServicesListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceListPrivateEndpointConnection.json + */ + /** + * Sample code: List private link service in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateLinkServiceInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .listPrivateEndpointConnections("rg1", "testPls", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkServices_UpdatePrivateEndpointConnection + +```java +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateLinkServices UpdatePrivateEndpointConnection. + */ +public final class PrivateLinkServicesUpdatePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceUpdatePrivateEndpointConnection.json + */ + /** + * Sample code: approve or reject private end point connection for a private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void approveOrRejectPrivateEndPointConnectionForAPrivateLinkService( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .updatePrivateEndpointConnectionWithResponse("rg1", "testPls", "testPlePeConnection", + new PrivateEndpointConnectionInner().withName("testPlePeConnection") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus("Approved") + .withDescription("approved it for some reason.")), + com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettingsDomainNameLabelScope; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSkuTier; + +/** + * Samples for PublicIpAddresses CreateOrUpdate. + */ +public final class PublicIpAddressesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressCreateDns.json + */ + /** + * Sample code: Create public IP address DNS. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPublicIPAddressDNS(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .define("test-ip") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withDnsSettings(new PublicIpAddressDnsSettings().withDomainNameLabel("dnslbl")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpAddressCreateCustomizedValues.json + */ + /** + * Sample code: Create public IP address allocation method. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPAddressAllocationMethod(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .define("test-ip") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new PublicIpAddressSku().withName(PublicIpAddressSkuName.STANDARD) + .withTier(PublicIpAddressSkuTier.GLOBAL)) + .withPublicIpAllocationMethod(IpAllocationMethod.STATIC) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withIdleTimeoutInMinutes(10) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressCreateDefaults + * .json + */ + /** + * Sample code: Create public IP address defaults. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPAddressDefaults(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().define("test-ip").withRegion("eastus").withExistingResourceGroup("rg1").create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpAddressCreateDnsWithDomainNameLabelScope.json + */ + /** + * Sample code: Create public IP address DNS with Domain Name Label Scope. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPublicIPAddressDNSWithDomainNameLabelScope( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .define("test-ip") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withDnsSettings(new PublicIpAddressDnsSettings().withDomainNameLabel("dnslbl") + .withDomainNameLabelScope(PublicIpAddressDnsSettingsDomainNameLabelScope.TENANT_REUSE)) + .create(); + } +} +``` + +### PublicIpAddresses_DdosProtectionStatus + +```java +/** + * Samples for PublicIpAddresses DdosProtectionStatus. + */ +public final class PublicIpAddressesDdosProtectionStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpAddressGetDdosProtectionStatus.json + */ + /** + * Sample code: Get Ddos Protection Status of a Public IP Address. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getDdosProtectionStatusOfAPublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().ddosProtectionStatus("rg1", "test-pip", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_Delete + +```java +/** + * Samples for PublicIpAddresses Delete. + */ +public final class PublicIpAddressesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressDelete.json + */ + /** + * Sample code: Delete public IP address. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().delete("rg1", "test-ip", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_GetByResourceGroup + +```java +/** + * Samples for PublicIpAddresses GetByResourceGroup. + */ +public final class PublicIpAddressesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressGet.json + */ + /** + * Sample code: Get public IP address. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .getByResourceGroupWithResponse("rg1", "testDNS-ip", null, com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_GetCloudServicePublicIpAddress + +```java +/** + * Samples for PublicIpAddresses GetCloudServicePublicIpAddress. + */ +public final class PublicIpAddressesGetCloudServicePublicIpAddressSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServicePublicIpGet.json + */ + /** + * Sample code: GetVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .getCloudServicePublicIpAddressWithResponse("cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", "pub1", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_GetVirtualMachineScaleSetPublicIpAddress + +```java +/** + * Samples for PublicIpAddresses GetVirtualMachineScaleSetPublicIpAddress. + */ +public final class PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssPublicIpGet.json + */ + /** + * Sample code: GetVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .getVirtualMachineScaleSetPublicIpAddressWithResponse("vmss-tester", "vmss1", "1", "nic1", "ip1", "pub1", + null, com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_List + +```java +/** + * Samples for PublicIpAddresses List. + */ +public final class PublicIpAddressesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressListAll.json + */ + /** + * Sample code: List all public IP addresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPublicIPAddresses(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_ListByResourceGroup + +```java +/** + * Samples for PublicIpAddresses ListByResourceGroup. + */ +public final class PublicIpAddressesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressList.json + */ + /** + * Sample code: List resource group public IP addresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupPublicIPAddresses(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_ListCloudServicePublicIpAddresses + +```java +/** + * Samples for PublicIpAddresses ListCloudServicePublicIpAddresses. + */ +public final class PublicIpAddressesListCloudServicePublicIpAddressesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServicePublicIpListAll. + * json + */ + /** + * Sample code: ListVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listCloudServicePublicIpAddresses("cs-tester", "cs1", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_ListCloudServiceRoleInstancePublicIpAddresses + +```java +/** + * Samples for PublicIpAddresses ListCloudServiceRoleInstancePublicIpAddresses. + */ +public final class PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceRoleInstancePublicIpList.json + */ + /** + * Sample code: ListVMSSVMPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSVMPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listCloudServiceRoleInstancePublicIpAddresses("cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", + com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_ListVirtualMachineScaleSetPublicIpAddresses + +```java +/** + * Samples for PublicIpAddresses ListVirtualMachineScaleSetPublicIpAddresses. + */ +public final class PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssPublicIpListAll.json + */ + /** + * Sample code: ListVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listVirtualMachineScaleSetPublicIpAddresses("vmss-tester", "vmss1", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_ListVirtualMachineScaleSetVMPublicIpAddresses + +```java +/** + * Samples for PublicIpAddresses ListVirtualMachineScaleSetVMPublicIpAddresses. + */ +public final class PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssVmPublicIpList.json + */ + /** + * Sample code: ListVMSSVMPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSVMPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listVirtualMachineScaleSetVMPublicIpAddresses("vmss-tester", "vmss1", "1", "nic1", "ip1", + com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpAddresses_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicIpAddresses UpdateTags. + */ +public final class PublicIpAddressesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressUpdateTags. + * json + */ + /** + * Sample code: Update public IP address tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updatePublicIPAddressTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + PublicIpAddress resource = manager.publicIpAddresses() + .getByResourceGroupWithResponse("rg1", "test-ip", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PublicIpPrefixes_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSkuName; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSkuTier; + +/** + * Samples for PublicIpPrefixes CreateOrUpdate. + */ +public final class PublicIpPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixCreateDefaults. + * json + */ + /** + * Sample code: Create public IP prefix defaults. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPPrefixDefaults(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes() + .define("test-ipprefix") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new PublicIpPrefixSku().withName(PublicIpPrefixSkuName.STANDARD)) + .withPrefixLength(30) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpPrefixCreateCustomizedValues.json + */ + /** + * Sample code: Create public IP prefix allocation method. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPPrefixAllocationMethod(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes() + .define("test-ipprefix") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new PublicIpPrefixSku().withName(PublicIpPrefixSkuName.STANDARD) + .withTier(PublicIpPrefixSkuTier.REGIONAL)) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withPrefixLength(30) + .create(); + } +} +``` + +### PublicIpPrefixes_Delete + +```java +/** + * Samples for PublicIpPrefixes Delete. + */ +public final class PublicIpPrefixesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixDelete.json + */ + /** + * Sample code: Delete public IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePublicIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes().delete("rg1", "test-ipprefix", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpPrefixes_GetByResourceGroup + +```java +/** + * Samples for PublicIpPrefixes GetByResourceGroup. + */ +public final class PublicIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixGet.json + */ + /** + * Sample code: Get public IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPublicIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-ipprefix", null, com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpPrefixes_List + +```java +/** + * Samples for PublicIpPrefixes List. + */ +public final class PublicIpPrefixesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixListAll.json + */ + /** + * Sample code: List all public IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPublicIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpPrefixes_ListByResourceGroup + +```java +/** + * Samples for PublicIpPrefixes ListByResourceGroup. + */ +public final class PublicIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixList.json + */ + /** + * Sample code: List resource group public IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupPublicIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicIpPrefixes_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.PublicIpPrefix; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicIpPrefixes UpdateTags. + */ +public final class PublicIpPrefixesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixUpdateTags.json + */ + /** + * Sample code: Update public IP prefix tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updatePublicIPPrefixTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + PublicIpPrefix resource = manager.publicIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-ipprefix", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ResourceNavigationLinks_List + +```java +/** + * Samples for ResourceNavigationLinks List. + */ +public final class ResourceNavigationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetResourceNavigationLinks.json + */ + /** + * Sample code: Get Resource Navigation Links. + * + * @param manager Entry point to NetworkManager. + */ + public static void getResourceNavigationLinks(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceNavigationLinks().listWithResponse("rg1", "vnet", "subnet", com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_CheckDnsNameAvailability + +```java +/** + * Samples for ResourceProvider CheckDnsNameAvailability. + */ +public final class ResourceProviderCheckDnsNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CheckDnsNameAvailability.json + */ + /** + * Sample code: Check Dns Name Availability. + * + * @param manager Entry point to NetworkManager. + */ + public static void checkDnsNameAvailability(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .checkDnsNameAvailabilityWithResponse("westus", "testdns", com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_DeleteBastionShareableLink + +```java +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.VM; +import java.util.Arrays; + +/** + * Samples for ResourceProvider DeleteBastionShareableLink. + */ +public final class ResourceProviderDeleteBastionShareableLinkSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionShareableLinkDelete. + * json + */ + /** + * Sample code: Delete Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .deleteBastionShareableLink("rg1", "bastionhosttenant", + new BastionShareableLinkListRequest().withVms(Arrays.asList( + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")), + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_DeleteBastionShareableLinkByToken + +```java +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkTokenListRequest; +import java.util.Arrays; + +/** + * Samples for ResourceProvider DeleteBastionShareableLinkByToken. + */ +public final class ResourceProviderDeleteBastionShareableLinkByTokenSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * BastionShareableLinkDeleteByToken.json + */ + /** + * Sample code: Delete Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .deleteBastionShareableLinkByToken("rg1", "bastionhosttenant", + new BastionShareableLinkTokenListRequest().withTokens( + Arrays.asList("abcd1234-efgh-hijk-5678-abcdefgh1234", "dcba4321-hgfe-kjih-8765-hgfedcba4321")), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_DisconnectActiveSessions + +```java +import com.azure.resourcemanager.network.generated.models.SessionIds; + +/** + * Samples for ResourceProvider DisconnectActiveSessions. + */ +public final class ResourceProviderDisconnectActiveSessionsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionSessionDelete.json + */ + /** + * Sample code: Deletes the specified active session. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesTheSpecifiedActiveSession(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .disconnectActiveSessions("rg1", "bastionhosttenant", new SessionIds(), com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ExpressRouteProviderPort + +```java +/** + * Samples for ResourceProvider ExpressRouteProviderPort. + */ +public final class ResourceProviderExpressRouteProviderPortSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/expressRouteProviderPort.json + */ + /** + * Sample code: ExpressRouteProviderPort. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteProviderPort(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders().expressRouteProviderPortWithResponse("abc", com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_Generatevirtualwanvpnserverconfigurationvpnprofile + +```java +import com.azure.resourcemanager.network.generated.models.AuthenticationMethod; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; + +/** + * Samples for ResourceProvider Generatevirtualwanvpnserverconfigurationvpnprofile. + */ +public final class ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GenerateVirtualWanVpnServerConfigurationVpnProfile.json + */ + /** + * Sample code: GenerateVirtualWanVpnServerConfigurationVpnProfile. + * + * @param manager Entry point to NetworkManager. + */ + public static void generateVirtualWanVpnServerConfigurationVpnProfile( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .generatevirtualwanvpnserverconfigurationvpnprofile("rg1", "wan1", + new VirtualWanVpnProfileParameters().withVpnServerConfigurationResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1") + .withAuthenticationMethod(AuthenticationMethod.EAPTLS), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_GetActiveSessions + +```java +/** + * Samples for ResourceProvider GetActiveSessions. + */ +public final class ResourceProviderGetActiveSessionsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionSessionsList.json + */ + /** + * Sample code: Returns a list of currently active sessions on the Bastion. + * + * @param manager Entry point to NetworkManager. + */ + public static void returnsAListOfCurrentlyActiveSessionsOnTheBastion( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders().getActiveSessions("rg1", "bastionhosttenant", com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_GetBastionShareableLink + +```java +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.VM; +import java.util.Arrays; + +/** + * Samples for ResourceProvider GetBastionShareableLink. + */ +public final class ResourceProviderGetBastionShareableLinkSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionShareableLinkGet.json + */ + /** + * Sample code: Returns the Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void returnsTheBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .getBastionShareableLink("rg1", "bastionhosttenant", + new BastionShareableLinkListRequest().withVms(Arrays.asList( + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")), + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ListActiveConnectivityConfigurations + +```java +import com.azure.resourcemanager.network.generated.models.ActiveConfigurationParameter; +import java.util.Arrays; + +/** + * Samples for ResourceProvider ListActiveConnectivityConfigurations. + */ +public final class ResourceProviderListActiveConnectivityConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerActiveConnectivityConfigurationsList.json + */ + /** + * Sample code: List Active Connectivity Configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listActiveConnectivityConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listActiveConnectivityConfigurationsWithResponse("myResourceGroup", "testNetworkManager", + new ActiveConfigurationParameter().withRegions(Arrays.asList("westus")) + .withSkipToken("fakeTokenPlaceholder"), + null, com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ListActiveSecurityAdminRules + +```java +import com.azure.resourcemanager.network.generated.models.ActiveConfigurationParameter; +import java.util.Arrays; + +/** + * Samples for ResourceProvider ListActiveSecurityAdminRules. + */ +public final class ResourceProviderListActiveSecurityAdminRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerActiveSecurityAdminRulesList.json + */ + /** + * Sample code: List Active Security Admin Rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listActiveSecurityAdminRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listActiveSecurityAdminRulesWithResponse("myResourceGroup", "testNetworkManager", + new ActiveConfigurationParameter().withRegions(Arrays.asList("westus")) + .withSkipToken("fakeTokenPlaceholder"), + null, com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ListNetworkManagerEffectiveConnectivityConfigurations + +```java +import com.azure.resourcemanager.network.generated.models.QueryRequestOptions; + +/** + * Samples for ResourceProvider ListNetworkManagerEffectiveConnectivityConfigurations. + */ +public final class ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerEffectiveConnectivityConfigurationsList.json + */ + /** + * Sample code: List effective connectivity configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listEffectiveConnectivityConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listNetworkManagerEffectiveConnectivityConfigurationsWithResponse("myResourceGroup", "testVirtualNetwork", + new QueryRequestOptions().withSkipToken("fakeTokenPlaceholder"), null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_ListNetworkManagerEffectiveSecurityAdminRules + +```java +import com.azure.resourcemanager.network.generated.models.QueryRequestOptions; + +/** + * Samples for ResourceProvider ListNetworkManagerEffectiveSecurityAdminRules. + */ +public final class ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerEffectiveSecurityAdminRulesList.json + */ + /** + * Sample code: List effective security admin rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listEffectiveSecurityAdminRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listNetworkManagerEffectiveSecurityAdminRulesWithResponse("myResourceGroup", "testVirtualNetwork", + new QueryRequestOptions().withSkipToken("fakeTokenPlaceholder"), null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_PutBastionShareableLink + +```java +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.VM; +import java.util.Arrays; + +/** + * Samples for ResourceProvider PutBastionShareableLink. + */ +public final class ResourceProviderPutBastionShareableLinkSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionShareableLinkCreate. + * json + */ + /** + * Sample code: Create Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void createBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .putBastionShareableLink("rg1", "bastionhosttenant", + new BastionShareableLinkListRequest().withVms(Arrays.asList( + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")), + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_SupportedSecurityProviders + +```java +/** + * Samples for ResourceProvider SupportedSecurityProviders. + */ +public final class ResourceProviderSupportedSecurityProvidersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualWanSupportedSecurityProviders.json + */ + /** + * Sample code: supportedSecurityProviders. + * + * @param manager Entry point to NetworkManager. + */ + public static void supportedSecurityProviders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .supportedSecurityProvidersWithResponse("rg1", "wan1", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilterRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import java.util.Arrays; + +/** + * Samples for RouteFilterRules CreateOrUpdate. + */ +public final class RouteFilterRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterRuleCreate.json + */ + /** + * Sample code: RouteFilterRuleCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterRuleCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules() + .createOrUpdate("rg1", "filterName", "ruleName", + new RouteFilterRuleInner().withAccess(Access.ALLOW) + .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY) + .withCommunities(Arrays.asList("12076:5030", "12076:5040")), + com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilterRules_Delete + +```java +/** + * Samples for RouteFilterRules Delete. + */ +public final class RouteFilterRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterRuleDelete.json + */ + /** + * Sample code: RouteFilterRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules().delete("rg1", "filterName", "ruleName", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilterRules_Get + +```java +/** + * Samples for RouteFilterRules Get. + */ +public final class RouteFilterRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterRuleGet.json + */ + /** + * Sample code: RouteFilterRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules().getWithResponse("rg1", "filterName", "filterName", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilterRules_ListByRouteFilter + +```java +/** + * Samples for RouteFilterRules ListByRouteFilter. + */ +public final class RouteFilterRulesListByRouteFilterSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * RouteFilterRuleListByRouteFilter.json + */ + /** + * Sample code: RouteFilterRuleListByRouteFilter. + * + * @param manager Entry point to NetworkManager. + */ + public static void + routeFilterRuleListByRouteFilter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules().listByRouteFilter("rg1", "filterName", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilters_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RouteFilters CreateOrUpdate. + */ +public final class RouteFiltersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterCreate.json + */ + /** + * Sample code: RouteFilterCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters() + .define("filterName") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withRules(Arrays.asList(new RouteFilterRuleInner().withName("ruleName") + .withAccess(Access.ALLOW) + .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY) + .withCommunities(Arrays.asList("12076:5030", "12076:5040")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RouteFilters_Delete + +```java +/** + * Samples for RouteFilters Delete. + */ +public final class RouteFiltersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterDelete.json + */ + /** + * Sample code: RouteFilterDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters().delete("rg1", "filterName", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilters_GetByResourceGroup + +```java +/** + * Samples for RouteFilters GetByResourceGroup. + */ +public final class RouteFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterGet.json + */ + /** + * Sample code: RouteFilterGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters() + .getByResourceGroupWithResponse("rg1", "filterName", null, com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilters_List + +```java +/** + * Samples for RouteFilters List. + */ +public final class RouteFiltersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterList.json + */ + /** + * Sample code: RouteFilterList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilters_ListByResourceGroup + +```java +/** + * Samples for RouteFilters ListByResourceGroup. + */ +public final class RouteFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * RouteFilterListByResourceGroup.json + */ + /** + * Sample code: RouteFilterListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + routeFilterListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteFilters_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.RouteFilter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RouteFilters UpdateTags. + */ +public final class RouteFiltersUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterUpdateTags.json + */ + /** + * Sample code: Update route filter tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateRouteFilterTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + RouteFilter resource = manager.routeFilters() + .getByResourceGroupWithResponse("rg1", "filterName", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RouteMaps_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.Action; +import com.azure.resourcemanager.network.generated.models.Criterion; +import com.azure.resourcemanager.network.generated.models.NextStep; +import com.azure.resourcemanager.network.generated.models.Parameter; +import com.azure.resourcemanager.network.generated.models.RouteMapActionType; +import com.azure.resourcemanager.network.generated.models.RouteMapMatchCondition; +import com.azure.resourcemanager.network.generated.models.RouteMapRule; +import java.util.Arrays; + +/** + * Samples for RouteMaps CreateOrUpdate. + */ +public final class RouteMapsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapPut.json + */ + /** + * Sample code: RouteMapPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps() + .define("routeMap1") + .withExistingVirtualHub("rg1", "virtualHub1") + .withAssociatedInboundConnections(Arrays.asList( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")) + .withAssociatedOutboundConnections(Arrays.asList()) + .withRules(Arrays.asList(new RouteMapRule().withName("rule1") + .withMatchCriteria(Arrays.asList(new Criterion().withRoutePrefix(Arrays.asList("10.0.0.0/8")) + .withCommunity(Arrays.asList()) + .withAsPath(Arrays.asList()) + .withMatchCondition(RouteMapMatchCondition.CONTAINS))) + .withActions(Arrays.asList(new Action().withType(RouteMapActionType.ADD) + .withParameters(Arrays.asList(new Parameter().withRoutePrefix(Arrays.asList()) + .withCommunity(Arrays.asList()) + .withAsPath(Arrays.asList("22334")))))) + .withNextStepIfMatched(NextStep.CONTINUE))) + .create(); + } +} +``` + +### RouteMaps_Delete + +```java +/** + * Samples for RouteMaps Delete. + */ +public final class RouteMapsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapDelete.json + */ + /** + * Sample code: RouteMapDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps().delete("rg1", "virtualHub1", "routeMap1", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteMaps_Get + +```java +/** + * Samples for RouteMaps Get. + */ +public final class RouteMapsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapGet.json + */ + /** + * Sample code: RouteMapGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps().getWithResponse("rg1", "virtualHub1", "routeMap1", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteMaps_List + +```java +/** + * Samples for RouteMaps List. + */ +public final class RouteMapsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapList.json + */ + /** + * Sample code: RouteMapList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteTables_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import java.util.Arrays; + +/** + * Samples for RouteTables CreateOrUpdate. + */ +public final class RouteTablesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableCreate.json + */ + /** + * Sample code: Create route table. + * + * @param manager Entry point to NetworkManager. + */ + public static void createRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().define("testrt").withRegion("westus").withExistingResourceGroup("rg1").create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableCreateWithRoute. + * json + */ + /** + * Sample code: Create route table with route. + * + * @param manager Entry point to NetworkManager. + */ + public static void createRouteTableWithRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables() + .define("testrt") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withRoutes(Arrays.asList(new RouteInner().withName("route1") + .withAddressPrefix("10.0.3.0/24") + .withNextHopType(RouteNextHopType.VIRTUAL_NETWORK_GATEWAY))) + .withDisableBgpRoutePropagation(true) + .create(); + } +} +``` + +### RouteTables_Delete + +```java +/** + * Samples for RouteTables Delete. + */ +public final class RouteTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableDelete.json + */ + /** + * Sample code: Delete route table. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().delete("rg1", "testrt", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteTables_GetByResourceGroup + +```java +/** + * Samples for RouteTables GetByResourceGroup. + */ +public final class RouteTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableGet.json + */ + /** + * Sample code: Get route table. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().getByResourceGroupWithResponse("rg1", "testrt", null, com.azure.core.util.Context.NONE); + } +} +``` + +### RouteTables_List + +```java +/** + * Samples for RouteTables List. + */ +public final class RouteTablesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableListAll.json + */ + /** + * Sample code: List all route tables. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().list(com.azure.core.util.Context.NONE); + } +} +``` + +### RouteTables_ListByResourceGroup + +```java +/** + * Samples for RouteTables ListByResourceGroup. + */ +public final class RouteTablesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableList.json + */ + /** + * Sample code: List route tables in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listRouteTablesInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### RouteTables_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.RouteTable; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RouteTables UpdateTags. + */ +public final class RouteTablesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableUpdateTags.json + */ + /** + * Sample code: Update route table tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateRouteTableTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + RouteTable resource = manager.routeTables() + .getByResourceGroupWithResponse("rg1", "testrt", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Routes_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; + +/** + * Samples for Routes CreateOrUpdate. + */ +public final class RoutesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteCreate.json + */ + /** + * Sample code: Create route. + * + * @param manager Entry point to NetworkManager. + */ + public static void createRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes() + .define("route1") + .withExistingRouteTable("rg1", "testrt") + .withAddressPrefix("10.0.3.0/24") + .withNextHopType(RouteNextHopType.VIRTUAL_NETWORK_GATEWAY) + .create(); + } +} +``` + +### Routes_Delete + +```java +/** + * Samples for Routes Delete. + */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteDelete.json + */ + /** + * Sample code: Delete route. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes().delete("rg1", "testrt", "route1", com.azure.core.util.Context.NONE); + } +} +``` + +### Routes_Get + +```java +/** + * Samples for Routes Get. + */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteGet.json + */ + /** + * Sample code: Get route. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes().getWithResponse("rg1", "testrt", "route1", com.azure.core.util.Context.NONE); + } +} +``` + +### Routes_List + +```java +/** + * Samples for Routes List. + */ +public final class RoutesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteList.json + */ + /** + * Sample code: List routes. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes().list("rg1", "testrt", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingIntent_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import java.util.Arrays; + +/** + * Samples for RoutingIntent CreateOrUpdate. + */ +public final class RoutingIntentCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentPut.json + */ + /** + * Sample code: RouteTablePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTablePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents() + .define("Intent1") + .withExistingVirtualHub("rg1", "virtualHub1") + .withRoutingPolicies(Arrays.asList( + new RoutingPolicy().withName("InternetTraffic") + .withDestinations(Arrays.asList("Internet")) + .withNextHop( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + new RoutingPolicy().withName("PrivateTrafficPolicy") + .withDestinations(Arrays.asList("PrivateTraffic")) + .withNextHop( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"))) + .create(); + } +} +``` + +### RoutingIntent_Delete + +```java +/** + * Samples for RoutingIntent Delete. + */ +public final class RoutingIntentDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentDelete.json + */ + /** + * Sample code: RouteTableDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents().delete("rg1", "virtualHub1", "Intent1", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingIntent_Get + +```java +/** + * Samples for RoutingIntent Get. + */ +public final class RoutingIntentGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentGet.json + */ + /** + * Sample code: RouteTableGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents().getWithResponse("rg1", "virtualHub1", "Intent1", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingIntent_List + +```java +/** + * Samples for RoutingIntent List. + */ +public final class RoutingIntentListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentList.json + */ + /** + * Sample code: RoutingIntentList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routingIntentList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingRuleCollections_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingGroupItem; +import java.util.Arrays; + +/** + * Samples for RoutingRuleCollections CreateOrUpdate. + */ +public final class RoutingRuleCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionPut.json + */ + /** + * Sample code: Create or Update a routing rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateARoutingRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .define("testRuleCollection") + .withExistingRoutingConfiguration("rg1", "testNetworkManager", "myTestRoutingConfig") + .withDescription("A sample policy") + .withAppliesTo(Arrays.asList(new NetworkManagerRoutingGroupItem().withNetworkGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"))) + .create(); + } +} +``` + +### RoutingRuleCollections_Delete + +```java +/** + * Samples for RoutingRuleCollections Delete. + */ +public final class RoutingRuleCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionDelete.json + */ + /** + * Sample code: Deletes an routing rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesAnRoutingRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .delete("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingRuleCollections_Get + +```java +/** + * Samples for RoutingRuleCollections Get. + */ +public final class RoutingRuleCollectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionGet.json + */ + /** + * Sample code: Gets routing rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsRoutingRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .getWithResponse("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", + com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingRuleCollections_List + +```java +/** + * Samples for RoutingRuleCollections List. + */ +public final class RoutingRuleCollectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionList.json + */ + /** + * Sample code: List routing rule collections. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRoutingRuleCollections(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .list("rg1", "testNetworkManager", "myTestRoutingConfig", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.RoutingRuleDestinationType; +import com.azure.resourcemanager.network.generated.models.RoutingRuleNextHop; +import com.azure.resourcemanager.network.generated.models.RoutingRuleNextHopType; +import com.azure.resourcemanager.network.generated.models.RoutingRuleRouteDestination; + +/** + * Samples for RoutingRules CreateOrUpdate. + */ +public final class RoutingRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRulePut. + * json + */ + /** + * Sample code: Create an routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAnRoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .define("SampleRoutingRule") + .withExistingRuleCollection("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection") + .withDescription("This is Sample Routing Rule") + .withDestination(new RoutingRuleRouteDestination().withType(RoutingRuleDestinationType.ADDRESS_PREFIX) + .withDestinationAddress("10.0.0.0/16")) + .withNextHop(new RoutingRuleNextHop().withNextHopType(RoutingRuleNextHopType.VIRTUAL_NETWORK_GATEWAY)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRulePut. + * json + */ + /** + * Sample code: Create a default routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createADefaultRoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .define("SampleRoutingRule") + .withExistingRuleCollection("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection") + .withDescription("This is Sample Routing Rule") + .withDestination(new RoutingRuleRouteDestination().withType(RoutingRuleDestinationType.ADDRESS_PREFIX) + .withDestinationAddress("10.0.0.0/16")) + .withNextHop(new RoutingRuleNextHop().withNextHopType(RoutingRuleNextHopType.VIRTUAL_NETWORK_GATEWAY)) + .create(); + } +} +``` + +### RoutingRules_Delete + +```java +/** + * Samples for RoutingRules Delete. + */ +public final class RoutingRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleDelete.json + */ + /** + * Sample code: Deletes a routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletesARoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .delete("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "sampleRule", false, + com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingRules_Get + +```java +/** + * Samples for RoutingRules Get. + */ +public final class RoutingRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRuleGet. + * json + */ + /** + * Sample code: Gets routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsRoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleRoutingRule", com.azure.core.util.Context.NONE); + } +} +``` + +### RoutingRules_List + +```java +/** + * Samples for RoutingRules List. + */ +public final class RoutingRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRuleList + * .json + */ + /** + * Sample code: List routing rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRoutingRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .list("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeConnections_CreateOrUpdate + +```java +/** + * Samples for ScopeConnections CreateOrUpdate. + */ +public final class ScopeConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionPut.json + */ + /** + * Sample code: Create or Update Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateNetworkManagerScopeConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections() + .define("TestScopeConnection") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withTenantId("6babcaad-604b-40ac-a9d7-9fd97c0b779f") + .withResourceId("subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b") + .withDescription("This is a scope connection to a cross tenant subscription.") + .create(); + } +} +``` + +### ScopeConnections_Delete + +```java +/** + * Samples for ScopeConnections Delete. + */ +public final class ScopeConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionDelete.json + */ + /** + * Sample code: Delete Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkManagerScopeConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections() + .deleteWithResponse("rg1", "testNetworkManager", "TestScopeConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeConnections_Get + +```java +/** + * Samples for ScopeConnections Get. + */ +public final class ScopeConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionGet.json + */ + /** + * Sample code: Get Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getNetworkManagerScopeConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections() + .getWithResponse("rg1", "testNetworkManager", "TestScopeConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### ScopeConnections_List + +```java +/** + * Samples for ScopeConnections List. + */ +public final class ScopeConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionList.json + */ + /** + * Sample code: List Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNetworkManagerScopeConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections().list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityAdminConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.NetworkIntentPolicyBasedService; +import java.util.Arrays; + +/** + * Samples for SecurityAdminConfigurations CreateOrUpdate. + */ +public final class SecurityAdminConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationPut.json + */ + /** + * Sample code: Create network manager security admin configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkManagerSecurityAdminConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .define("myTestSecurityConfig") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample policy") + .withApplyOnNetworkIntentPolicyBasedServices(Arrays.asList(NetworkIntentPolicyBasedService.NONE)) + .create(); + } +} +``` + +### SecurityAdminConfigurations_Delete + +```java +/** + * Samples for SecurityAdminConfigurations Delete. + */ +public final class SecurityAdminConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationDelete.json + */ + /** + * Sample code: Delete network manager security admin configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkManagerSecurityAdminConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", false, com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityAdminConfigurations_Get + +```java +/** + * Samples for SecurityAdminConfigurations Get. + */ +public final class SecurityAdminConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationGet.json + */ + /** + * Sample code: Get security admin configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getSecurityAdminConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityAdminConfigurations_List + +```java +/** + * Samples for SecurityAdminConfigurations List. + */ +public final class SecurityAdminConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationList.json + */ + /** + * Sample code: List security admin configurations in a network manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityAdminConfigurationsInANetworkManager( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPartnerProviders_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecurityPartnerProviders CreateOrUpdate. + */ +public final class SecurityPartnerProvidersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SecurityPartnerProviderPut. + * json + */ + /** + * Sample code: Create Security Partner Provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSecurityPartnerProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders() + .define("securityPartnerProvider") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withSecurityProviderName(SecurityProviderName.ZSCALER) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SecurityPartnerProviders_Delete + +```java +/** + * Samples for SecurityPartnerProviders Delete. + */ +public final class SecurityPartnerProvidersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SecurityPartnerProviderDelete + * .json + */ + /** + * Sample code: Delete Security Partner Provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteSecurityPartnerProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders().delete("rg1", "securityPartnerProvider", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPartnerProviders_GetByResourceGroup + +```java +/** + * Samples for SecurityPartnerProviders GetByResourceGroup. + */ +public final class SecurityPartnerProvidersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SecurityPartnerProviderGet. + * json + */ + /** + * Sample code: Get Security Partner Provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSecurityPartnerProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders() + .getByResourceGroupWithResponse("rg1", "securityPartnerProvider", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPartnerProviders_List + +```java +/** + * Samples for SecurityPartnerProviders List. + */ +public final class SecurityPartnerProvidersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SecurityPartnerProviderListBySubscription.json + */ + /** + * Sample code: List all Security Partner Providers for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllSecurityPartnerProvidersForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPartnerProviders_ListByResourceGroup + +```java +/** + * Samples for SecurityPartnerProviders ListByResourceGroup. + */ +public final class SecurityPartnerProvidersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SecurityPartnerProviderListByResourceGroup.json + */ + /** + * Sample code: List all Security Partner Providers for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllSecurityPartnerProvidersForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityPartnerProviders_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProvider; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecurityPartnerProviders UpdateTags. + */ +public final class SecurityPartnerProvidersUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SecurityPartnerProviderUpdateTags.json + */ + /** + * Sample code: Update Security Partner Provider Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateSecurityPartnerProviderTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + SecurityPartnerProvider resource = manager.securityPartnerProviders() + .getByResourceGroupWithResponse("rg1", "securityPartnerProvider", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SecurityRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; + +/** + * Samples for SecurityRules CreateOrUpdate. + */ +public final class SecurityRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupRuleCreate.json + */ + /** + * Sample code: Create security rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSecurityRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules() + .define("rule1") + .withExistingNetworkSecurityGroup("rg1", "testnsg") + .withProtocol(SecurityRuleProtocol.ASTERISK) + .withSourcePortRange("*") + .withDestinationPortRange("8080") + .withSourceAddressPrefix("10.0.0.0/8") + .withDestinationAddressPrefix("11.0.0.0/8") + .withAccess(SecurityRuleAccess.DENY) + .withPriority(100) + .withDirection(SecurityRuleDirection.OUTBOUND) + .create(); + } +} +``` + +### SecurityRules_Delete + +```java +/** + * Samples for SecurityRules Delete. + */ +public final class SecurityRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupRuleDelete.json + */ + /** + * Sample code: Delete network security rule from network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkSecurityRuleFromNetworkSecurityGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules().delete("rg1", "testnsg", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityRules_Get + +```java +/** + * Samples for SecurityRules Get. + */ +public final class SecurityRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupRuleGet. + * json + */ + /** + * Sample code: Get network security rule in network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkSecurityRuleInNetworkSecurityGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules().getWithResponse("rg1", "testnsg", "rule1", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityRules_List + +```java +/** + * Samples for SecurityRules List. + */ +public final class SecurityRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupRuleList. + * json + */ + /** + * Sample code: List network security rules in network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkSecurityRulesInNetworkSecurityGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules().list("rg1", "testnsg", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserConfigurations_CreateOrUpdate + +```java +/** + * Samples for SecurityUserConfigurations CreateOrUpdate. + */ +public final class SecurityUserConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationPut.json + */ + /** + * Sample code: Create network manager security user configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkManagerSecurityUserConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .define("myTestSecurityConfig") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample policy") + .create(); + } +} +``` + +### SecurityUserConfigurations_Delete + +```java +/** + * Samples for SecurityUserConfigurations Delete. + */ +public final class SecurityUserConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationDelete.json + */ + /** + * Sample code: Delete network manager security user configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkManagerSecurityUserConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", false, com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserConfigurations_Get + +```java +/** + * Samples for SecurityUserConfigurations Get. + */ +public final class SecurityUserConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationGet.json + */ + /** + * Sample code: Get security user configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getSecurityUserConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserConfigurations_List + +```java +/** + * Samples for SecurityUserConfigurations List. + */ +public final class SecurityUserConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationList.json + */ + /** + * Sample code: List security user configurations in a network manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityUserConfigurationsInANetworkManager( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserRuleCollections_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.SecurityUserGroupItem; +import java.util.Arrays; + +/** + * Samples for SecurityUserRuleCollections CreateOrUpdate. + */ +public final class SecurityUserRuleCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionPut.json + */ + /** + * Sample code: Create or Update a Security User Rule Collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateASecurityUserRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .define("testRuleCollection") + .withExistingSecurityUserConfiguration("rg1", "testNetworkManager", "myTestSecurityConfig") + .withDescription("A sample policy") + .withAppliesToGroups(Arrays.asList(new SecurityUserGroupItem().withNetworkGroupId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"))) + .create(); + } +} +``` + +### SecurityUserRuleCollections_Delete + +```java +/** + * Samples for SecurityUserRuleCollections Delete. + */ +public final class SecurityUserRuleCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionDelete.json + */ + /** + * Sample code: Deletes a Security User Rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesASecurityUserRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", false, + com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserRuleCollections_Get + +```java +/** + * Samples for SecurityUserRuleCollections Get. + */ +public final class SecurityUserRuleCollectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionGet.json + */ + /** + * Sample code: Gets security user rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsSecurityUserRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserRuleCollections_List + +```java +/** + * Samples for SecurityUserRuleCollections List. + */ +public final class SecurityUserRuleCollectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionList.json + */ + /** + * Sample code: List rule collections in a security configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRuleCollectionsInASecurityConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserRules_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.AddressPrefixType; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.util.Arrays; + +/** + * Samples for SecurityUserRules CreateOrUpdate. + */ +public final class SecurityUserRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRulePut.json + */ + /** + * Sample code: Create a security user rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createASecurityUserRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .define("SampleUserRule") + .withExistingRuleCollection("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection") + .withDescription("Sample User Rule") + .withProtocol(SecurityConfigurationRuleProtocol.TCP) + .withSources(Arrays.asList( + new AddressPrefixItem().withAddressPrefix("*").withAddressPrefixType(AddressPrefixType.IPPREFIX))) + .withDestinations(Arrays.asList( + new AddressPrefixItem().withAddressPrefix("*").withAddressPrefixType(AddressPrefixType.IPPREFIX))) + .withSourcePortRanges(Arrays.asList("0-65535")) + .withDestinationPortRanges(Arrays.asList("22")) + .withDirection(SecurityConfigurationRuleDirection.INBOUND) + .create(); + } +} +``` + +### SecurityUserRules_Delete + +```java +/** + * Samples for SecurityUserRules Delete. + */ +public final class SecurityUserRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleDelete.json + */ + /** + * Sample code: Delete a security user rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteASecurityUserRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", false, + com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserRules_Get + +```java +/** + * Samples for SecurityUserRules Get. + */ +public final class SecurityUserRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleGet.json + */ + /** + * Sample code: Gets a security user rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsASecurityUserRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleUserRule", com.azure.core.util.Context.NONE); + } +} +``` + +### SecurityUserRules_List + +```java +/** + * Samples for SecurityUserRules List. + */ +public final class SecurityUserRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleList.json + */ + /** + * Sample code: List security user rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityUserRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", null, null, + com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceAssociationLinks_List + +```java +/** + * Samples for ServiceAssociationLinks List. + */ +public final class ServiceAssociationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetServiceAssociationLinks.json + */ + /** + * Sample code: Get Service Association Links. + * + * @param manager Entry point to NetworkManager. + */ + public static void getServiceAssociationLinks(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceAssociationLinks().listWithResponse("rg1", "vnet", "subnet", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import java.util.Arrays; + +/** + * Samples for ServiceEndpointPolicies CreateOrUpdate. + */ +public final class ServiceEndpointPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyCreate. + * json + */ + /** + * Sample code: Create service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies() + .define("testPolicy") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyCreateWithDefinition.json + */ + /** + * Sample code: Create service endpoint policy with definition. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createServiceEndpointPolicyWithDefinition(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies() + .define("testPolicy") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withServiceEndpointPolicyDefinitions(Arrays.asList(new ServiceEndpointPolicyDefinitionInner() + .withName("StorageServiceEndpointPolicyDefinition") + .withDescription("Storage Service EndpointPolicy Definition") + .withService("Microsoft.Storage") + .withServiceResources(Arrays.asList("/subscriptions/subid1", + "/subscriptions/subid1/resourceGroups/storageRg", + "/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")))) + .create(); + } +} +``` + +### ServiceEndpointPolicies_Delete + +```java +/** + * Samples for ServiceEndpointPolicies Delete. + */ +public final class ServiceEndpointPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyDelete. + * json + */ + /** + * Sample code: Delete service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies().delete("rg1", "serviceEndpointPolicy1", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_GetByResourceGroup + +```java +/** + * Samples for ServiceEndpointPolicies GetByResourceGroup. + */ +public final class ServiceEndpointPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyGet.json + */ + /** + * Sample code: Get service endPoint Policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getServiceEndPointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies() + .getByResourceGroupWithResponse("rg1", "testServiceEndpointPolicy", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_List + +```java +/** + * Samples for ServiceEndpointPolicies List. + */ +public final class ServiceEndpointPoliciesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyListAll. + * json + */ + /** + * Sample code: List all service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_ListByResourceGroup + +```java +/** + * Samples for ServiceEndpointPolicies ListByResourceGroup. + */ +public final class ServiceEndpointPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyList. + * json + */ + /** + * Sample code: List resource group service endpoint policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupServiceEndpointPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceEndpointPolicies_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ServiceEndpointPolicies UpdateTags. + */ +public final class ServiceEndpointPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyUpdateTags.json + */ + /** + * Sample code: Update service endpoint policy tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateServiceEndpointPolicyTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ServiceEndpointPolicy resource = manager.serviceEndpointPolicies() + .getByResourceGroupWithResponse("rg1", "testServiceEndpointPolicy", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ServiceEndpointPolicyDefinitions_CreateOrUpdate + +```java +import java.util.Arrays; + +/** + * Samples for ServiceEndpointPolicyDefinitions CreateOrUpdate. + */ +public final class ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionCreate.json + */ + /** + * Sample code: Create service endpoint policy definition. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createServiceEndpointPolicyDefinition(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .define("testDefinition") + .withExistingServiceEndpointPolicy("rg1", "testPolicy") + .withDescription("Storage Service EndpointPolicy Definition") + .withService("Microsoft.Storage") + .withServiceResources(Arrays.asList("/subscriptions/subid1", + "/subscriptions/subid1/resourceGroups/storageRg", + "/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")) + .create(); + } +} +``` + +### ServiceEndpointPolicyDefinitions_Delete + +```java +/** + * Samples for ServiceEndpointPolicyDefinitions Delete. + */ +public final class ServiceEndpointPolicyDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionDelete.json + */ + /** + * Sample code: Delete service endpoint policy definitions from service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteServiceEndpointPolicyDefinitionsFromServiceEndpointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .delete("rg1", "testPolicy", "testDefinition", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceEndpointPolicyDefinitions_Get + +```java +/** + * Samples for ServiceEndpointPolicyDefinitions Get. + */ +public final class ServiceEndpointPolicyDefinitionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionGet.json + */ + /** + * Sample code: Get service endpoint definition in service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getServiceEndpointDefinitionInServiceEndpointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .getWithResponse("rg1", "testPolicy", "testDefinition", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceEndpointPolicyDefinitions_ListByResourceGroup + +```java +/** + * Samples for ServiceEndpointPolicyDefinitions ListByResourceGroup. + */ +public final class ServiceEndpointPolicyDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionList.json + */ + /** + * Sample code: List service endpoint definitions in service end point policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void listServiceEndpointDefinitionsInServiceEndPointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .listByResourceGroup("rg1", "testPolicy", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTagInformation_List + +```java +/** + * Samples for ServiceTagInformation List. + */ +public final class ServiceTagInformationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceTagInformationListResultWithNoAddressPrefixes.json + */ + /** + * Sample code: Get list of service tags with no address prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getListOfServiceTagsWithNoAddressPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTagInformations().list("westeurope", true, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceTagInformationListResult.json + */ + /** + * Sample code: Get list of service tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfServiceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTagInformations().list("westeurope", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceTagInformationListResultWithTagname.json + */ + /** + * Sample code: Get list of service tags with tag name. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getListOfServiceTagsWithTagName(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTagInformations().list("westeurope", null, "ApiManagement", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceTags_List + +```java +/** + * Samples for ServiceTags List. + */ +public final class ServiceTagsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceTagsList.json + */ + /** + * Sample code: Get list of service tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfServiceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTags().listWithResponse("westcentralus", com.azure.core.util.Context.NONE); + } +} +``` + +### StaticMembers_CreateOrUpdate + +```java +/** + * Samples for StaticMembers CreateOrUpdate. + */ +public final class StaticMembersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerStaticMemberPut + * .json + */ + /** + * Sample code: StaticMemberPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMemberPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .define("testStaticMember") + .withExistingNetworkGroup("rg1", "testNetworkManager", "testNetworkGroup") + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1") + .create(); + } +} +``` + +### StaticMembers_Delete + +```java +/** + * Samples for StaticMembers Delete. + */ +public final class StaticMembersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerStaticMemberDelete.json + */ + /** + * Sample code: StaticMembersDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMembersDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .deleteWithResponse("SampleRG", "TestNM", "testNetworkGroup", "testStaticMember", + com.azure.core.util.Context.NONE); + } +} +``` + +### StaticMembers_Get + +```java +/** + * Samples for StaticMembers Get. + */ +public final class StaticMembersGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerStaticMemberGet + * .json + */ + /** + * Sample code: StaticMembersGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMembersGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .getWithResponse("rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", + com.azure.core.util.Context.NONE); + } +} +``` + +### StaticMembers_List + +```java +/** + * Samples for StaticMembers List. + */ +public final class StaticMembersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerStaticMemberList.json + */ + /** + * Sample code: StaticMembersList. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMembersList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .list("rg1", "testNetworkManager", "testNetworkGroup", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Subnets_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import java.util.Arrays; + +/** + * Samples for Subnets CreateOrUpdate. + */ +public final class SubnetsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreate.json + */ + /** + * Sample code: Create subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SubnetCreateServiceEndpointNetworkIdentifier.json + */ + /** + * Sample code: Create subnet with service endpoints with network identifier. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnetWithServiceEndpointsWithNetworkIdentifier( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints(Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage") + .withNetworkIdentifier(new SubResource().withId( + "/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreateServiceEndpoint. + * json + */ + /** + * Sample code: Create subnet with service endpoints. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSubnetWithServiceEndpoints(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints(Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreateWithDelegation. + * json + */ + /** + * Sample code: Create subnet with a delegation. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnetWithADelegation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreateWithSharingScope. + * json + */ + /** + * Sample code: Create subnet with sharing scope. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSubnetWithSharingScope(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .create(); + } +} +``` + +### Subnets_Delete + +```java +/** + * Samples for Subnets Delete. + */ +public final class SubnetsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetDelete.json + */ + /** + * Sample code: Delete subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().delete("subnet-test", "vnetname", "subnet1", com.azure.core.util.Context.NONE); + } +} +``` + +### Subnets_Get + +```java +/** + * Samples for Subnets Get. + */ +public final class SubnetsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetGetWithSharingScope. + * json + */ + /** + * Sample code: Get subnet with sharing scope. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnetWithSharingScope(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetGet.json + */ + /** + * Sample code: Get subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetGetWithDelegation.json + */ + /** + * Sample code: Get subnet with a delegation. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnetWithADelegation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Subnets_List + +```java +/** + * Samples for Subnets List. + */ +public final class SubnetsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetList.json + */ + /** + * Sample code: List subnets. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSubnets(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().list("subnet-test", "vnetname", com.azure.core.util.Context.NONE); + } +} +``` + +### Subnets_PrepareNetworkPolicies + +```java +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; + +/** + * Samples for Subnets PrepareNetworkPolicies. + */ +public final class SubnetsPrepareNetworkPoliciesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetPrepareNetworkPolicies. + * json + */ + /** + * Sample code: Prepare Network Policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void prepareNetworkPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .prepareNetworkPolicies("rg1", "test-vnet", "subnet1", + new PrepareNetworkPoliciesRequest().withServiceName("Microsoft.Sql/managedInstances"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Subnets_UnprepareNetworkPolicies + +```java +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; + +/** + * Samples for Subnets UnprepareNetworkPolicies. + */ +public final class SubnetsUnprepareNetworkPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SubnetUnprepareNetworkPolicies.json + */ + /** + * Sample code: Unprepare Network Policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void unprepareNetworkPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .unprepareNetworkPolicies("rg1", "test-vnet", "subnet1", + new UnprepareNetworkPoliciesRequest().withServiceName("Microsoft.Sql/managedInstances"), + com.azure.core.util.Context.NONE); + } +} +``` + +### SubscriptionNetworkManagerConnections_CreateOrUpdate + +```java +/** + * Samples for SubscriptionNetworkManagerConnections CreateOrUpdate. + */ +public final class SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionPut.json + */ + /** + * Sample code: Create or Update Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateSubscriptionNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections() + .define("TestNMConnection") + .withNetworkManagerId( + "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager") + .create(); + } +} +``` + +### SubscriptionNetworkManagerConnections_Delete + +```java +/** + * Samples for SubscriptionNetworkManagerConnections Delete. + */ +public final class SubscriptionNetworkManagerConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionDelete.json + */ + /** + * Sample code: Delete Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteSubscriptionNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections() + .deleteWithResponse("TestNMConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### SubscriptionNetworkManagerConnections_Get + +```java +/** + * Samples for SubscriptionNetworkManagerConnections Get. + */ +public final class SubscriptionNetworkManagerConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionGet.json + */ + /** + * Sample code: Get Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getSubscriptionNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections() + .getWithResponse("TestNMConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### SubscriptionNetworkManagerConnections_List + +```java +/** + * Samples for SubscriptionNetworkManagerConnections List. + */ +public final class SubscriptionNetworkManagerConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionList.json + */ + /** + * Sample code: List Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listSubscriptionNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections().list(null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Usages_List + +```java +/** + * Samples for Usages List. + */ +public final class UsagesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/UsageList.json + */ + /** + * Sample code: List usages. + * + * @param manager Entry point to NetworkManager. + */ + public static void listUsages(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.usages().list("westus", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/UsageListSpacedLocation.json + */ + /** + * Sample code: List usages spaced location. + * + * @param manager Entry point to NetworkManager. + */ + public static void listUsagesSpacedLocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.usages().list("West US", com.azure.core.util.Context.NONE); + } +} +``` + +### VipSwap_Create + +```java +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceInner; +import com.azure.resourcemanager.network.generated.models.SlotType; +import com.azure.resourcemanager.network.generated.models.SwapResourceProperties; + +/** + * Samples for VipSwap Create. + */ +public final class VipSwapCreateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServiceSwapPut.json + */ + /** + * Sample code: Put vip swap operation. + * + * @param manager Entry point to NetworkManager. + */ + public static void putVipSwapOperation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vipSwaps() + .create("rg1", "testCloudService", + new SwapResourceInner().withProperties(new SwapResourceProperties().withSlotType(SlotType.PRODUCTION)), + com.azure.core.util.Context.NONE); + } +} +``` + +### VipSwap_Get + +```java +/** + * Samples for VipSwap Get. + */ +public final class VipSwapGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServiceSwapGet.json + */ + /** + * Sample code: Get swap resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSwapResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vipSwaps().getWithResponse("rg1", "testCloudService", com.azure.core.util.Context.NONE); + } +} +``` + +### VipSwap_List + +```java +/** + * Samples for VipSwap List. + */ +public final class VipSwapListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServiceSwapList.json + */ + /** + * Sample code: Get swap resource list. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSwapResourceList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vipSwaps().listWithResponse("rg1", "testCloudService", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualApplianceSites_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.BreakOutCategoryPolicies; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; + +/** + * Samples for VirtualApplianceSites CreateOrUpdate. + */ +public final class VirtualApplianceSitesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSitePut.json + */ + /** + * Sample code: Create Network Virtual Appliance Site. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkVirtualApplianceSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites() + .define("site1") + .withExistingNetworkVirtualAppliance("rg1", "nva") + .withAddressPrefix("192.168.1.0/24") + .withO365Policy(new Office365PolicyProperties().withBreakOutCategories( + new BreakOutCategoryPolicies().withAllow(true).withOptimize(true).withDefaultProperty(true))) + .create(); + } +} +``` + +### VirtualApplianceSites_Delete + +```java +/** + * Samples for VirtualApplianceSites Delete. + */ +public final class VirtualApplianceSitesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSiteDelete.json + */ + /** + * Sample code: Delete Network Virtual Appliance Site. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkVirtualApplianceSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites().delete("rg1", "nva", "site1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualApplianceSites_Get + +```java +/** + * Samples for VirtualApplianceSites Get. + */ +public final class VirtualApplianceSitesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSiteGet.json + */ + /** + * Sample code: GetNetwork Virtual Appliance Site. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getNetworkVirtualApplianceSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites().getWithResponse("rg1", "nva", "site1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualApplianceSites_List + +```java +/** + * Samples for VirtualApplianceSites List. + */ +public final class VirtualApplianceSitesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSiteList.json + */ + /** + * Sample code: List all Network Virtual Appliance sites for a given Network Virtual Appliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkVirtualApplianceSitesForAGivenNetworkVirtualAppliance( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites().list("rg1", "nva", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualApplianceSkus_Get + +```java +/** + * Samples for VirtualApplianceSkus Get. + */ +public final class VirtualApplianceSkusGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualApplianceSkuGet + * .json + */ + /** + * Sample code: NetworkVirtualApplianceSkuGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceSkuGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSkus().getWithResponse("ciscoSdwan", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualApplianceSkus_List + +```java +/** + * Samples for VirtualApplianceSkus List. + */ +public final class VirtualApplianceSkusListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSkuList.json + */ + /** + * Sample code: NetworkVirtualApplianceSkuListResult. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceSkuListResult(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSkus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; + +/** + * Samples for VirtualHubBgpConnections CreateOrUpdate. + */ +public final class VirtualHubBgpConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionPut. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2Put. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2Put(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections() + .define("conn1") + .withExistingVirtualHub("rg1", "hub1") + .withPeerAsn(20000L) + .withPeerIp("192.168.1.5") + .withHubVirtualNetworkConnection(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1")) + .create(); + } +} +``` + +### VirtualHubBgpConnections_Delete + +```java +/** + * Samples for VirtualHubBgpConnections Delete. + */ +public final class VirtualHubBgpConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionDelete + * .json + */ + /** + * Sample code: VirtualHubRouteTableV2Delete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubRouteTableV2Delete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections().delete("rg1", "hub1", "conn1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_Get + +```java +/** + * Samples for VirtualHubBgpConnections Get. + */ +public final class VirtualHubBgpConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionGet. + * json + */ + /** + * Sample code: VirtualHubVirtualHubRouteTableV2Get. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubVirtualHubRouteTableV2Get(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections().getWithResponse("rg1", "hub1", "conn1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_List + +```java +/** + * Samples for VirtualHubBgpConnections List. + */ +public final class VirtualHubBgpConnectionsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionList. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2List. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections().list("rg1", "hub1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_ListAdvertisedRoutes + +```java +/** + * Samples for VirtualHubBgpConnections ListAdvertisedRoutes. + */ +public final class VirtualHubBgpConnectionsListAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterPeerListAdvertisedRoute.json + */ + /** + * Sample code: VirtualRouterPeerListAdvertisedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualRouterPeerListAdvertisedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections() + .listAdvertisedRoutes("rg1", "virtualRouter1", "peer1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubBgpConnections_ListLearnedRoutes + +```java +/** + * Samples for VirtualHubBgpConnections ListLearnedRoutes. + */ +public final class VirtualHubBgpConnectionsListLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterPeerListLearnedRoute.json + */ + /** + * Sample code: VirtualRouterPeerListLearnedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualRouterPeerListLearnedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections() + .listLearnedRoutes("rg1", "virtualRouter1", "peer1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubIpConfiguration_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; + +/** + * Samples for VirtualHubIpConfiguration CreateOrUpdate. + */ +public final class VirtualHubIpConfigurationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubIpConfigurationPut. + * json + */ + /** + * Sample code: VirtualHubIpConfigurationPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubIpConfigurationPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations() + .define("ipconfig1") + .withExistingVirtualHub("rg1", "hub1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")) + .create(); + } +} +``` + +### VirtualHubIpConfiguration_Delete + +```java +/** + * Samples for VirtualHubIpConfiguration Delete. + */ +public final class VirtualHubIpConfigurationDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualHubIpConfigurationDelete.json + */ + /** + * Sample code: VirtualHubIpConfigurationDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubIpConfigurationDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations().delete("rg1", "hub1", "ipconfig1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubIpConfiguration_Get + +```java +/** + * Samples for VirtualHubIpConfiguration Get. + */ +public final class VirtualHubIpConfigurationGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubIpConfigurationGet. + * json + */ + /** + * Sample code: VirtualHubVirtualHubRouteTableV2Get. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubVirtualHubRouteTableV2Get(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations() + .getWithResponse("rg1", "hub1", "ipconfig1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubIpConfiguration_List + +```java +/** + * Samples for VirtualHubIpConfiguration List. + */ +public final class VirtualHubIpConfigurationListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubIpConfigurationList + * .json + */ + /** + * Sample code: VirtualHubRouteTableV2List. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations().list("rg1", "hub1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import java.util.Arrays; + +/** + * Samples for VirtualHubRouteTableV2S CreateOrUpdate. + */ +public final class VirtualHubRouteTableV2SCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2Put. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2Put. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2Put(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S() + .createOrUpdate("rg1", "virtualHub1", "virtualHubRouteTable1a", + new VirtualHubRouteTableV2Inner() + .withRoutes(Arrays.asList( + new VirtualHubRouteV2().withDestinationType("CIDR") + .withDestinations(Arrays.asList("20.10.0.0/16", "20.20.0.0/16")) + .withNextHopType("IPAddress") + .withNextHops(Arrays.asList("10.0.0.68")), + new VirtualHubRouteV2().withDestinationType("CIDR") + .withDestinations(Arrays.asList("0.0.0.0/0")) + .withNextHopType("IPAddress") + .withNextHops(Arrays.asList("10.0.0.68")))) + .withAttachedConnections(Arrays.asList("All_Vnets")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_Delete + +```java +/** + * Samples for VirtualHubRouteTableV2S Delete. + */ +public final class VirtualHubRouteTableV2SDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2Delete. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2Delete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubRouteTableV2Delete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S() + .delete("rg1", "virtualHub1", "virtualHubRouteTable1a", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_Get + +```java +/** + * Samples for VirtualHubRouteTableV2S Get. + */ +public final class VirtualHubRouteTableV2SGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2Get. + * json + */ + /** + * Sample code: VirtualHubVirtualHubRouteTableV2Get. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubVirtualHubRouteTableV2Get(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S() + .getWithResponse("rg1", "virtualHub1", "virtualHubRouteTable1a", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubRouteTableV2S_List + +```java +/** + * Samples for VirtualHubRouteTableV2S List. + */ +public final class VirtualHubRouteTableV2SListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2List. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2List. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualHubs CreateOrUpdate. + */ +public final class VirtualHubsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubPut.json + */ + /** + * Sample code: VirtualHubPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .define("virtualHub2") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualWan(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1")) + .withAddressPrefix("10.168.0.0/24") + .withSku("Basic") + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualHubs_Delete + +```java +/** + * Samples for VirtualHubs Delete. + */ +public final class VirtualHubsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubDelete.json + */ + /** + * Sample code: VirtualHubDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().delete("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_GetByResourceGroup + +```java +/** + * Samples for VirtualHubs GetByResourceGroup. + */ +public final class VirtualHubsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubGet.json + */ + /** + * Sample code: VirtualHubGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().getByResourceGroupWithResponse("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_GetEffectiveVirtualHubRoutes + +```java +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; + +/** + * Samples for VirtualHubs GetEffectiveVirtualHubRoutes. + */ +public final class VirtualHubsGetEffectiveVirtualHubRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * EffectiveRoutesListForRouteTable.json + */ + /** + * Sample code: Effective Routes for a Route Table resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void + effectiveRoutesForARouteTableResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getEffectiveVirtualHubRoutes("rg1", "virtualHub1", new EffectiveRoutesParameters().withResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1") + .withVirtualWanResourceType("RouteTable"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * EffectiveRoutesListForConnection.json + */ + /** + * Sample code: Effective Routes for a Connection resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void + effectiveRoutesForAConnectionResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getEffectiveVirtualHubRoutes("rg1", "virtualHub1", new EffectiveRoutesParameters().withResourceId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName") + .withVirtualWanResourceType("ExpressRouteConnection"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * EffectiveRoutesListForVirtualHub.json + */ + /** + * Sample code: Effective Routes for the Virtual Hub. + * + * @param manager Entry point to NetworkManager. + */ + public static void + effectiveRoutesForTheVirtualHub(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getEffectiveVirtualHubRoutes("rg1", "virtualHub1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_GetInboundRoutes + +```java +import com.azure.resourcemanager.network.generated.models.GetInboundRoutesParameters; + +/** + * Samples for VirtualHubs GetInboundRoutes. + */ +public final class VirtualHubsGetInboundRoutesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/GetInboundRoutes.json + */ + /** + * Sample code: Inbound Routes for the Virtual Hub on a Particular Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundRoutesForTheVirtualHubOnAParticularConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getInboundRoutes("rg1", "virtualHub1", new GetInboundRoutesParameters().withResourceUri( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1") + .withConnectionType("ExpressRouteConnection"), com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_GetOutboundRoutes + +```java +import com.azure.resourcemanager.network.generated.models.GetOutboundRoutesParameters; + +/** + * Samples for VirtualHubs GetOutboundRoutes. + */ +public final class VirtualHubsGetOutboundRoutesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/GetOutboundRoutes.json + */ + /** + * Sample code: Outbound Routes for the Virtual Hub on a Particular Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void outboundRoutesForTheVirtualHubOnAParticularConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getOutboundRoutes("rg1", "virtualHub1", new GetOutboundRoutesParameters().withResourceUri( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1") + .withConnectionType("ExpressRouteConnection"), com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_List + +```java +/** + * Samples for VirtualHubs List. + */ +public final class VirtualHubsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubList.json + */ + /** + * Sample code: VirtualHubList. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_ListByResourceGroup + +```java +/** + * Samples for VirtualHubs ListByResourceGroup. + */ +public final class VirtualHubsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubListByResourceGroup + * .json + */ + /** + * Sample code: VirtualHubListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualHubs_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VirtualHub; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualHubs UpdateTags. + */ +public final class VirtualHubsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubUpdateTags.json + */ + /** + * Sample code: VirtualHubUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualHub resource = manager.virtualHubs() + .getByResourceGroupWithResponse("rg1", "virtualHub2", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualNetworkGatewayConnections_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuName; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuTier; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkGatewayConnections CreateOrUpdate. + */ +public final class VirtualNetworkGatewayConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionCreate.json + */ + /** + * Sample code: CreateVirtualNetworkGatewayConnection_S2S. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkGatewayConnectionS2S(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .define("connS2S") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withVirtualNetworkGateway1(new VirtualNetworkGatewayInner().withLocation("centralus") + .withTags(mapOf()) + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw") + .withIpConfigurations(Arrays.asList(new VirtualNetworkGatewayIpConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1") + .withName("gwipconfig1") + .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC) + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip")))) + .withGatewayType(VirtualNetworkGatewayType.VPN) + .withVpnType(VpnType.ROUTE_BASED) + .withEnableBgp(false) + .withActive(false) + .withSku(new VirtualNetworkGatewaySku().withName(VirtualNetworkGatewaySkuName.VPN_GW1) + .withTier(VirtualNetworkGatewaySkuTier.VPN_GW1)) + .withBgpSettings( + new BgpSettings().withAsn(65514L).withBgpPeeringAddress("10.0.1.30").withPeerWeight(0))) + .withConnectionType(VirtualNetworkGatewayConnectionType.IPSEC) + .withLocalNetworkGateway2(new LocalNetworkGatewayInner().withLocation("centralus") + .withTags(mapOf()) + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw") + .withLocalNetworkAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.1.0.0/16"))) + .withGatewayIpAddress("x.x.x.x")) + .withIngressNatRules(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"))) + .withEgressNatRules(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"))) + .withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol.IKEV2) + .withRoutingWeight(0) + .withDpdTimeoutSeconds(30) + .withConnectionMode(VirtualNetworkGatewayConnectionMode.DEFAULT) + .withSharedKey("Abc123") + .withEnableBgp(false) + .withGatewayCustomBgpIpAddresses(Arrays.asList( + new GatewayCustomBgpIpAddressIpConfiguration().withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default") + .withCustomBgpIpAddress("169.254.21.1"), + new GatewayCustomBgpIpAddressIpConfiguration().withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive") + .withCustomBgpIpAddress("169.254.21.3"))) + .withUsePolicyBasedTrafficSelectors(false) + .withIpsecPolicies(Arrays.asList()) + .withTrafficSelectorPolicies(Arrays.asList()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualNetworkGatewayConnections_Delete + +```java +/** + * Samples for VirtualNetworkGatewayConnections Delete. + */ +public final class VirtualNetworkGatewayConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionDelete.json + */ + /** + * Sample code: DeleteVirtualNetworkGatewayConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteVirtualNetworkGatewayConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().delete("rg1", "conn1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_GetByResourceGroup + +```java +/** + * Samples for VirtualNetworkGatewayConnections GetByResourceGroup. + */ +public final class VirtualNetworkGatewayConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionGet.json + */ + /** + * Sample code: GetVirtualNetworkGatewayConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .getByResourceGroupWithResponse("rg1", "connS2S", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_GetIkeSas + +```java +/** + * Samples for VirtualNetworkGatewayConnections GetIkeSas. + */ +public final class VirtualNetworkGatewayConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionGetIkeSas.json + */ + /** + * Sample code: GetVirtualNetworkGatewayConnectionIkeSa. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayConnectionIkeSa(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().getIkeSas("rg1", "vpngwcn1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_GetSharedKey + +```java +/** + * Samples for VirtualNetworkGatewayConnections GetSharedKey. + */ +public final class VirtualNetworkGatewayConnectionsGetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionGetSharedKey.json + */ + /** + * Sample code: GetVirtualNetworkGatewayConnectionSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayConnectionSharedKey( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .getSharedKeyWithResponse("rg1", "connS2S", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_ListByResourceGroup + +```java +/** + * Samples for VirtualNetworkGatewayConnections ListByResourceGroup. + */ +public final class VirtualNetworkGatewayConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionsList.json + */ + /** + * Sample code: ListVirtualNetworkGatewayConnectionsinResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualNetworkGatewayConnectionsinResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_ResetConnection + +```java +/** + * Samples for VirtualNetworkGatewayConnections ResetConnection. + */ +public final class VirtualNetworkGatewayConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionReset.json + */ + /** + * Sample code: ResetVirtualNetworkGatewayConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + resetVirtualNetworkGatewayConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().resetConnection("rg1", "conn1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_ResetSharedKey + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; + +/** + * Samples for VirtualNetworkGatewayConnections ResetSharedKey. + */ +public final class VirtualNetworkGatewayConnectionsResetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionResetSharedKey.json + */ + /** + * Sample code: ResetVirtualNetworkGatewayConnectionSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVirtualNetworkGatewayConnectionSharedKey( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .resetSharedKey("rg1", "conn1", new ConnectionResetSharedKeyInner().withKeyLength(128), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_SetSharedKey + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; + +/** + * Samples for VirtualNetworkGatewayConnections SetSharedKey. + */ +public final class VirtualNetworkGatewayConnectionsSetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionSetSharedKey.json + */ + /** + * Sample code: SetVirtualNetworkGatewayConnectionSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void setVirtualNetworkGatewayConnectionSharedKey( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .setSharedKey("rg1", "connS2S", new ConnectionSharedKeyInner().withValue("AzureAbc123"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_StartPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; + +/** + * Samples for VirtualNetworkGatewayConnections StartPacketCapture. + */ +public final class VirtualNetworkGatewayConnectionsStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionStartPacketCapture.json + */ + /** + * Sample code: Start packet capture on virtual network gateway connection without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayConnectionWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .startPacketCapture("rg1", "vpngwcn1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on virtual network gateway connection with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .startPacketCapture("rg1", "vpngwcn1", new VpnPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_StopPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; + +/** + * Samples for VirtualNetworkGatewayConnections StopPacketCapture. + */ +public final class VirtualNetworkGatewayConnectionsStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionStopPacketCapture.json + */ + /** + * Sample code: Stop packet capture on virtual network gateway connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopPacketCaptureOnVirtualNetworkGatewayConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .stopPacketCapture("rg1", "vpngwcn1", new VpnPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayConnections_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnection; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkGatewayConnections UpdateTags. + */ +public final class VirtualNetworkGatewayConnectionsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionUpdateTags.json + */ + /** + * Sample code: UpdateVirtualNetworkGatewayConnectionTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateVirtualNetworkGatewayConnectionTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetworkGatewayConnection resource = manager.virtualNetworkGatewayConnections() + .getByResourceGroupWithResponse("rg1", "test", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualNetworkGatewayNatRules_CreateOrUpdate + +```java +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.Arrays; + +/** + * Samples for VirtualNetworkGatewayNatRules CreateOrUpdate. + */ +public final class VirtualNetworkGatewayNatRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRulePut.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRulePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRulePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules() + .define("natRule1") + .withExistingVirtualNetworkGateway("rg1", "gateway1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings( + Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.4.0.0/24").withPortRange("200-300"))) + .withExternalMappings( + Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.21.0/24").withPortRange("300-400"))) + .withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default") + .create(); + } +} +``` + +### VirtualNetworkGatewayNatRules_Delete + +```java +/** + * Samples for VirtualNetworkGatewayNatRules Delete. + */ +public final class VirtualNetworkGatewayNatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRuleDelete.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules().delete("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayNatRules_Get + +```java +/** + * Samples for VirtualNetworkGatewayNatRules Get. + */ +public final class VirtualNetworkGatewayNatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRuleGet.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules() + .getWithResponse("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGatewayNatRules_ListByVirtualNetworkGateway + +```java +/** + * Samples for VirtualNetworkGatewayNatRules ListByVirtualNetworkGateway. + */ +public final class VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRuleList.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules() + .listByVirtualNetworkGateway("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuName; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuTier; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnClientProtocol; +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.azure.resourcemanager.network.generated.models.VpnType; +import java.util.Arrays; + +/** + * Samples for VirtualNetworkGateways CreateOrUpdate. + */ +public final class VirtualNetworkGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayUpdate. + * json + */ + /** + * Sample code: UpdateVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .define("vpngw") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new VirtualNetworkGatewayIpConfiguration().withName("gwipconfig1") + .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC) + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip")))) + .withGatewayType(VirtualNetworkGatewayType.VPN) + .withVpnType(VpnType.ROUTE_BASED) + .withEnableBgp(false) + .withActive(false) + .withDisableIpSecReplayProtection(false) + .withSku(new VirtualNetworkGatewaySku().withName(VirtualNetworkGatewaySkuName.VPN_GW1) + .withTier(VirtualNetworkGatewaySkuTier.VPN_GW1)) + .withVpnClientConfiguration(new VpnClientConfiguration().withVpnClientRootCertificates(Arrays.asList()) + .withVpnClientRevokedCertificates(Arrays.asList()) + .withVpnClientProtocols(Arrays.asList(VpnClientProtocol.OPEN_VPN)) + .withRadiusServers(Arrays.asList(new RadiusServer().withRadiusServerAddress("10.2.0.0") + .withRadiusServerScore(20L) + .withRadiusServerSecret("fakeTokenPlaceholder")))) + .withBgpSettings(new BgpSettings().withAsn(65515L).withBgpPeeringAddress("10.0.1.30").withPeerWeight(0)) + .withCustomRoutes(new AddressSpace().withAddressPrefixes(Arrays.asList("101.168.0.6/32"))) + .withEnableDnsForwarding(true) + .withNatRules(Arrays.asList(new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1") + .withName("natRule1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("50.0.0.0/24"))) + .withIpConfigurationId(""), + new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2") + .withName("natRule2") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.INGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("20.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("30.0.0.0/24"))) + .withIpConfigurationId(""))) + .withEnableBgpRouteTranslationForNat(false) + .withAllowVirtualWanTraffic(false) + .withAllowRemoteVnetTraffic(false) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkScalableGatewayUpdate.json + */ + /** + * Sample code: UpdateVirtualNetworkScalableGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateVirtualNetworkScalableGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .define("ergw") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new VirtualNetworkGatewayIpConfiguration().withName("gwipconfig1") + .withPrivateIpAllocationMethod(IpAllocationMethod.STATIC) + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip")))) + .withGatewayType(VirtualNetworkGatewayType.EXPRESS_ROUTE) + .withVpnType(VpnType.POLICY_BASED) + .withEnableBgp(false) + .withActive(false) + .withDisableIpSecReplayProtection(false) + .withSku(new VirtualNetworkGatewaySku().withName(VirtualNetworkGatewaySkuName.ER_GW_SCALE) + .withTier(VirtualNetworkGatewaySkuTier.ER_GW_SCALE)) + .withNatRules(Arrays.asList(new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/natRules/natRule1") + .withName("natRule1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("50.0.0.0/24"))) + .withIpConfigurationId(""), + new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/natRules/natRule2") + .withName("natRule2") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.INGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("20.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("30.0.0.0/24"))) + .withIpConfigurationId(""))) + .withEnableBgpRouteTranslationForNat(false) + .withAllowVirtualWanTraffic(false) + .withAllowRemoteVnetTraffic(false) + .create(); + } +} +``` + +### VirtualNetworkGateways_Delete + +```java +/** + * Samples for VirtualNetworkGateways Delete. + */ +public final class VirtualNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayDelete. + * json + */ + /** + * Sample code: DeleteVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().delete("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_DisconnectVirtualNetworkGatewayVpnConnections + +```java +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import java.util.Arrays; + +/** + * Samples for VirtualNetworkGateways DisconnectVirtualNetworkGatewayVpnConnections. + */ +public final class VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaysDisconnectP2sVpnConnections.json + */ + /** + * Sample code: Disconnect VpnConnections from Virtual Network Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void disconnectVpnConnectionsFromVirtualNetworkGateway( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .disconnectVirtualNetworkGatewayVpnConnections("vpn-gateway-test", "vpngateway", + new P2SVpnConnectionRequest().withVpnConnectionIds(Arrays.asList("vpnconnId1", "vpnconnId2")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GenerateVpnProfile + +```java +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; + +/** + * Samples for VirtualNetworkGateways GenerateVpnProfile. + */ +public final class VirtualNetworkGatewaysGenerateVpnProfileSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGenerateVpnProfile.json + */ + /** + * Sample code: GenerateVirtualNetworkGatewayVPNProfile. + * + * @param manager Entry point to NetworkManager. + */ + public static void + generateVirtualNetworkGatewayVPNProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .generateVpnProfile("rg1", "vpngw", new VpnClientParameters(), com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_Generatevpnclientpackage + +```java +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; + +/** + * Samples for VirtualNetworkGateways Generatevpnclientpackage. + */ +public final class VirtualNetworkGatewaysGeneratevpnclientpackageSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGenerateVpnClientPackage.json + */ + /** + * Sample code: GenerateVPNClientPackage. + * + * @param manager Entry point to NetworkManager. + */ + public static void generateVPNClientPackage(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .generatevpnclientpackage("rg1", "vpngw", new VpnClientParameters(), com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetAdvertisedRoutes + +```java +/** + * Samples for VirtualNetworkGateways GetAdvertisedRoutes. + */ +public final class VirtualNetworkGatewaysGetAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetAdvertisedRoutes.json + */ + /** + * Sample code: GetVirtualNetworkGatewayAdvertisedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayAdvertisedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getAdvertisedRoutes("rg1", "vpngw", "test", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetBgpPeerStatus + +```java +/** + * Samples for VirtualNetworkGateways GetBgpPeerStatus. + */ +public final class VirtualNetworkGatewaysGetBgpPeerStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetBGPPeerStatus.json + */ + /** + * Sample code: GetVirtualNetworkGatewayBGPPeerStatus. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayBGPPeerStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getBgpPeerStatus("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetByResourceGroup + +```java +/** + * Samples for VirtualNetworkGateways GetByResourceGroup. + */ +public final class VirtualNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayGet.json + */ + /** + * Sample code: GetVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .getByResourceGroupWithResponse("rg1", "vpngw", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkScalableGatewayGet.json + */ + /** + * Sample code: GetVirtualNetworkScalableGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkScalableGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .getByResourceGroupWithResponse("rg1", "ergw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetLearnedRoutes + +```java +/** + * Samples for VirtualNetworkGateways GetLearnedRoutes. + */ +public final class VirtualNetworkGatewaysGetLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayLearnedRoutes.json + */ + /** + * Sample code: GetVirtualNetworkGatewayLearnedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayLearnedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getLearnedRoutes("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetVpnProfilePackageUrl + +```java +/** + * Samples for VirtualNetworkGateways GetVpnProfilePackageUrl. + */ +public final class VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetVpnProfilePackageUrl.json + */ + /** + * Sample code: GetVirtualNetworkGatewayVPNProfilePackageURL. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayVPNProfilePackageURL( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getVpnProfilePackageUrl("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetVpnclientConnectionHealth + +```java +/** + * Samples for VirtualNetworkGateways GetVpnclientConnectionHealth. + */ +public final class VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetVpnclientConnectionHealth.json + */ + /** + * Sample code: GetVirtualNetworkGatewayVpnclientConnectionHealth. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayVpnclientConnectionHealth( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .getVpnclientConnectionHealth("p2s-vnet-test", "vpnp2sgw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_GetVpnclientIpsecParameters + +```java +/** + * Samples for VirtualNetworkGateways GetVpnclientIpsecParameters. + */ +public final class VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetVpnClientIpsecParameters.json + */ + /** + * Sample code: Get VirtualNetworkGateway VpnClientIpsecParameters. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayVpnClientIpsecParameters( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getVpnclientIpsecParameters("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_ListByResourceGroup + +```java +/** + * Samples for VirtualNetworkGateways ListByResourceGroup. + */ +public final class VirtualNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayList. + * json + */ + /** + * Sample code: ListVirtualNetworkGatewaysinResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworkGatewaysinResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_ListConnections + +```java +/** + * Samples for VirtualNetworkGateways ListConnections. + */ +public final class VirtualNetworkGatewaysListConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaysListConnections.json + */ + /** + * Sample code: VirtualNetworkGatewaysListConnections. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewaysListConnections(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .listConnections("testrg", "test-vpn-gateway-1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_Reset + +```java +/** + * Samples for VirtualNetworkGateways Reset. + */ +public final class VirtualNetworkGatewaysResetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayReset. + * json + */ + /** + * Sample code: ResetVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().reset("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_ResetVpnClientSharedKey + +```java +/** + * Samples for VirtualNetworkGateways ResetVpnClientSharedKey. + */ +public final class VirtualNetworkGatewaysResetVpnClientSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayResetVpnClientSharedKey.json + */ + /** + * Sample code: ResetVpnClientSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVpnClientSharedKey(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().resetVpnClientSharedKey("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_SetVpnclientIpsecParameters + +```java +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; + +/** + * Samples for VirtualNetworkGateways SetVpnclientIpsecParameters. + */ +public final class VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaySetVpnClientIpsecParameters.json + */ + /** + * Sample code: Set VirtualNetworkGateway VpnClientIpsecParameters. + * + * @param manager Entry point to NetworkManager. + */ + public static void setVirtualNetworkGatewayVpnClientIpsecParameters( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .setVpnclientIpsecParameters("rg1", "vpngw", + new VpnClientIPsecParametersInner().withSaLifeTimeSeconds(86473) + .withSaDataSizeKilobytes(429497) + .withIpsecEncryption(IpsecEncryption.AES256) + .withIpsecIntegrity(IpsecIntegrity.SHA256) + .withIkeEncryption(IkeEncryption.AES256) + .withIkeIntegrity(IkeIntegrity.SHA384) + .withDhGroup(DhGroup.DHGROUP2) + .withPfsGroup(PfsGroup.PFS2), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_StartPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; + +/** + * Samples for VirtualNetworkGateways StartPacketCapture. + */ +public final class VirtualNetworkGatewaysStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on virtual network gateway with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayWithFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .startPacketCapture("rg1", "vpngw", new VpnPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayStartPacketCapture.json + */ + /** + * Sample code: Start packet capture on virtual network gateway without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().startPacketCapture("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_StopPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; + +/** + * Samples for VirtualNetworkGateways StopPacketCapture. + */ +public final class VirtualNetworkGatewaysStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayStopPacketCapture.json + */ + /** + * Sample code: Stop packet capture on virtual network gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + stopPacketCaptureOnVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .stopPacketCapture("rg1", "vpngw", new VpnPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_SupportedVpnDevices + +```java +/** + * Samples for VirtualNetworkGateways SupportedVpnDevices. + */ +public final class VirtualNetworkGatewaysSupportedVpnDevicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaySupportedVpnDevice.json + */ + /** + * Sample code: ListVirtualNetworkGatewaySupportedVPNDevices. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualNetworkGatewaySupportedVPNDevices( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .supportedVpnDevicesWithResponse("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkGateways_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkGateways UpdateTags. + */ +public final class VirtualNetworkGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayUpdateTags.json + */ + /** + * Sample code: UpdateVirtualNetworkGatewayTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateVirtualNetworkGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetworkGateway resource = manager.virtualNetworkGateways() + .getByResourceGroupWithResponse("rg1", "vpngw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualNetworkGateways_VpnDeviceConfigurationScript + +```java +import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters; + +/** + * Samples for VirtualNetworkGateways VpnDeviceConfigurationScript. + */ +public final class VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayVpnDeviceConfigurationScript.json + */ + /** + * Sample code: GetVPNDeviceConfigurationScript. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVPNDeviceConfigurationScript(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .vpnDeviceConfigurationScriptWithResponse("rg1", "vpngw", + new VpnDeviceScriptParameters().withVendor("Cisco") + .withDeviceFamily("ISR") + .withFirmwareVersion("IOS 15.1 (Preview)"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkPeerings_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; +import java.util.Arrays; + +/** + * Samples for VirtualNetworkPeerings CreateOrUpdate. + */ +public final class VirtualNetworkPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkSubnetPeeringSync.json + */ + /** + * Sample code: Sync subnet Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void syncSubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(false) + .withSyncRemoteAddressSpace(SyncRemoteAddressSpace.TRUE) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkV6SubnetPeeringCreate.json + */ + /** + * Sample code: Create V6 Subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createV6SubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(true) + .withLocalSubnetNames(Arrays.asList("Subnet1", "Subnet4")) + .withRemoteSubnetNames(Arrays.asList("Subnet2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringSync. + * json + */ + /** + * Sample code: Sync Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void syncPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withSyncRemoteAddressSpace(SyncRemoteAddressSpace.TRUE) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringCreate. + * json + */ + /** + * Sample code: Create peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkPeeringCreateWithRemoteVirtualNetworkEncryption.json + */ + /** + * Sample code: Create peering with remote virtual network encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPeeringWithRemoteVirtualNetworkEncryption( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkSubnetPeeringCreate.json + */ + /** + * Sample code: Create subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(false) + .withLocalSubnetNames(Arrays.asList("Subnet1", "Subnet4")) + .withRemoteSubnetNames(Arrays.asList("Subnet2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkV6SubnetPeeringSync.json + */ + /** + * Sample code: Sync V6 Subnet Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void syncV6SubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(true) + .withSyncRemoteAddressSpace(SyncRemoteAddressSpace.TRUE) + .create(); + } +} +``` + +### VirtualNetworkPeerings_Delete + +```java +/** + * Samples for VirtualNetworkPeerings Delete. + */ +public final class VirtualNetworkPeeringsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringDelete. + * json + */ + /** + * Sample code: Delete peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().delete("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkPeerings_Get + +```java +/** + * Samples for VirtualNetworkPeerings Get. + */ +public final class VirtualNetworkPeeringsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringGet.json + */ + /** + * Sample code: Get peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkPeeringGetWithRemoteVirtualNetworkEncryption.json + */ + /** + * Sample code: Get peering with remote virtual network encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPeeringWithRemoteVirtualNetworkEncryption( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkSubnetPeeringGet.json + */ + /** + * Sample code: Get subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkV6SubnetPeeringGet.json + */ + /** + * Sample code: Get V6 subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getV6SubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkPeerings_List + +```java +/** + * Samples for VirtualNetworkPeerings List. + */ +public final class VirtualNetworkPeeringsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringList. + * json + */ + /** + * Sample code: List peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void listPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().list("peerTest", "vnet1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkPeeringListWithRemoteVirtualNetworkEncryption.json + */ + /** + * Sample code: List peerings with remote virtual network encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void listPeeringsWithRemoteVirtualNetworkEncryption( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().list("peerTest", "vnet1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkTaps_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; + +/** + * Samples for VirtualNetworkTaps CreateOrUpdate. + */ +public final class VirtualNetworkTapsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapCreate.json + */ + /** + * Sample code: Create Virtual Network Tap. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetworkTap(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps() + .define("test-vtap") + .withRegion("centraluseuap") + .withExistingResourceGroup("rg1") + .withDestinationNetworkInterfaceIpConfiguration(new NetworkInterfaceIpConfigurationInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/ipconfig1")) + .create(); + } +} +``` + +### VirtualNetworkTaps_Delete + +```java +/** + * Samples for VirtualNetworkTaps Delete. + */ +public final class VirtualNetworkTapsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapDelete.json + */ + /** + * Sample code: Delete Virtual Network Tap resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteVirtualNetworkTapResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps().delete("rg1", "test-vtap", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkTaps_GetByResourceGroup + +```java +/** + * Samples for VirtualNetworkTaps GetByResourceGroup. + */ +public final class VirtualNetworkTapsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapGet.json + */ + /** + * Sample code: Get Virtual Network Tap. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkTap(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps() + .getByResourceGroupWithResponse("rg1", "testvtap", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkTaps_List + +```java +/** + * Samples for VirtualNetworkTaps List. + */ +public final class VirtualNetworkTapsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapListAll.json + */ + /** + * Sample code: List all virtual network taps. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllVirtualNetworkTaps(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkTaps_ListByResourceGroup + +```java +/** + * Samples for VirtualNetworkTaps ListByResourceGroup. + */ +public final class VirtualNetworkTapsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapList.json + */ + /** + * Sample code: List virtual network taps in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworkTapsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworkTaps_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkTaps UpdateTags. + */ +public final class VirtualNetworkTapsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapUpdateTags. + * json + */ + /** + * Sample code: Update virtual network tap tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkTapTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetworkTap resource = manager.virtualNetworkTaps() + .getByResourceGroupWithResponse("rg1", "test-vtap", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualNetworks_CheckIpAddressAvailability + +```java +/** + * Samples for VirtualNetworks CheckIpAddressAvailability. + */ +public final class VirtualNetworksCheckIpAddressAvailabilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCheckIPAddressAvailability.json + */ + /** + * Sample code: Check IP address availability. + * + * @param manager Entry point to NetworkManager. + */ + public static void checkIPAddressAvailability(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .checkIpAddressAvailabilityWithResponse("rg1", "test-vnet", "10.0.1.4", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworks_CreateOrUpdate + +```java +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.AddressSpace; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryption; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryptionEnforcement; +import java.util.Arrays; + +/** + * Samples for VirtualNetworks CreateOrUpdate. + */ +public final class VirtualNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkCreateSubnet. + * json + */ + /** + * Sample code: Create virtual network with subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24"))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateWithBgpCommunities.json + */ + /** + * Sample code: Create virtual network with Bgp Communities. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithBgpCommunities(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24"))) + .withBgpCommunities(new VirtualNetworkBgpCommunities().withVirtualNetworkCommunity("12076:20000")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateSubnetWithAddressPrefixes.json + */ + /** + * Sample code: Create virtual network with subnet containing address prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetworkWithSubnetContainingAddressPrefixes( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList( + new SubnetInner().withName("test-2").withAddressPrefixes(Arrays.asList("10.0.0.0/28", "10.0.1.0/28")))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateSubnetWithDelegation.json + */ + /** + * Sample code: Create virtual network with delegated subnets. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithDelegatedSubnets(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("westcentralus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1") + .withAddressPrefix("10.0.0.0/24") + .withDelegations(Arrays.asList( + new Delegation().withName("myDelegation").withServiceName("Microsoft.Sql/managedInstances"))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateWithEncryption.json + */ + /** + * Sample code: Create virtual network with encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithEncryption(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24"))) + .withEncryption(new VirtualNetworkEncryption().withEnabled(true) + .withEnforcement(VirtualNetworkEncryptionEnforcement.ALLOW_UNENCRYPTED)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkCreate.json + */ + /** + * Sample code: Create virtual network. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withFlowTimeoutInMinutes(10) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateServiceEndpointPolicy.json + */ + /** + * Sample code: Create virtual network with service endpoints and service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetworkWithServiceEndpointsAndServiceEndpointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("vnet1") + .withRegion("eastus2euap") + .withExistingResourceGroup("vnetTest") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints( + Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage"))) + .withServiceEndpointPolicies(Arrays.asList(new ServiceEndpointPolicyInner().withId( + "/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateServiceEndpoints.json + */ + /** + * Sample code: Create virtual network with service endpoints. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithServiceEndpoints(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("vnet1") + .withRegion("eastus") + .withExistingResourceGroup("vnetTest") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints( + Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage"))))) + .create(); + } +} +``` + +### VirtualNetworks_Delete + +```java +/** + * Samples for VirtualNetworks Delete. + */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkDelete.json + */ + /** + * Sample code: Delete virtual network. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().delete("rg1", "test-vnet", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworks_GetByResourceGroup + +```java +/** + * Samples for VirtualNetworks GetByResourceGroup. + */ +public final class VirtualNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetWithSubnetDelegation.json + */ + /** + * Sample code: Get virtual network with a delegated subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkWithADelegatedSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetWithServiceAssociationLink.json + */ + /** + * Sample code: Get virtual network with service association links. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkWithServiceAssociationLinks( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGet.json + */ + /** + * Sample code: Get virtual network. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworks_List + +```java +/** + * Samples for VirtualNetworks List. + */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkListAll.json + */ + /** + * Sample code: List all virtual networks. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllVirtualNetworks(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworks_ListByResourceGroup + +```java +/** + * Samples for VirtualNetworks ListByResourceGroup. + */ +public final class VirtualNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkList.json + */ + /** + * Sample code: List virtual networks in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworksInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworks_ListDdosProtectionStatus + +```java +/** + * Samples for VirtualNetworks ListDdosProtectionStatus. + */ +public final class VirtualNetworksListDdosProtectionStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetDdosProtectionStatus.json + */ + /** + * Sample code: Get Ddos Protection Status of a Virtual Network. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getDdosProtectionStatusOfAVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .listDdosProtectionStatus("rg1", "test-vnet", 75, null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworks_ListUsage + +```java +/** + * Samples for VirtualNetworks ListUsage. + */ +public final class VirtualNetworksListUsageSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkListUsage.json + */ + /** + * Sample code: VnetGetUsage. + * + * @param manager Entry point to NetworkManager. + */ + public static void vnetGetUsage(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().listUsage("rg1", "vnetName", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualNetworks_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VirtualNetwork; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworks UpdateTags. + */ +public final class VirtualNetworksUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkUpdateTags.json + */ + /** + * Sample code: Update virtual network tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetwork resource = manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualRouterPeerings_CreateOrUpdate + +```java +/** + * Samples for VirtualRouterPeerings CreateOrUpdate. + */ +public final class VirtualRouterPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringPut.json + */ + /** + * Sample code: Create Virtual Router Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings() + .define("peering1") + .withExistingVirtualRouter("rg1", "virtualRouter") + .withPeerAsn(20000L) + .withPeerIp("192.168.1.5") + .create(); + } +} +``` + +### VirtualRouterPeerings_Delete + +```java +/** + * Samples for VirtualRouterPeerings Delete. + */ +public final class VirtualRouterPeeringsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringDelete. + * json + */ + /** + * Sample code: Delete VirtualRouterPeering. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings().delete("rg1", "virtualRouter", "peering1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualRouterPeerings_Get + +```java +/** + * Samples for VirtualRouterPeerings Get. + */ +public final class VirtualRouterPeeringsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringGet.json + */ + /** + * Sample code: Get Virtual Router Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings() + .getWithResponse("rg1", "virtualRouter", "peering1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualRouterPeerings_List + +```java +/** + * Samples for VirtualRouterPeerings List. + */ +public final class VirtualRouterPeeringsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringList.json + */ + /** + * Sample code: List all Virtual Router Peerings for a given Virtual Router. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllVirtualRouterPeeringsForAGivenVirtualRouter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings().list("rg1", "virtualRouter", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualRouters_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualRouters CreateOrUpdate. + */ +public final class VirtualRoutersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPut.json + */ + /** + * Sample code: Create VirtualRouter. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters() + .define("virtualRouter") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withHostedGateway(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualRouters_Delete + +```java +/** + * Samples for VirtualRouters Delete. + */ +public final class VirtualRoutersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterDelete.json + */ + /** + * Sample code: Delete VirtualRouter. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters().delete("rg1", "virtualRouter", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualRouters_GetByResourceGroup + +```java +/** + * Samples for VirtualRouters GetByResourceGroup. + */ +public final class VirtualRoutersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterGet.json + */ + /** + * Sample code: Get VirtualRouter. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters() + .getByResourceGroupWithResponse("rg1", "virtualRouter", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualRouters_List + +```java +/** + * Samples for VirtualRouters List. + */ +public final class VirtualRoutersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterListBySubscription.json + */ + /** + * Sample code: List all Virtual Routers for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllVirtualRoutersForAGivenSubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualRouters_ListByResourceGroup + +```java +/** + * Samples for VirtualRouters ListByResourceGroup. + */ +public final class VirtualRoutersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterListByResourceGroup.json + */ + /** + * Sample code: List all Virtual Router for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllVirtualRouterForAGivenResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualWans_CreateOrUpdate + +```java +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualWans CreateOrUpdate. + */ +public final class VirtualWansCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANPut.json + */ + /** + * Sample code: VirtualWANCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans() + .define("wan1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withDisableVpnEncryption(false) + .withTypePropertiesType("Basic") + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VirtualWans_Delete + +```java +/** + * Samples for VirtualWans Delete. + */ +public final class VirtualWansDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANDelete.json + */ + /** + * Sample code: VirtualWANDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().delete("rg1", "virtualWan1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualWans_GetByResourceGroup + +```java +/** + * Samples for VirtualWans GetByResourceGroup. + */ +public final class VirtualWansGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANGet.json + */ + /** + * Sample code: VirtualWANGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().getByResourceGroupWithResponse("rg1", "wan1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualWans_List + +```java +/** + * Samples for VirtualWans List. + */ +public final class VirtualWansListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANList.json + */ + /** + * Sample code: VirtualWANList. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualWans_ListByResourceGroup + +```java +/** + * Samples for VirtualWans ListByResourceGroup. + */ +public final class VirtualWansListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANListByResourceGroup + * .json + */ + /** + * Sample code: VirtualWANListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualWANListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VirtualWans_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VirtualWan; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualWans UpdateTags. + */ +public final class VirtualWansUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANUpdateTags.json + */ + /** + * Sample code: VirtualWANUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualWan resource = manager.virtualWans() + .getByResourceGroupWithResponse("rg1", "wan1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VpnConnections_CreateOrUpdate + +```java +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.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode; +import java.util.Arrays; + +/** + * Samples for VpnConnections CreateOrUpdate. + */ +public final class VpnConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionPut.json + */ + /** + * Sample code: VpnConnectionPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .createOrUpdate("rg1", "gateway1", "vpnConnection1", new VpnConnectionInner() + .withRemoteVpnSite(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1")) + .withTrafficSelectorPolicies(Arrays.asList()) + .withVpnLinkConnections(Arrays.asList(new VpnSiteLinkConnectionInner().withName("Connection-Link1") + .withVpnSiteLink(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1")) + .withVpnLinkConnectionMode(VpnLinkConnectionMode.DEFAULT) + .withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol.IKEV2) + .withConnectionBandwidth(200) + .withSharedKey("fakeTokenPlaceholder") + .withUsePolicyBasedTrafficSelectors(false))) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnConnections_Delete + +```java +/** + * Samples for VpnConnections Delete. + */ +public final class VpnConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionDelete.json + */ + /** + * Sample code: VpnConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections().delete("rg1", "gateway1", "vpnConnection1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnConnections_Get + +```java +/** + * Samples for VpnConnections Get. + */ +public final class VpnConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionGet.json + */ + /** + * Sample code: VpnConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections().getWithResponse("rg1", "gateway1", "vpnConnection1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnConnections_ListByVpnGateway + +```java +/** + * Samples for VpnConnections ListByVpnGateway. + */ +public final class VpnConnectionsListByVpnGatewaySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionList.json + */ + /** + * Sample code: VpnConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections().listByVpnGateway("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnConnections_StartPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters; +import java.util.Arrays; + +/** + * Samples for VpnConnections StartPacketCapture. + */ +public final class VpnConnectionsStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnConnectionStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on vpn connection with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnConnectionWithFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .startPacketCapture("rg1", "gateway1", "vpnConnection1", + new VpnConnectionPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}") + .withLinkConnectionNames(Arrays.asList("siteLink1", "siteLink2")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnConnectionStartPacketCapture.json + */ + /** + * Sample code: Start packet capture on vpn connection without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnConnectionWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .startPacketCapture( + "rg1", "gateway1", "vpnConnection1", new VpnConnectionPacketCaptureStartParameters() + .withLinkConnectionNames(Arrays.asList("siteLink1", "siteLink2")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnConnections_StopPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters; +import java.util.Arrays; + +/** + * Samples for VpnConnections StopPacketCapture. + */ +public final class VpnConnectionsStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnConnectionStopPacketCapture.json + */ + /** + * Sample code: Start packet capture on vpn connection without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnConnectionWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .stopPacketCapture("rg1", "gateway1", "vpnConnection1", + new VpnConnectionPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D") + .withLinkConnectionNames(Arrays.asList("vpnSiteLink1", "vpnSiteLink2")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.IpConfigurationBgpPeeringAddress; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +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.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnGateways CreateOrUpdate. + */ +public final class VpnGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayPut.json + */ + /** + * Sample code: VpnGatewayPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways() + .define("gateway1") + .withRegion("westcentralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1")) + .withConnections(Arrays.asList(new VpnConnectionInner().withName("vpnConnection1") + .withRemoteVpnSite(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1")) + .withVpnLinkConnections(Arrays.asList(new VpnSiteLinkConnectionInner().withName("Connection-Link1") + .withVpnSiteLink(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1")) + .withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol.IKEV2) + .withConnectionBandwidth(200) + .withSharedKey("fakeTokenPlaceholder") + .withEgressNatRules(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"))))))) + .withBgpSettings(new BgpSettings().withAsn(65515L) + .withPeerWeight(0) + .withBgpPeeringAddresses(Arrays.asList( + new IpConfigurationBgpPeeringAddress().withIpconfigurationId("Instance0") + .withCustomBgpIpAddresses(Arrays.asList("169.254.21.5")), + new IpConfigurationBgpPeeringAddress().withIpconfigurationId("Instance1") + .withCustomBgpIpAddresses(Arrays.asList("169.254.21.10"))))) + .withEnableBgpRouteTranslationForNat(false) + .withIsRoutingPreferenceInternet(false) + .withNatRules(Arrays.asList(new VpnGatewayNatRuleInner().withName("nat03") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("0.0.0.0/26"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.0.0/26"))) + .withIpConfigurationId(""))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VpnGateways_Delete + +```java +/** + * Samples for VpnGateways Delete. + */ +public final class VpnGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayDelete.json + */ + /** + * Sample code: VpnGatewayDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().delete("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_GetByResourceGroup + +```java +/** + * Samples for VpnGateways GetByResourceGroup. + */ +public final class VpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayGet.json + */ + /** + * Sample code: VpnGatewayGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().getByResourceGroupWithResponse("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_List + +```java +/** + * Samples for VpnGateways List. + */ +public final class VpnGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayList.json + */ + /** + * Sample code: VpnGatewayListBySubscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnGatewayListBySubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_ListByResourceGroup + +```java +/** + * Samples for VpnGateways ListByResourceGroup. + */ +public final class VpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayListByResourceGroup + * .json + */ + /** + * Sample code: VpnGatewayListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnGatewayListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_Reset + +```java +/** + * Samples for VpnGateways Reset. + */ +public final class VpnGatewaysResetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayReset.json + */ + /** + * Sample code: ResetVpnGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().reset("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_StartPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; + +/** + * Samples for VpnGateways StartPacketCapture. + */ +public final class VpnGatewaysStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnGatewayStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on vpn gateway with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void + startPacketCaptureOnVpnGatewayWithFilter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways() + .startPacketCapture("rg1", "vpngw", new VpnGatewayPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayStartPacketCapture. + * json + */ + /** + * Sample code: Start packet capture on vpn gateway without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnGatewayWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().startPacketCapture("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_StopPacketCapture + +```java +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; + +/** + * Samples for VpnGateways StopPacketCapture. + */ +public final class VpnGatewaysStopPacketCaptureSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayStopPacketCapture. + * json + */ + /** + * Sample code: Stop packet capture on vpn gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + stopPacketCaptureOnVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways() + .stopPacketCapture("rg1", "vpngw", new VpnGatewayPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnGateways_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VpnGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnGateways UpdateTags. + */ +public final class VpnGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayUpdateTags.json + */ + /** + * Sample code: VpnGatewayUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VpnGateway resource = manager.vpnGateways() + .getByResourceGroupWithResponse("rg1", "gateway1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VpnLinkConnections_GetAllSharedKeys + +```java +/** + * Samples for VpnLinkConnections GetAllSharedKeys. + */ +public final class VpnLinkConnectionsGetAllSharedKeysSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionSharedKeysGet.json + */ + /** + * Sample code: VpnSiteLinkConnectionSharedKeysGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionSharedKeysGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .getAllSharedKeys("rg1", "gateway1", "vpnConnection1", "Connection-Link1", + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnLinkConnections_GetDefaultSharedKey + +```java +/** + * Samples for VpnLinkConnections GetDefaultSharedKey. + */ +public final class VpnLinkConnectionsGetDefaultSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionDefaultSharedKeyGet.json + */ + /** + * Sample code: VpnSiteLinkConnectionDefaultSharedKeyGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionDefaultSharedKeyGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .getDefaultSharedKeyWithResponse("rg1", "gateway1", "vpnConnection1", "Connection-Link1", + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnLinkConnections_GetIkeSas + +```java +/** + * Samples for VpnLinkConnections GetIkeSas. + */ +public final class VpnLinkConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionGetIkeSas.json + */ + /** + * Sample code: GetVpnLinkConnectionIkeSa. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVpnLinkConnectionIkeSa(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .getIkeSas("rg1", "gateway1", "vpnConnection1", "Connection-Link1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnLinkConnections_ListByVpnConnection + +```java +/** + * Samples for VpnLinkConnections ListByVpnConnection. + */ +public final class VpnLinkConnectionsListByVpnConnectionSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkConnectionList. + * json + */ + /** + * Sample code: VpnSiteLinkConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteLinkConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .listByVpnConnection("rg1", "gateway1", "vpnConnection1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnLinkConnections_ListDefaultSharedKey + +```java +/** + * Samples for VpnLinkConnections ListDefaultSharedKey. + */ +public final class VpnLinkConnectionsListDefaultSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionDefaultSharedKeyList.json + */ + /** + * Sample code: VpnSiteLinkConnectionDefaultSharedKeyList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionDefaultSharedKeyList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .listDefaultSharedKeyWithResponse("rg1", "gateway1", "vpnConnection1", "Connection-Link1", + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnLinkConnections_ResetConnection + +```java +/** + * Samples for VpnLinkConnections ResetConnection. + */ +public final class VpnLinkConnectionsResetConnectionSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkConnectionReset. + * json + */ + /** + * Sample code: ResetVpnLinkConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVpnLinkConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .resetConnection("rg1", "gateway1", "vpnConnection1", "Connection-Link1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnLinkConnections_SetOrInitDefaultSharedKey + +```java +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyResultInner; +import com.azure.resourcemanager.network.generated.models.SharedKeyProperties; + +/** + * Samples for VpnLinkConnections SetOrInitDefaultSharedKey. + */ +public final class VpnLinkConnectionsSetOrInitDefaultSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionDefaultSharedKeyPut.json + */ + /** + * Sample code: VpnSiteLinkConnectionDefaultSharedKeyPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionDefaultSharedKeyPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .setOrInitDefaultSharedKey( + "rg1", "gateway1", "vpnConnection1", "Connection-Link1", new ConnectionSharedKeyResultInner() + .withProperties(new SharedKeyProperties().withSharedKey("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } +} +``` + +### VpnServerConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +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.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnPolicyMemberAttributeType; +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.VpnServerConfigurationPolicyGroupMember; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnServerConfigurations CreateOrUpdate. + */ +public final class VpnServerConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationPut. + * json + */ + /** + * Sample code: VpnServerConfigurationCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations() + .define("vpnServerConfiguration1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVpnProtocols(Arrays.asList(VpnGatewayTunnelingProtocol.IKE_V2)) + .withVpnClientRootCertificates(Arrays.asList(new VpnServerConfigVpnClientRootCertificate() + .withName("vpnServerConfigVpnClientRootCert1") + .withPublicCertData( + "MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"))) + .withVpnClientRevokedCertificates(Arrays.asList( + new VpnServerConfigVpnClientRevokedCertificate().withName("vpnServerConfigVpnClientRevokedCert1") + .withThumbprint("83FFBFC8848B5A5836C94D0112367E16148A286F"))) + .withRadiusServerRootCertificates(Arrays.asList(new VpnServerConfigRadiusServerRootCertificate() + .withName("vpnServerConfigRadiusServerRootCer1") + .withPublicCertData( + "MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"))) + .withRadiusClientRootCertificates(Arrays.asList( + new VpnServerConfigRadiusClientRootCertificate().withName("vpnServerConfigRadiusClientRootCert1") + .withThumbprint("83FFBFC8848B5A5836C94D0112367E16148A286F"))) + .withVpnClientIpsecPolicies(Arrays.asList(new IpsecPolicy().withSaLifeTimeSeconds(86472) + .withSaDataSizeKilobytes(429497) + .withIpsecEncryption(IpsecEncryption.AES256) + .withIpsecIntegrity(IpsecIntegrity.SHA256) + .withIkeEncryption(IkeEncryption.AES256) + .withIkeIntegrity(IkeIntegrity.SHA384) + .withDhGroup(DhGroup.DHGROUP14) + .withPfsGroup(PfsGroup.PFS14))) + .withRadiusServers(Arrays.asList(new RadiusServer().withRadiusServerAddress("10.0.0.0") + .withRadiusServerScore(25L) + .withRadiusServerSecret("fakeTokenPlaceholder"))) + .withConfigurationPolicyGroups(Arrays.asList(new VpnServerConfigurationPolicyGroupInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1") + .withName("policyGroup1") + .withIsDefault(true) + .withPriority(0) + .withPolicyMembers(Arrays.asList(new VpnServerConfigurationPolicyGroupMember().withName("policy1") + .withAttributeType(VpnPolicyMemberAttributeType.RADIUS_AZURE_GROUP_ID) + .withAttributeValue("6ad1bd08"))), + new VpnServerConfigurationPolicyGroupInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2") + .withName("policyGroup2") + .withIsDefault(true) + .withPriority(0) + .withPolicyMembers(Arrays.asList(new VpnServerConfigurationPolicyGroupMember().withName("policy2") + .withAttributeType(VpnPolicyMemberAttributeType.CERTIFICATE_GROUP_ID) + .withAttributeValue("red.com"))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VpnServerConfigurations_Delete + +```java +/** + * Samples for VpnServerConfigurations Delete. + */ +public final class VpnServerConfigurationsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationDelete. + * json + */ + /** + * Sample code: VpnServerConfigurationDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations().delete("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnServerConfigurations_GetByResourceGroup + +```java +/** + * Samples for VpnServerConfigurations GetByResourceGroup. + */ +public final class VpnServerConfigurationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationGet. + * json + */ + /** + * Sample code: VpnServerConfigurationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnServerConfigurationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations() + .getByResourceGroupWithResponse("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnServerConfigurations_List + +```java +/** + * Samples for VpnServerConfigurations List. + */ +public final class VpnServerConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationList. + * json + */ + /** + * Sample code: VpnServerConfigurationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnServerConfigurationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VpnServerConfigurations_ListByResourceGroup + +```java +/** + * Samples for VpnServerConfigurations ListByResourceGroup. + */ +public final class VpnServerConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnServerConfigurationListByResourceGroup.json + */ + /** + * Sample code: VpnServerConfigurationListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnServerConfigurations_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VpnServerConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnServerConfigurations UpdateTags. + */ +public final class VpnServerConfigurationsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnServerConfigurationUpdateTags.json + */ + /** + * Sample code: VpnServerConfigurationUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VpnServerConfiguration resource = manager.vpnServerConfigurations() + .getByResourceGroupWithResponse("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VpnServerConfigurationsAssociatedWithVirtualWan_List + +```java +/** + * Samples for VpnServerConfigurationsAssociatedWithVirtualWan List. + */ +public final class VpnServerConfigurationsAssociatedWithVirtualWanListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GetVirtualWanVpnServerConfigurations.json + */ + /** + * Sample code: GetVirtualWanVpnServerConfigurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualWanVpnServerConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurationsAssociatedWithVirtualWans() + .list("rg1", "wan1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSiteLinkConnections_Get + +```java +/** + * Samples for VpnSiteLinkConnections Get. + */ +public final class VpnSiteLinkConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkConnectionGet.json + */ + /** + * Sample code: VpnSiteLinkConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteLinkConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSiteLinkConnections() + .getWithResponse("rg1", "gateway1", "vpnConnection1", "Connection-Link1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSiteLinks_Get + +```java +/** + * Samples for VpnSiteLinks Get. + */ +public final class VpnSiteLinksGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkGet.json + */ + /** + * Sample code: VpnSiteGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSiteLinks().getWithResponse("rg1", "vpnSite1", "vpnSiteLink1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSiteLinks_ListByVpnSite + +```java +/** + * Samples for VpnSiteLinks ListByVpnSite. + */ +public final class VpnSiteLinksListByVpnSiteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkListByVpnSite.json + */ + /** + * Sample code: VpnSiteLinkListByVpnSite. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteLinkListByVpnSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSiteLinks().listByVpnSite("rg1", "vpnSite1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSites_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.O365BreakOutCategoryPolicies; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnSites CreateOrUpdate. + */ +public final class VpnSitesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSitePut.json + */ + /** + * Sample code: VpnSiteCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites() + .define("vpnSite1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualWan(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1")) + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withIsSecuritySite(false) + .withVpnSiteLinks(Arrays.asList(new VpnSiteLinkInner().withName("vpnSiteLink1") + .withLinkProperties( + new VpnLinkProviderProperties().withLinkProviderName("vendor1").withLinkSpeedInMbps(0)) + .withIpAddress("50.50.50.56") + .withFqdn("link1.vpnsite1.contoso.com") + .withBgpProperties(new VpnLinkBgpSettings().withAsn(1234L).withBgpPeeringAddress("192.168.0.0")))) + .withO365Policy(new O365PolicyProperties().withBreakOutCategories( + new O365BreakOutCategoryPolicies().withAllow(true).withOptimize(true).withDefaultProperty(false))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VpnSites_Delete + +```java +/** + * Samples for VpnSites Delete. + */ +public final class VpnSitesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteDelete.json + */ + /** + * Sample code: VpnSiteDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().delete("rg1", "vpnSite1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSites_GetByResourceGroup + +```java +/** + * Samples for VpnSites GetByResourceGroup. + */ +public final class VpnSitesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteGet.json + */ + /** + * Sample code: VpnSiteGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().getByResourceGroupWithResponse("rg1", "vpnSite1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSites_List + +```java +/** + * Samples for VpnSites List. + */ +public final class VpnSitesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteList.json + */ + /** + * Sample code: VpnSiteList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().list(com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSites_ListByResourceGroup + +```java +/** + * Samples for VpnSites ListByResourceGroup. + */ +public final class VpnSitesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteListByResourceGroup. + * json + */ + /** + * Sample code: VpnSiteListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### VpnSites_UpdateTags + +```java +import com.azure.resourcemanager.network.generated.models.VpnSite; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnSites UpdateTags. + */ +public final class VpnSitesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteUpdateTags.json + */ + /** + * Sample code: VpnSiteUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VpnSite resource = manager.vpnSites() + .getByResourceGroupWithResponse("rg1", "vpnSite1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VpnSitesConfiguration_Download + +```java +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; +import java.util.Arrays; + +/** + * Samples for VpnSitesConfiguration Download. + */ +public final class VpnSitesConfigurationDownloadSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSitesConfigurationDownload + * .json + */ + /** + * Sample code: VpnSitesConfigurationDownload. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSitesConfigurationDownload(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSitesConfigurations() + .download("rg1", "wan1", new GetVpnSitesConfigurationRequest() + .withVpnSites( + Arrays.asList("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/abc")) + .withOutputBlobSasUrl( + "https://blobcortextesturl.blob.core.windows.net/folderforconfig/vpnFile?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"), + com.azure.core.util.Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_CreateOrUpdate + +```java +import com.azure.resourcemanager.network.generated.models.ActionType; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRateLimitDuration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallUserSessionVariable; +import com.azure.resourcemanager.network.generated.models.ExceptionEntry; +import com.azure.resourcemanager.network.generated.models.ExceptionEntryMatchVariable; +import com.azure.resourcemanager.network.generated.models.ExceptionEntrySelectorMatchOperator; +import com.azure.resourcemanager.network.generated.models.ExceptionEntryValueMatchOperator; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRule; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleGroup; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleSet; +import com.azure.resourcemanager.network.generated.models.GroupByUserSession; +import com.azure.resourcemanager.network.generated.models.GroupByVariable; +import com.azure.resourcemanager.network.generated.models.ManagedRuleEnabledState; +import com.azure.resourcemanager.network.generated.models.ManagedRuleGroupOverride; +import com.azure.resourcemanager.network.generated.models.ManagedRuleOverride; +import com.azure.resourcemanager.network.generated.models.ManagedRuleSet; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.MatchCondition; +import com.azure.resourcemanager.network.generated.models.MatchVariable; +import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntry; +import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntryMatchVariable; +import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntrySelectorMatchOperator; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.PolicySettingsLogScrubbing; +import com.azure.resourcemanager.network.generated.models.ScrubbingRuleEntryMatchOperator; +import com.azure.resourcemanager.network.generated.models.ScrubbingRuleEntryMatchVariable; +import com.azure.resourcemanager.network.generated.models.ScrubbingRuleEntryState; +import com.azure.resourcemanager.network.generated.models.SensitivityType; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallAction; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallMatchVariable; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallOperator; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallRuleType; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallScrubbingRules; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallScrubbingState; +import java.util.Arrays; + +/** + * Samples for WebApplicationFirewallPolicies CreateOrUpdate. + */ +public final class WebApplicationFirewallPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafPolicyCreateOrUpdate.json + */ + /** + * Sample code: Creates or updates a WAF policy within a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void createsOrUpdatesAWAFPolicyWithinAResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies() + .define("Policy1") + .withRegion("WestUs") + .withExistingResourceGroup("rg1") + .withPolicySettings(new PolicySettings() + .withLogScrubbing( + new PolicySettingsLogScrubbing().withState(WebApplicationFirewallScrubbingState.ENABLED) + .withScrubbingRules(Arrays.asList( + new WebApplicationFirewallScrubbingRules() + .withMatchVariable(ScrubbingRuleEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(ScrubbingRuleEntryMatchOperator.EQUALS) + .withSelector("test") + .withState(ScrubbingRuleEntryState.ENABLED), + new WebApplicationFirewallScrubbingRules() + .withMatchVariable(ScrubbingRuleEntryMatchVariable.REQUEST_IPADDRESS) + .withSelectorMatchOperator(ScrubbingRuleEntryMatchOperator.EQUALS_ANY) + .withState(ScrubbingRuleEntryState.ENABLED)))) + .withJsChallengeCookieExpirationInMins(100)) + .withCustomRules( + Arrays + .asList( + new WebApplicationFirewallCustomRule().withName("Rule1") + .withPriority(1) + .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE) + .withMatchConditions(Arrays.asList(new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withMatchValues(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")))) + .withAction(WebApplicationFirewallAction.BLOCK), + new WebApplicationFirewallCustomRule().withName("Rule2") + .withPriority(2) + .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE) + .withMatchConditions(Arrays.asList( + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withMatchValues(Arrays.asList("192.168.1.0/24")), + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REQUEST_HEADERS) + .withSelector("UserAgent"))) + .withOperator(WebApplicationFirewallOperator.CONTAINS) + .withMatchValues(Arrays.asList("Windows")))) + .withAction(WebApplicationFirewallAction.BLOCK), + new WebApplicationFirewallCustomRule().withName("RateLimitRule3") + .withPriority(3) + .withRateLimitDuration(ApplicationGatewayFirewallRateLimitDuration.ONE_MIN) + .withRateLimitThreshold(10) + .withRuleType(WebApplicationFirewallRuleType.RATE_LIMIT_RULE) + .withMatchConditions(Arrays.asList(new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withNegationConditon(true) + .withMatchValues(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")))) + .withGroupByUserSession( + Arrays.asList( + new GroupByUserSession().withGroupByVariables(Arrays.asList(new GroupByVariable() + .withVariableName(ApplicationGatewayFirewallUserSessionVariable.CLIENT_ADDR))))) + .withAction(WebApplicationFirewallAction.BLOCK), + new WebApplicationFirewallCustomRule().withName("Rule4") + .withPriority(4) + .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE) + .withMatchConditions(Arrays.asList( + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withMatchValues(Arrays.asList("192.168.1.0/24")), + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REQUEST_HEADERS) + .withSelector("UserAgent"))) + .withOperator(WebApplicationFirewallOperator.CONTAINS) + .withMatchValues(Arrays.asList("Bot")))) + .withAction(WebApplicationFirewallAction.JSCHALLENGE))) + .withManagedRules(new ManagedRulesDefinition() + .withExceptions(Arrays.asList(new ExceptionEntry() + .withMatchVariable(ExceptionEntryMatchVariable.REQUEST_URI) + .withValues(Arrays.asList("health", "account/images", "default.aspx")) + .withValueMatchOperator(ExceptionEntryValueMatchOperator.CONTAINS) + .withExceptionManagedRuleSets(Arrays.asList(new ExclusionManagedRuleSet() + .withRuleSetType("OWASP") + .withRuleSetVersion("3.2"))), + new ExceptionEntry().withMatchVariable(ExceptionEntryMatchVariable.REQUEST_HEADER) + .withValues(Arrays.asList("Mozilla/5.0", "Chrome/122.0.0.0")) + .withValueMatchOperator(ExceptionEntryValueMatchOperator.CONTAINS) + .withSelectorMatchOperator(ExceptionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("User-Agent") + .withExceptionManagedRuleSets( + Arrays.asList(new ExclusionManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.2") + .withRuleGroups(Arrays.asList(new ExclusionManagedRuleGroup() + .withRuleGroupName("REQUEST-932-APPLICATION-ATTACK-RCE"))))), + new ExceptionEntry().withMatchVariable(ExceptionEntryMatchVariable.REMOTE_ADDR) + .withValues(Arrays.asList("1.2.3.4", "10.0.0.1/6")) + .withValueMatchOperator(ExceptionEntryValueMatchOperator.IPMATCH) + .withExceptionManagedRuleSets(Arrays.asList(new ExclusionManagedRuleSet() + .withRuleSetType("Microsoft_BotManagerRuleSet") + .withRuleSetVersion("1.0") + .withRuleGroups(Arrays.asList(new ExclusionManagedRuleGroup().withRuleGroupName("BadBots") + .withRules(Arrays.asList(new ExclusionManagedRule().withRuleId("100100"))))))))) + .withExclusions( + Arrays + .asList( + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("hello") + .withExclusionManagedRuleSets( + Arrays + .asList( + new ExclusionManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.2") + .withRuleGroups(Arrays.asList( + new ExclusionManagedRuleGroup() + .withRuleGroupName("REQUEST-930-APPLICATION-ATTACK-LFI") + .withRules(Arrays + .asList(new ExclusionManagedRule().withRuleId("930120"))), + new ExclusionManagedRuleGroup() + .withRuleGroupName("REQUEST-932-APPLICATION-ATTACK-RCE"))))), + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.ENDS_WITH) + .withSelector("hello") + .withExclusionManagedRuleSets( + Arrays.asList(new ExclusionManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.1") + .withRuleGroups(Arrays.asList()))), + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("test"), + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_VALUES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("test"))) + .withManagedRuleSets( + Arrays + .asList( + new ManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.2") + .withRuleGroupOverrides(Arrays.asList(new ManagedRuleGroupOverride() + .withRuleGroupName("REQUEST-931-APPLICATION-ATTACK-RFI") + .withRules(Arrays.asList( + new ManagedRuleOverride().withRuleId("931120") + .withState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.LOG), + new ManagedRuleOverride().withRuleId("931130") + .withState(ManagedRuleEnabledState.DISABLED) + .withAction(ActionType.ANOMALY_SCORING))))), + new ManagedRuleSet().withRuleSetType("Microsoft_BotManagerRuleSet") + .withRuleSetVersion("1.0") + .withRuleGroupOverrides( + Arrays.asList(new ManagedRuleGroupOverride().withRuleGroupName("UnknownBots") + .withRules(Arrays.asList(new ManagedRuleOverride().withRuleId("300700") + .withState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.JSCHALLENGE))))), + new ManagedRuleSet().withRuleSetType("Microsoft_HTTPDDoSRuleSet") + .withRuleSetVersion("1.0") + .withRuleGroupOverrides( + Arrays.asList(new ManagedRuleGroupOverride().withRuleGroupName("ExcessiveRequests") + .withRules(Arrays.asList(new ManagedRuleOverride().withRuleId("500100") + .withState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.BLOCK) + .withSensitivity(SensitivityType.HIGH)))))))) + .create(); + } +} +``` + +### WebApplicationFirewallPolicies_Delete + +```java +/** + * Samples for WebApplicationFirewallPolicies Delete. + */ +public final class WebApplicationFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafPolicyDelete.json + */ + /** + * Sample code: Deletes a WAF policy within a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesAWAFPolicyWithinAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies().delete("rg1", "Policy1", com.azure.core.util.Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_GetByResourceGroup + +```java +/** + * Samples for WebApplicationFirewallPolicies GetByResourceGroup. + */ +public final class WebApplicationFirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafPolicyGet.json + */ + /** + * Sample code: Gets a WAF policy within a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsAWAFPolicyWithinAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies() + .getByResourceGroupWithResponse("rg1", "Policy1", com.azure.core.util.Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_List + +```java +/** + * Samples for WebApplicationFirewallPolicies List. + */ +public final class WebApplicationFirewallPoliciesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafListAllPolicies.json + */ + /** + * Sample code: Lists all WAF policies in a subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listsAllWAFPoliciesInASubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies().list(com.azure.core.util.Context.NONE); + } +} +``` + +### WebApplicationFirewallPolicies_ListByResourceGroup + +```java +/** + * Samples for WebApplicationFirewallPolicies ListByResourceGroup. + */ +public final class WebApplicationFirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafListPolicies.json + */ + /** + * Sample code: Lists all WAF policies in a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listsAllWAFPoliciesInAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} +``` + +### WebCategories_Get + +```java +/** + * Samples for WebCategories Get. + */ +public final class WebCategoriesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureWebCategoryGet.json + */ + /** + * Sample code: Get Azure Web Category by name. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureWebCategoryByName(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webCategories().getWithResponse("Arts", null, com.azure.core.util.Context.NONE); + } +} +``` + +### WebCategories_List + +```java +/** + * Samples for WebCategories List. + */ +public final class WebCategoriesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureWebCategoriesListBySubscription.json + */ + /** + * Sample code: List all Azure Web Categories for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllAzureWebCategoriesForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webCategories().list(com.azure.core.util.Context.NONE); + } +} +``` + 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..13b86a2b2d4f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/pom.xml @@ -0,0 +1,63 @@ + + + 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-2024-03. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + false + + + + com.azure + azure-core + 1.54.0 + + + com.azure + azure-core-management + 1.15.5 + + + 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..f5259cb7c3d7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/NetworkManager.java @@ -0,0 +1,2586 @@ +// Copyright (c) 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.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagementClient; +import com.azure.resourcemanager.network.generated.implementation.AdminRuleCollectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.AdminRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateLinkResourcesImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayWafDynamicManifestsDefaultsImpl; +import com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayWafDynamicManifestsImpl; +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.ConfigurationPolicyGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.ConnectionMonitorsImpl; +import com.azure.resourcemanager.network.generated.implementation.ConnectivityConfigurationsImpl; +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.ExpressRoutePortAuthorizationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsLocationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteProviderPortsLocationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ExpressRouteServiceProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPoliciesImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyDeploymentsImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyDraftsImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesFilterValuesImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesOverridesImpl; +import com.azure.resourcemanager.network.generated.implementation.FirewallPolicyRuleCollectionGroupDraftsImpl; +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.ManagementGroupNetworkManagerConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.NatGatewaysImpl; +import com.azure.resourcemanager.network.generated.implementation.NatRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkGroupsImpl; +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.NetworkManagerCommitsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkManagerDeploymentStatusOperationsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkManagerRoutingConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkManagersImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkProfilesImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkSecurityGroupsImpl; +import com.azure.resourcemanager.network.generated.implementation.NetworkVirtualApplianceConnectionsImpl; +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.RouteMapsImpl; +import com.azure.resourcemanager.network.generated.implementation.RouteTablesImpl; +import com.azure.resourcemanager.network.generated.implementation.RoutesImpl; +import com.azure.resourcemanager.network.generated.implementation.RoutingIntentsImpl; +import com.azure.resourcemanager.network.generated.implementation.RoutingRuleCollectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.RoutingRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.ScopeConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityAdminConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityPartnerProvidersImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityRulesImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityUserConfigurationsImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityUserRuleCollectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.SecurityUserRulesImpl; +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.ServiceTagInformationsImpl; +import com.azure.resourcemanager.network.generated.implementation.ServiceTagsImpl; +import com.azure.resourcemanager.network.generated.implementation.StaticMembersImpl; +import com.azure.resourcemanager.network.generated.implementation.SubnetsImpl; +import com.azure.resourcemanager.network.generated.implementation.SubscriptionNetworkManagerConnectionsImpl; +import com.azure.resourcemanager.network.generated.implementation.UsagesImpl; +import com.azure.resourcemanager.network.generated.implementation.VipSwapsImpl; +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.AdminRuleCollections; +import com.azure.resourcemanager.network.generated.models.AdminRules; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnections; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkResources; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifests; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifestsDefaults; +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.ConfigurationPolicyGroups; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitors; +import com.azure.resourcemanager.network.generated.models.ConnectivityConfigurations; +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.ExpressRoutePortAuthorizations; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePorts; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteProviderPortsLocations; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviders; +import com.azure.resourcemanager.network.generated.models.FirewallPolicies; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyDeployments; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyDrafts; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignatures; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesFilterValues; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesOverrides; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroupDrafts; +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.ManagementGroupNetworkManagerConnections; +import com.azure.resourcemanager.network.generated.models.NatGateways; +import com.azure.resourcemanager.network.generated.models.NatRules; +import com.azure.resourcemanager.network.generated.models.NetworkGroups; +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.NetworkManagerCommits; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusOperations; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingConfigurations; +import com.azure.resourcemanager.network.generated.models.NetworkManagers; +import com.azure.resourcemanager.network.generated.models.NetworkProfiles; +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroups; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceConnections; +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.RouteMaps; +import com.azure.resourcemanager.network.generated.models.RouteTables; +import com.azure.resourcemanager.network.generated.models.Routes; +import com.azure.resourcemanager.network.generated.models.RoutingIntents; +import com.azure.resourcemanager.network.generated.models.RoutingRuleCollections; +import com.azure.resourcemanager.network.generated.models.RoutingRules; +import com.azure.resourcemanager.network.generated.models.ScopeConnections; +import com.azure.resourcemanager.network.generated.models.SecurityAdminConfigurations; +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProviders; +import com.azure.resourcemanager.network.generated.models.SecurityRules; +import com.azure.resourcemanager.network.generated.models.SecurityUserConfigurations; +import com.azure.resourcemanager.network.generated.models.SecurityUserRuleCollections; +import com.azure.resourcemanager.network.generated.models.SecurityUserRules; +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.ServiceTagInformations; +import com.azure.resourcemanager.network.generated.models.ServiceTags; +import com.azure.resourcemanager.network.generated.models.StaticMembers; +import com.azure.resourcemanager.network.generated.models.Subnets; +import com.azure.resourcemanager.network.generated.models.SubscriptionNetworkManagerConnections; +import com.azure.resourcemanager.network.generated.models.Usages; +import com.azure.resourcemanager.network.generated.models.VipSwaps; +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; +import java.util.stream.Collectors; + +/** + * Entry point to NetworkManager. + * Network Client. + */ +public final class NetworkManager { + private ApplicationGateways applicationGateways; + + private ApplicationGatewayPrivateLinkResources applicationGatewayPrivateLinkResources; + + private ApplicationGatewayPrivateEndpointConnections applicationGatewayPrivateEndpointConnections; + + private ApplicationGatewayWafDynamicManifestsDefaults applicationGatewayWafDynamicManifestsDefaults; + + private ApplicationGatewayWafDynamicManifests applicationGatewayWafDynamicManifests; + + 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 VipSwaps vipSwaps; + + 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 ExpressRoutePortAuthorizations expressRoutePortAuthorizations; + + private ExpressRouteProviderPortsLocations expressRouteProviderPortsLocations; + + private FirewallPolicies firewallPolicies; + + private FirewallPolicyRuleCollectionGroups firewallPolicyRuleCollectionGroups; + + private FirewallPolicyIdpsSignatures firewallPolicyIdpsSignatures; + + private FirewallPolicyIdpsSignaturesOverrides firewallPolicyIdpsSignaturesOverrides; + + private FirewallPolicyIdpsSignaturesFilterValues firewallPolicyIdpsSignaturesFilterValues; + + private FirewallPolicyDrafts firewallPolicyDrafts; + + private FirewallPolicyDeployments firewallPolicyDeployments; + + private FirewallPolicyRuleCollectionGroupDrafts firewallPolicyRuleCollectionGroupDrafts; + + 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 NetworkManagers networkManagers; + + private NetworkManagerCommits networkManagerCommits; + + private NetworkManagerDeploymentStatusOperations networkManagerDeploymentStatusOperations; + + private SubscriptionNetworkManagerConnections subscriptionNetworkManagerConnections; + + private ManagementGroupNetworkManagerConnections managementGroupNetworkManagerConnections; + + private ConnectivityConfigurations connectivityConfigurations; + + private NetworkGroups networkGroups; + + private StaticMembers staticMembers; + + private ScopeConnections scopeConnections; + + private SecurityAdminConfigurations securityAdminConfigurations; + + private AdminRuleCollections adminRuleCollections; + + private AdminRules adminRules; + + private SecurityUserConfigurations securityUserConfigurations; + + private SecurityUserRuleCollections securityUserRuleCollections; + + private SecurityUserRules securityUserRules; + + private NetworkManagerRoutingConfigurations networkManagerRoutingConfigurations; + + private RoutingRuleCollections routingRuleCollections; + + private RoutingRules routingRules; + + 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 ServiceTagInformations serviceTagInformations; + + 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 ConfigurationPolicyGroups configurationPolicyGroups; + + private VirtualHubs virtualHubs; + + private RouteMaps routeMaps; + + 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 NetworkVirtualApplianceConnections networkVirtualApplianceConnections; + + private VirtualHubBgpConnections virtualHubBgpConnections; + + private VirtualHubIpConfigurations virtualHubIpConfigurations; + + private HubRouteTables hubRouteTables; + + private RoutingIntents routingIntents; + + 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); + } + + /** + * Creates an instance of Network service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Network service API instance. + */ + public static NetworkManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new NetworkManager(httpPipeline, profile, null); + } + + /** + * 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 static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of 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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new NetworkManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ApplicationGateways. It manages ApplicationGateway. + * + * @return Resource collection API of ApplicationGateways. + */ + public ApplicationGateways applicationGateways() { + if (this.applicationGateways == null) { + this.applicationGateways = new ApplicationGatewaysImpl(clientObject.getApplicationGateways(), this); + } + return applicationGateways; + } + + /** + * Gets the resource collection API of ApplicationGatewayPrivateLinkResources. + * + * @return Resource collection API of ApplicationGatewayPrivateLinkResources. + */ + public ApplicationGatewayPrivateLinkResources applicationGatewayPrivateLinkResources() { + if (this.applicationGatewayPrivateLinkResources == null) { + this.applicationGatewayPrivateLinkResources = new ApplicationGatewayPrivateLinkResourcesImpl( + clientObject.getApplicationGatewayPrivateLinkResources(), this); + } + return applicationGatewayPrivateLinkResources; + } + + /** + * Gets the resource collection API of ApplicationGatewayPrivateEndpointConnections. + * + * @return Resource collection API of ApplicationGatewayPrivateEndpointConnections. + */ + public ApplicationGatewayPrivateEndpointConnections applicationGatewayPrivateEndpointConnections() { + if (this.applicationGatewayPrivateEndpointConnections == null) { + this.applicationGatewayPrivateEndpointConnections = new ApplicationGatewayPrivateEndpointConnectionsImpl( + clientObject.getApplicationGatewayPrivateEndpointConnections(), this); + } + return applicationGatewayPrivateEndpointConnections; + } + + /** + * Gets the resource collection API of ApplicationGatewayWafDynamicManifestsDefaults. + * + * @return Resource collection API of ApplicationGatewayWafDynamicManifestsDefaults. + */ + public ApplicationGatewayWafDynamicManifestsDefaults applicationGatewayWafDynamicManifestsDefaults() { + if (this.applicationGatewayWafDynamicManifestsDefaults == null) { + this.applicationGatewayWafDynamicManifestsDefaults = new ApplicationGatewayWafDynamicManifestsDefaultsImpl( + clientObject.getApplicationGatewayWafDynamicManifestsDefaults(), this); + } + return applicationGatewayWafDynamicManifestsDefaults; + } + + /** + * Gets the resource collection API of ApplicationGatewayWafDynamicManifests. + * + * @return Resource collection API of ApplicationGatewayWafDynamicManifests. + */ + public ApplicationGatewayWafDynamicManifests applicationGatewayWafDynamicManifests() { + if (this.applicationGatewayWafDynamicManifests == null) { + this.applicationGatewayWafDynamicManifests = new ApplicationGatewayWafDynamicManifestsImpl( + clientObject.getApplicationGatewayWafDynamicManifests(), this); + } + return applicationGatewayWafDynamicManifests; + } + + /** + * Gets the resource collection API of ApplicationSecurityGroups. It manages ApplicationSecurityGroup. + * + * @return Resource collection API of ApplicationSecurityGroups. + */ + public ApplicationSecurityGroups applicationSecurityGroups() { + if (this.applicationSecurityGroups == null) { + this.applicationSecurityGroups + = new ApplicationSecurityGroupsImpl(clientObject.getApplicationSecurityGroups(), this); + } + return applicationSecurityGroups; + } + + /** + * Gets the resource collection API of AvailableDelegations. + * + * @return Resource collection API of AvailableDelegations. + */ + public AvailableDelegations availableDelegations() { + if (this.availableDelegations == null) { + this.availableDelegations = new AvailableDelegationsImpl(clientObject.getAvailableDelegations(), this); + } + return availableDelegations; + } + + /** + * Gets the resource collection API of AvailableResourceGroupDelegations. + * + * @return Resource collection API of AvailableResourceGroupDelegations. + */ + public AvailableResourceGroupDelegations availableResourceGroupDelegations() { + if (this.availableResourceGroupDelegations == null) { + this.availableResourceGroupDelegations + = new AvailableResourceGroupDelegationsImpl(clientObject.getAvailableResourceGroupDelegations(), this); + } + return availableResourceGroupDelegations; + } + + /** + * Gets the resource collection API of AvailableServiceAliases. + * + * @return Resource collection API of AvailableServiceAliases. + */ + public AvailableServiceAliases availableServiceAliases() { + if (this.availableServiceAliases == null) { + this.availableServiceAliases + = new AvailableServiceAliasesImpl(clientObject.getAvailableServiceAliases(), this); + } + return availableServiceAliases; + } + + /** + * Gets the resource collection API of AzureFirewalls. It manages AzureFirewall. + * + * @return Resource collection API of AzureFirewalls. + */ + public AzureFirewalls azureFirewalls() { + if (this.azureFirewalls == null) { + this.azureFirewalls = new AzureFirewallsImpl(clientObject.getAzureFirewalls(), this); + } + return azureFirewalls; + } + + /** + * Gets the resource collection API of AzureFirewallFqdnTags. + * + * @return Resource collection API of AzureFirewallFqdnTags. + */ + public AzureFirewallFqdnTags azureFirewallFqdnTags() { + if (this.azureFirewallFqdnTags == null) { + this.azureFirewallFqdnTags = new AzureFirewallFqdnTagsImpl(clientObject.getAzureFirewallFqdnTags(), this); + } + return azureFirewallFqdnTags; + } + + /** + * Gets the resource collection API of WebCategories. + * + * @return Resource collection API of WebCategories. + */ + public WebCategories webCategories() { + if (this.webCategories == null) { + this.webCategories = new WebCategoriesImpl(clientObject.getWebCategories(), this); + } + return webCategories; + } + + /** + * Gets the resource collection API of BastionHosts. It manages BastionHost. + * + * @return Resource collection API of BastionHosts. + */ + public BastionHosts bastionHosts() { + if (this.bastionHosts == null) { + this.bastionHosts = new BastionHostsImpl(clientObject.getBastionHosts(), this); + } + return bastionHosts; + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of NetworkInterfaces. It manages NetworkInterface. + * + * @return Resource collection API of NetworkInterfaces. + */ + public NetworkInterfaces networkInterfaces() { + if (this.networkInterfaces == null) { + this.networkInterfaces = new NetworkInterfacesImpl(clientObject.getNetworkInterfaces(), this); + } + return networkInterfaces; + } + + /** + * Gets the resource collection API of PublicIpAddresses. It manages PublicIpAddress. + * + * @return Resource collection API of PublicIpAddresses. + */ + public PublicIpAddresses publicIpAddresses() { + if (this.publicIpAddresses == null) { + this.publicIpAddresses = new PublicIpAddressesImpl(clientObject.getPublicIpAddresses(), this); + } + return publicIpAddresses; + } + + /** + * Gets the resource collection API of VipSwaps. + * + * @return Resource collection API of VipSwaps. + */ + public VipSwaps vipSwaps() { + if (this.vipSwaps == null) { + this.vipSwaps = new VipSwapsImpl(clientObject.getVipSwaps(), this); + } + return vipSwaps; + } + + /** + * Gets the resource collection API of CustomIpPrefixes. It manages CustomIpPrefix. + * + * @return Resource collection API of CustomIpPrefixes. + */ + public CustomIpPrefixes customIpPrefixes() { + if (this.customIpPrefixes == null) { + this.customIpPrefixes = new CustomIpPrefixesImpl(clientObject.getCustomIpPrefixes(), this); + } + return customIpPrefixes; + } + + /** + * Gets the resource collection API of DdosCustomPolicies. It manages DdosCustomPolicy. + * + * @return Resource collection API of DdosCustomPolicies. + */ + public DdosCustomPolicies ddosCustomPolicies() { + if (this.ddosCustomPolicies == null) { + this.ddosCustomPolicies = new DdosCustomPoliciesImpl(clientObject.getDdosCustomPolicies(), this); + } + return ddosCustomPolicies; + } + + /** + * Gets the resource collection API of DdosProtectionPlans. It manages DdosProtectionPlan. + * + * @return Resource collection API of DdosProtectionPlans. + */ + public DdosProtectionPlans ddosProtectionPlans() { + if (this.ddosProtectionPlans == null) { + this.ddosProtectionPlans = new DdosProtectionPlansImpl(clientObject.getDdosProtectionPlans(), this); + } + return ddosProtectionPlans; + } + + /** + * Gets the resource collection API of DscpConfigurations. It manages DscpConfiguration. + * + * @return Resource collection API of DscpConfigurations. + */ + public DscpConfigurations dscpConfigurations() { + if (this.dscpConfigurations == null) { + this.dscpConfigurations = new DscpConfigurationsImpl(clientObject.getDscpConfigurations(), this); + } + return dscpConfigurations; + } + + /** + * Gets the resource collection API of AvailableEndpointServices. + * + * @return Resource collection API of AvailableEndpointServices. + */ + public AvailableEndpointServices availableEndpointServices() { + if (this.availableEndpointServices == null) { + this.availableEndpointServices + = new AvailableEndpointServicesImpl(clientObject.getAvailableEndpointServices(), this); + } + return availableEndpointServices; + } + + /** + * Gets the resource collection API of ExpressRouteCircuitAuthorizations. It manages + * ExpressRouteCircuitAuthorization. + * + * @return Resource collection API of ExpressRouteCircuitAuthorizations. + */ + public ExpressRouteCircuitAuthorizations expressRouteCircuitAuthorizations() { + if (this.expressRouteCircuitAuthorizations == null) { + this.expressRouteCircuitAuthorizations + = new ExpressRouteCircuitAuthorizationsImpl(clientObject.getExpressRouteCircuitAuthorizations(), this); + } + return expressRouteCircuitAuthorizations; + } + + /** + * Gets the resource collection API of ExpressRouteCircuitPeerings. It manages ExpressRouteCircuitPeering. + * + * @return Resource collection API of ExpressRouteCircuitPeerings. + */ + public ExpressRouteCircuitPeerings expressRouteCircuitPeerings() { + if (this.expressRouteCircuitPeerings == null) { + this.expressRouteCircuitPeerings + = new ExpressRouteCircuitPeeringsImpl(clientObject.getExpressRouteCircuitPeerings(), this); + } + return expressRouteCircuitPeerings; + } + + /** + * Gets the resource collection API of ExpressRouteCircuitConnections. It manages ExpressRouteCircuitConnection. + * + * @return Resource collection API of ExpressRouteCircuitConnections. + */ + public ExpressRouteCircuitConnections expressRouteCircuitConnections() { + if (this.expressRouteCircuitConnections == null) { + this.expressRouteCircuitConnections + = new ExpressRouteCircuitConnectionsImpl(clientObject.getExpressRouteCircuitConnections(), this); + } + return expressRouteCircuitConnections; + } + + /** + * Gets the resource collection API of PeerExpressRouteCircuitConnections. + * + * @return Resource collection API of PeerExpressRouteCircuitConnections. + */ + public PeerExpressRouteCircuitConnections peerExpressRouteCircuitConnections() { + if (this.peerExpressRouteCircuitConnections == null) { + this.peerExpressRouteCircuitConnections = new PeerExpressRouteCircuitConnectionsImpl( + clientObject.getPeerExpressRouteCircuitConnections(), this); + } + return peerExpressRouteCircuitConnections; + } + + /** + * Gets the resource collection API of ExpressRouteCircuits. It manages ExpressRouteCircuit. + * + * @return Resource collection API of ExpressRouteCircuits. + */ + public ExpressRouteCircuits expressRouteCircuits() { + if (this.expressRouteCircuits == null) { + this.expressRouteCircuits = new ExpressRouteCircuitsImpl(clientObject.getExpressRouteCircuits(), this); + } + return expressRouteCircuits; + } + + /** + * Gets the resource collection API of ExpressRouteServiceProviders. + * + * @return Resource collection API of ExpressRouteServiceProviders. + */ + public ExpressRouteServiceProviders expressRouteServiceProviders() { + if (this.expressRouteServiceProviders == null) { + this.expressRouteServiceProviders + = new ExpressRouteServiceProvidersImpl(clientObject.getExpressRouteServiceProviders(), this); + } + return expressRouteServiceProviders; + } + + /** + * Gets the resource collection API of ExpressRouteCrossConnections. It manages ExpressRouteCrossConnection. + * + * @return Resource collection API of ExpressRouteCrossConnections. + */ + public ExpressRouteCrossConnections expressRouteCrossConnections() { + if (this.expressRouteCrossConnections == null) { + this.expressRouteCrossConnections + = new ExpressRouteCrossConnectionsImpl(clientObject.getExpressRouteCrossConnections(), this); + } + return expressRouteCrossConnections; + } + + /** + * Gets the resource collection API of ExpressRouteCrossConnectionPeerings. + * + * @return Resource collection API of ExpressRouteCrossConnectionPeerings. + */ + public ExpressRouteCrossConnectionPeerings expressRouteCrossConnectionPeerings() { + if (this.expressRouteCrossConnectionPeerings == null) { + this.expressRouteCrossConnectionPeerings = new ExpressRouteCrossConnectionPeeringsImpl( + clientObject.getExpressRouteCrossConnectionPeerings(), this); + } + return expressRouteCrossConnectionPeerings; + } + + /** + * Gets the resource collection API of ExpressRoutePortsLocations. + * + * @return Resource collection API of ExpressRoutePortsLocations. + */ + public ExpressRoutePortsLocations expressRoutePortsLocations() { + if (this.expressRoutePortsLocations == null) { + this.expressRoutePortsLocations + = new ExpressRoutePortsLocationsImpl(clientObject.getExpressRoutePortsLocations(), this); + } + return expressRoutePortsLocations; + } + + /** + * Gets the resource collection API of ExpressRoutePorts. It manages ExpressRoutePort. + * + * @return Resource collection API of ExpressRoutePorts. + */ + public ExpressRoutePorts expressRoutePorts() { + if (this.expressRoutePorts == null) { + this.expressRoutePorts = new ExpressRoutePortsImpl(clientObject.getExpressRoutePorts(), this); + } + return expressRoutePorts; + } + + /** + * Gets the resource collection API of ExpressRouteLinks. + * + * @return Resource collection API of ExpressRouteLinks. + */ + public ExpressRouteLinks expressRouteLinks() { + if (this.expressRouteLinks == null) { + this.expressRouteLinks = new ExpressRouteLinksImpl(clientObject.getExpressRouteLinks(), this); + } + return expressRouteLinks; + } + + /** + * Gets the resource collection API of ExpressRoutePortAuthorizations. It manages ExpressRoutePortAuthorization. + * + * @return Resource collection API of ExpressRoutePortAuthorizations. + */ + public ExpressRoutePortAuthorizations expressRoutePortAuthorizations() { + if (this.expressRoutePortAuthorizations == null) { + this.expressRoutePortAuthorizations + = new ExpressRoutePortAuthorizationsImpl(clientObject.getExpressRoutePortAuthorizations(), this); + } + return expressRoutePortAuthorizations; + } + + /** + * Gets the resource collection API of ExpressRouteProviderPortsLocations. + * + * @return Resource collection API of ExpressRouteProviderPortsLocations. + */ + public ExpressRouteProviderPortsLocations expressRouteProviderPortsLocations() { + if (this.expressRouteProviderPortsLocations == null) { + this.expressRouteProviderPortsLocations = new ExpressRouteProviderPortsLocationsImpl( + clientObject.getExpressRouteProviderPortsLocations(), this); + } + return expressRouteProviderPortsLocations; + } + + /** + * Gets the resource collection API of FirewallPolicies. It manages FirewallPolicy. + * + * @return Resource collection API of FirewallPolicies. + */ + public FirewallPolicies firewallPolicies() { + if (this.firewallPolicies == null) { + this.firewallPolicies = new FirewallPoliciesImpl(clientObject.getFirewallPolicies(), this); + } + return firewallPolicies; + } + + /** + * Gets the resource collection API of FirewallPolicyRuleCollectionGroups. It manages + * FirewallPolicyRuleCollectionGroup. + * + * @return Resource collection API of FirewallPolicyRuleCollectionGroups. + */ + public FirewallPolicyRuleCollectionGroups firewallPolicyRuleCollectionGroups() { + if (this.firewallPolicyRuleCollectionGroups == null) { + this.firewallPolicyRuleCollectionGroups = new FirewallPolicyRuleCollectionGroupsImpl( + clientObject.getFirewallPolicyRuleCollectionGroups(), this); + } + return firewallPolicyRuleCollectionGroups; + } + + /** + * Gets the resource collection API of FirewallPolicyIdpsSignatures. + * + * @return Resource collection API of FirewallPolicyIdpsSignatures. + */ + public FirewallPolicyIdpsSignatures firewallPolicyIdpsSignatures() { + if (this.firewallPolicyIdpsSignatures == null) { + this.firewallPolicyIdpsSignatures + = new FirewallPolicyIdpsSignaturesImpl(clientObject.getFirewallPolicyIdpsSignatures(), this); + } + return firewallPolicyIdpsSignatures; + } + + /** + * Gets the resource collection API of FirewallPolicyIdpsSignaturesOverrides. + * + * @return Resource collection API of FirewallPolicyIdpsSignaturesOverrides. + */ + public FirewallPolicyIdpsSignaturesOverrides firewallPolicyIdpsSignaturesOverrides() { + if (this.firewallPolicyIdpsSignaturesOverrides == null) { + this.firewallPolicyIdpsSignaturesOverrides = new FirewallPolicyIdpsSignaturesOverridesImpl( + clientObject.getFirewallPolicyIdpsSignaturesOverrides(), this); + } + return firewallPolicyIdpsSignaturesOverrides; + } + + /** + * Gets the resource collection API of FirewallPolicyIdpsSignaturesFilterValues. + * + * @return Resource collection API of FirewallPolicyIdpsSignaturesFilterValues. + */ + public FirewallPolicyIdpsSignaturesFilterValues firewallPolicyIdpsSignaturesFilterValues() { + if (this.firewallPolicyIdpsSignaturesFilterValues == null) { + this.firewallPolicyIdpsSignaturesFilterValues = new FirewallPolicyIdpsSignaturesFilterValuesImpl( + clientObject.getFirewallPolicyIdpsSignaturesFilterValues(), this); + } + return firewallPolicyIdpsSignaturesFilterValues; + } + + /** + * Gets the resource collection API of FirewallPolicyDrafts. + * + * @return Resource collection API of FirewallPolicyDrafts. + */ + public FirewallPolicyDrafts firewallPolicyDrafts() { + if (this.firewallPolicyDrafts == null) { + this.firewallPolicyDrafts = new FirewallPolicyDraftsImpl(clientObject.getFirewallPolicyDrafts(), this); + } + return firewallPolicyDrafts; + } + + /** + * Gets the resource collection API of FirewallPolicyDeployments. + * + * @return Resource collection API of FirewallPolicyDeployments. + */ + public FirewallPolicyDeployments firewallPolicyDeployments() { + if (this.firewallPolicyDeployments == null) { + this.firewallPolicyDeployments + = new FirewallPolicyDeploymentsImpl(clientObject.getFirewallPolicyDeployments(), this); + } + return firewallPolicyDeployments; + } + + /** + * Gets the resource collection API of FirewallPolicyRuleCollectionGroupDrafts. + * + * @return Resource collection API of FirewallPolicyRuleCollectionGroupDrafts. + */ + public FirewallPolicyRuleCollectionGroupDrafts firewallPolicyRuleCollectionGroupDrafts() { + if (this.firewallPolicyRuleCollectionGroupDrafts == null) { + this.firewallPolicyRuleCollectionGroupDrafts = new FirewallPolicyRuleCollectionGroupDraftsImpl( + clientObject.getFirewallPolicyRuleCollectionGroupDrafts(), this); + } + return firewallPolicyRuleCollectionGroupDrafts; + } + + /** + * Gets the resource collection API of IpAllocations. It manages IpAllocation. + * + * @return Resource collection API of IpAllocations. + */ + public IpAllocations ipAllocations() { + if (this.ipAllocations == null) { + this.ipAllocations = new IpAllocationsImpl(clientObject.getIpAllocations(), this); + } + return ipAllocations; + } + + /** + * Gets the resource collection API of IpGroups. It manages IpGroup. + * + * @return Resource collection API of IpGroups. + */ + public IpGroups ipGroups() { + if (this.ipGroups == null) { + this.ipGroups = new IpGroupsImpl(clientObject.getIpGroups(), this); + } + return ipGroups; + } + + /** + * Gets the resource collection API of LoadBalancers. It manages LoadBalancer. + * + * @return Resource collection API of LoadBalancers. + */ + public LoadBalancers loadBalancers() { + if (this.loadBalancers == null) { + this.loadBalancers = new LoadBalancersImpl(clientObject.getLoadBalancers(), this); + } + return loadBalancers; + } + + /** + * Gets the resource collection API of LoadBalancerBackendAddressPools. It manages BackendAddressPool. + * + * @return Resource collection API of LoadBalancerBackendAddressPools. + */ + public LoadBalancerBackendAddressPools loadBalancerBackendAddressPools() { + if (this.loadBalancerBackendAddressPools == null) { + this.loadBalancerBackendAddressPools + = new LoadBalancerBackendAddressPoolsImpl(clientObject.getLoadBalancerBackendAddressPools(), this); + } + return loadBalancerBackendAddressPools; + } + + /** + * Gets the resource collection API of LoadBalancerFrontendIpConfigurations. + * + * @return Resource collection API of LoadBalancerFrontendIpConfigurations. + */ + public LoadBalancerFrontendIpConfigurations loadBalancerFrontendIpConfigurations() { + if (this.loadBalancerFrontendIpConfigurations == null) { + this.loadBalancerFrontendIpConfigurations = new LoadBalancerFrontendIpConfigurationsImpl( + clientObject.getLoadBalancerFrontendIpConfigurations(), this); + } + return loadBalancerFrontendIpConfigurations; + } + + /** + * Gets the resource collection API of InboundNatRules. It manages InboundNatRule. + * + * @return Resource collection API of InboundNatRules. + */ + public InboundNatRules inboundNatRules() { + if (this.inboundNatRules == null) { + this.inboundNatRules = new InboundNatRulesImpl(clientObject.getInboundNatRules(), this); + } + return inboundNatRules; + } + + /** + * Gets the resource collection API of LoadBalancerLoadBalancingRules. + * + * @return Resource collection API of LoadBalancerLoadBalancingRules. + */ + public LoadBalancerLoadBalancingRules loadBalancerLoadBalancingRules() { + if (this.loadBalancerLoadBalancingRules == null) { + this.loadBalancerLoadBalancingRules + = new LoadBalancerLoadBalancingRulesImpl(clientObject.getLoadBalancerLoadBalancingRules(), this); + } + return loadBalancerLoadBalancingRules; + } + + /** + * Gets the resource collection API of LoadBalancerOutboundRules. + * + * @return Resource collection API of LoadBalancerOutboundRules. + */ + public LoadBalancerOutboundRules loadBalancerOutboundRules() { + if (this.loadBalancerOutboundRules == null) { + this.loadBalancerOutboundRules + = new LoadBalancerOutboundRulesImpl(clientObject.getLoadBalancerOutboundRules(), this); + } + return loadBalancerOutboundRules; + } + + /** + * Gets the resource collection API of LoadBalancerNetworkInterfaces. + * + * @return Resource collection API of LoadBalancerNetworkInterfaces. + */ + public LoadBalancerNetworkInterfaces loadBalancerNetworkInterfaces() { + if (this.loadBalancerNetworkInterfaces == null) { + this.loadBalancerNetworkInterfaces + = new LoadBalancerNetworkInterfacesImpl(clientObject.getLoadBalancerNetworkInterfaces(), this); + } + return loadBalancerNetworkInterfaces; + } + + /** + * Gets the resource collection API of LoadBalancerProbes. + * + * @return Resource collection API of LoadBalancerProbes. + */ + public LoadBalancerProbes loadBalancerProbes() { + if (this.loadBalancerProbes == null) { + this.loadBalancerProbes = new LoadBalancerProbesImpl(clientObject.getLoadBalancerProbes(), this); + } + return loadBalancerProbes; + } + + /** + * Gets the resource collection API of NatGateways. It manages NatGateway. + * + * @return Resource collection API of NatGateways. + */ + public NatGateways natGateways() { + if (this.natGateways == null) { + this.natGateways = new NatGatewaysImpl(clientObject.getNatGateways(), this); + } + return natGateways; + } + + /** + * Gets the resource collection API of NetworkInterfaceIpConfigurations. + * + * @return Resource collection API of NetworkInterfaceIpConfigurations. + */ + public NetworkInterfaceIpConfigurations networkInterfaceIpConfigurations() { + if (this.networkInterfaceIpConfigurations == null) { + this.networkInterfaceIpConfigurations + = new NetworkInterfaceIpConfigurationsImpl(clientObject.getNetworkInterfaceIpConfigurations(), this); + } + return networkInterfaceIpConfigurations; + } + + /** + * Gets the resource collection API of NetworkInterfaceLoadBalancers. + * + * @return Resource collection API of NetworkInterfaceLoadBalancers. + */ + public NetworkInterfaceLoadBalancers networkInterfaceLoadBalancers() { + if (this.networkInterfaceLoadBalancers == null) { + this.networkInterfaceLoadBalancers + = new NetworkInterfaceLoadBalancersImpl(clientObject.getNetworkInterfaceLoadBalancers(), this); + } + return networkInterfaceLoadBalancers; + } + + /** + * Gets the resource collection API of NetworkInterfaceTapConfigurations. It manages + * NetworkInterfaceTapConfiguration. + * + * @return Resource collection API of NetworkInterfaceTapConfigurations. + */ + public NetworkInterfaceTapConfigurations networkInterfaceTapConfigurations() { + if (this.networkInterfaceTapConfigurations == null) { + this.networkInterfaceTapConfigurations + = new NetworkInterfaceTapConfigurationsImpl(clientObject.getNetworkInterfaceTapConfigurations(), this); + } + return networkInterfaceTapConfigurations; + } + + /** + * Gets the resource collection API of NetworkManagers. It manages NetworkManager. + * + * @return Resource collection API of NetworkManagers. + */ + public NetworkManagers networkManagers() { + if (this.networkManagers == null) { + this.networkManagers = new NetworkManagersImpl(clientObject.getNetworkManagers(), this); + } + return networkManagers; + } + + /** + * Gets the resource collection API of NetworkManagerCommits. + * + * @return Resource collection API of NetworkManagerCommits. + */ + public NetworkManagerCommits networkManagerCommits() { + if (this.networkManagerCommits == null) { + this.networkManagerCommits = new NetworkManagerCommitsImpl(clientObject.getNetworkManagerCommits(), this); + } + return networkManagerCommits; + } + + /** + * Gets the resource collection API of NetworkManagerDeploymentStatusOperations. + * + * @return Resource collection API of NetworkManagerDeploymentStatusOperations. + */ + public NetworkManagerDeploymentStatusOperations networkManagerDeploymentStatusOperations() { + if (this.networkManagerDeploymentStatusOperations == null) { + this.networkManagerDeploymentStatusOperations = new NetworkManagerDeploymentStatusOperationsImpl( + clientObject.getNetworkManagerDeploymentStatusOperations(), this); + } + return networkManagerDeploymentStatusOperations; + } + + /** + * Gets the resource collection API of SubscriptionNetworkManagerConnections. It manages NetworkManagerConnection. + * + * @return Resource collection API of SubscriptionNetworkManagerConnections. + */ + public SubscriptionNetworkManagerConnections subscriptionNetworkManagerConnections() { + if (this.subscriptionNetworkManagerConnections == null) { + this.subscriptionNetworkManagerConnections = new SubscriptionNetworkManagerConnectionsImpl( + clientObject.getSubscriptionNetworkManagerConnections(), this); + } + return subscriptionNetworkManagerConnections; + } + + /** + * Gets the resource collection API of ManagementGroupNetworkManagerConnections. + * + * @return Resource collection API of ManagementGroupNetworkManagerConnections. + */ + public ManagementGroupNetworkManagerConnections managementGroupNetworkManagerConnections() { + if (this.managementGroupNetworkManagerConnections == null) { + this.managementGroupNetworkManagerConnections = new ManagementGroupNetworkManagerConnectionsImpl( + clientObject.getManagementGroupNetworkManagerConnections(), this); + } + return managementGroupNetworkManagerConnections; + } + + /** + * Gets the resource collection API of ConnectivityConfigurations. It manages ConnectivityConfiguration. + * + * @return Resource collection API of ConnectivityConfigurations. + */ + public ConnectivityConfigurations connectivityConfigurations() { + if (this.connectivityConfigurations == null) { + this.connectivityConfigurations + = new ConnectivityConfigurationsImpl(clientObject.getConnectivityConfigurations(), this); + } + return connectivityConfigurations; + } + + /** + * Gets the resource collection API of NetworkGroups. It manages NetworkGroup. + * + * @return Resource collection API of NetworkGroups. + */ + public NetworkGroups networkGroups() { + if (this.networkGroups == null) { + this.networkGroups = new NetworkGroupsImpl(clientObject.getNetworkGroups(), this); + } + return networkGroups; + } + + /** + * Gets the resource collection API of StaticMembers. It manages StaticMember. + * + * @return Resource collection API of StaticMembers. + */ + public StaticMembers staticMembers() { + if (this.staticMembers == null) { + this.staticMembers = new StaticMembersImpl(clientObject.getStaticMembers(), this); + } + return staticMembers; + } + + /** + * Gets the resource collection API of ScopeConnections. It manages ScopeConnection. + * + * @return Resource collection API of ScopeConnections. + */ + public ScopeConnections scopeConnections() { + if (this.scopeConnections == null) { + this.scopeConnections = new ScopeConnectionsImpl(clientObject.getScopeConnections(), this); + } + return scopeConnections; + } + + /** + * Gets the resource collection API of SecurityAdminConfigurations. It manages SecurityAdminConfiguration. + * + * @return Resource collection API of SecurityAdminConfigurations. + */ + public SecurityAdminConfigurations securityAdminConfigurations() { + if (this.securityAdminConfigurations == null) { + this.securityAdminConfigurations + = new SecurityAdminConfigurationsImpl(clientObject.getSecurityAdminConfigurations(), this); + } + return securityAdminConfigurations; + } + + /** + * Gets the resource collection API of AdminRuleCollections. It manages AdminRuleCollection. + * + * @return Resource collection API of AdminRuleCollections. + */ + public AdminRuleCollections adminRuleCollections() { + if (this.adminRuleCollections == null) { + this.adminRuleCollections = new AdminRuleCollectionsImpl(clientObject.getAdminRuleCollections(), this); + } + return adminRuleCollections; + } + + /** + * Gets the resource collection API of AdminRules. + * + * @return Resource collection API of AdminRules. + */ + public AdminRules adminRules() { + if (this.adminRules == null) { + this.adminRules = new AdminRulesImpl(clientObject.getAdminRules(), this); + } + return adminRules; + } + + /** + * Gets the resource collection API of SecurityUserConfigurations. It manages SecurityUserConfiguration. + * + * @return Resource collection API of SecurityUserConfigurations. + */ + public SecurityUserConfigurations securityUserConfigurations() { + if (this.securityUserConfigurations == null) { + this.securityUserConfigurations + = new SecurityUserConfigurationsImpl(clientObject.getSecurityUserConfigurations(), this); + } + return securityUserConfigurations; + } + + /** + * Gets the resource collection API of SecurityUserRuleCollections. It manages SecurityUserRuleCollection. + * + * @return Resource collection API of SecurityUserRuleCollections. + */ + public SecurityUserRuleCollections securityUserRuleCollections() { + if (this.securityUserRuleCollections == null) { + this.securityUserRuleCollections + = new SecurityUserRuleCollectionsImpl(clientObject.getSecurityUserRuleCollections(), this); + } + return securityUserRuleCollections; + } + + /** + * Gets the resource collection API of SecurityUserRules. It manages SecurityUserRule. + * + * @return Resource collection API of SecurityUserRules. + */ + public SecurityUserRules securityUserRules() { + if (this.securityUserRules == null) { + this.securityUserRules = new SecurityUserRulesImpl(clientObject.getSecurityUserRules(), this); + } + return securityUserRules; + } + + /** + * Gets the resource collection API of NetworkManagerRoutingConfigurations. It manages + * NetworkManagerRoutingConfiguration. + * + * @return Resource collection API of NetworkManagerRoutingConfigurations. + */ + public NetworkManagerRoutingConfigurations networkManagerRoutingConfigurations() { + if (this.networkManagerRoutingConfigurations == null) { + this.networkManagerRoutingConfigurations = new NetworkManagerRoutingConfigurationsImpl( + clientObject.getNetworkManagerRoutingConfigurations(), this); + } + return networkManagerRoutingConfigurations; + } + + /** + * Gets the resource collection API of RoutingRuleCollections. It manages RoutingRuleCollection. + * + * @return Resource collection API of RoutingRuleCollections. + */ + public RoutingRuleCollections routingRuleCollections() { + if (this.routingRuleCollections == null) { + this.routingRuleCollections + = new RoutingRuleCollectionsImpl(clientObject.getRoutingRuleCollections(), this); + } + return routingRuleCollections; + } + + /** + * Gets the resource collection API of RoutingRules. It manages RoutingRule. + * + * @return Resource collection API of RoutingRules. + */ + public RoutingRules routingRules() { + if (this.routingRules == null) { + this.routingRules = new RoutingRulesImpl(clientObject.getRoutingRules(), this); + } + return routingRules; + } + + /** + * Gets the resource collection API of NetworkProfiles. It manages NetworkProfile. + * + * @return Resource collection API of NetworkProfiles. + */ + public NetworkProfiles networkProfiles() { + if (this.networkProfiles == null) { + this.networkProfiles = new NetworkProfilesImpl(clientObject.getNetworkProfiles(), this); + } + return networkProfiles; + } + + /** + * Gets the resource collection API of NetworkSecurityGroups. It manages NetworkSecurityGroup. + * + * @return Resource collection API of NetworkSecurityGroups. + */ + public NetworkSecurityGroups networkSecurityGroups() { + if (this.networkSecurityGroups == null) { + this.networkSecurityGroups = new NetworkSecurityGroupsImpl(clientObject.getNetworkSecurityGroups(), this); + } + return networkSecurityGroups; + } + + /** + * Gets the resource collection API of SecurityRules. It manages SecurityRule. + * + * @return Resource collection API of SecurityRules. + */ + public SecurityRules securityRules() { + if (this.securityRules == null) { + this.securityRules = new SecurityRulesImpl(clientObject.getSecurityRules(), this); + } + return securityRules; + } + + /** + * Gets the resource collection API of DefaultSecurityRules. + * + * @return Resource collection API of DefaultSecurityRules. + */ + public DefaultSecurityRules defaultSecurityRules() { + if (this.defaultSecurityRules == null) { + this.defaultSecurityRules = new DefaultSecurityRulesImpl(clientObject.getDefaultSecurityRules(), this); + } + return defaultSecurityRules; + } + + /** + * Gets the resource collection API of NetworkVirtualAppliances. It manages NetworkVirtualAppliance. + * + * @return Resource collection API of NetworkVirtualAppliances. + */ + public NetworkVirtualAppliances networkVirtualAppliances() { + if (this.networkVirtualAppliances == null) { + this.networkVirtualAppliances + = new NetworkVirtualAppliancesImpl(clientObject.getNetworkVirtualAppliances(), this); + } + return networkVirtualAppliances; + } + + /** + * Gets the resource collection API of VirtualApplianceSites. It manages VirtualApplianceSite. + * + * @return Resource collection API of VirtualApplianceSites. + */ + public VirtualApplianceSites virtualApplianceSites() { + if (this.virtualApplianceSites == null) { + this.virtualApplianceSites = new VirtualApplianceSitesImpl(clientObject.getVirtualApplianceSites(), this); + } + return virtualApplianceSites; + } + + /** + * Gets the resource collection API of VirtualApplianceSkus. + * + * @return Resource collection API of VirtualApplianceSkus. + */ + public VirtualApplianceSkus virtualApplianceSkus() { + if (this.virtualApplianceSkus == null) { + this.virtualApplianceSkus = new VirtualApplianceSkusImpl(clientObject.getVirtualApplianceSkus(), this); + } + return virtualApplianceSkus; + } + + /** + * Gets the resource collection API of InboundSecurityRuleOperations. It manages InboundSecurityRule. + * + * @return Resource collection API of InboundSecurityRuleOperations. + */ + public InboundSecurityRuleOperations inboundSecurityRuleOperations() { + if (this.inboundSecurityRuleOperations == null) { + this.inboundSecurityRuleOperations + = new InboundSecurityRuleOperationsImpl(clientObject.getInboundSecurityRuleOperations(), this); + } + return inboundSecurityRuleOperations; + } + + /** + * Gets the resource collection API of NetworkWatchers. It manages NetworkWatcher. + * + * @return Resource collection API of NetworkWatchers. + */ + public NetworkWatchers networkWatchers() { + if (this.networkWatchers == null) { + this.networkWatchers = new NetworkWatchersImpl(clientObject.getNetworkWatchers(), this); + } + return networkWatchers; + } + + /** + * Gets the resource collection API of PacketCaptures. + * + * @return Resource collection API of PacketCaptures. + */ + public PacketCaptures packetCaptures() { + if (this.packetCaptures == null) { + this.packetCaptures = new PacketCapturesImpl(clientObject.getPacketCaptures(), this); + } + return packetCaptures; + } + + /** + * Gets the resource collection API of ConnectionMonitors. It manages ConnectionMonitorResult. + * + * @return Resource collection API of ConnectionMonitors. + */ + public ConnectionMonitors connectionMonitors() { + if (this.connectionMonitors == null) { + this.connectionMonitors = new ConnectionMonitorsImpl(clientObject.getConnectionMonitors(), this); + } + return connectionMonitors; + } + + /** + * Gets the resource collection API of FlowLogs. It manages FlowLog. + * + * @return Resource collection API of FlowLogs. + */ + public FlowLogs flowLogs() { + if (this.flowLogs == null) { + this.flowLogs = new FlowLogsImpl(clientObject.getFlowLogs(), this); + } + return flowLogs; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of PrivateEndpoints. It manages PrivateEndpoint. + * + * @return Resource collection API of PrivateEndpoints. + */ + public PrivateEndpoints privateEndpoints() { + if (this.privateEndpoints == null) { + this.privateEndpoints = new PrivateEndpointsImpl(clientObject.getPrivateEndpoints(), this); + } + return privateEndpoints; + } + + /** + * Gets the resource collection API of AvailablePrivateEndpointTypes. + * + * @return Resource collection API of AvailablePrivateEndpointTypes. + */ + public AvailablePrivateEndpointTypes availablePrivateEndpointTypes() { + if (this.availablePrivateEndpointTypes == null) { + this.availablePrivateEndpointTypes + = new AvailablePrivateEndpointTypesImpl(clientObject.getAvailablePrivateEndpointTypes(), this); + } + return availablePrivateEndpointTypes; + } + + /** + * Gets the resource collection API of PrivateDnsZoneGroups. + * + * @return Resource collection API of PrivateDnsZoneGroups. + */ + public PrivateDnsZoneGroups privateDnsZoneGroups() { + if (this.privateDnsZoneGroups == null) { + this.privateDnsZoneGroups = new PrivateDnsZoneGroupsImpl(clientObject.getPrivateDnsZoneGroups(), this); + } + return privateDnsZoneGroups; + } + + /** + * Gets the resource collection API of PrivateLinkServices. It manages PrivateLinkService. + * + * @return Resource collection API of PrivateLinkServices. + */ + public PrivateLinkServices privateLinkServices() { + if (this.privateLinkServices == null) { + this.privateLinkServices = new PrivateLinkServicesImpl(clientObject.getPrivateLinkServices(), this); + } + return privateLinkServices; + } + + /** + * Gets the resource collection API of PublicIpPrefixes. It manages PublicIpPrefix. + * + * @return Resource collection API of PublicIpPrefixes. + */ + public PublicIpPrefixes publicIpPrefixes() { + if (this.publicIpPrefixes == null) { + this.publicIpPrefixes = new PublicIpPrefixesImpl(clientObject.getPublicIpPrefixes(), this); + } + return publicIpPrefixes; + } + + /** + * Gets the resource collection API of RouteFilters. It manages RouteFilter. + * + * @return Resource collection API of RouteFilters. + */ + public RouteFilters routeFilters() { + if (this.routeFilters == null) { + this.routeFilters = new RouteFiltersImpl(clientObject.getRouteFilters(), this); + } + return routeFilters; + } + + /** + * Gets the resource collection API of RouteFilterRules. + * + * @return Resource collection API of RouteFilterRules. + */ + public RouteFilterRules routeFilterRules() { + if (this.routeFilterRules == null) { + this.routeFilterRules = new RouteFilterRulesImpl(clientObject.getRouteFilterRules(), this); + } + return routeFilterRules; + } + + /** + * Gets the resource collection API of RouteTables. It manages RouteTable. + * + * @return Resource collection API of RouteTables. + */ + public RouteTables routeTables() { + if (this.routeTables == null) { + this.routeTables = new RouteTablesImpl(clientObject.getRouteTables(), this); + } + return routeTables; + } + + /** + * Gets the resource collection API of Routes. It manages Route. + * + * @return Resource collection API of Routes. + */ + public Routes routes() { + if (this.routes == null) { + this.routes = new RoutesImpl(clientObject.getRoutes(), this); + } + return routes; + } + + /** + * Gets the resource collection API of SecurityPartnerProviders. It manages SecurityPartnerProvider. + * + * @return Resource collection API of SecurityPartnerProviders. + */ + public SecurityPartnerProviders securityPartnerProviders() { + if (this.securityPartnerProviders == null) { + this.securityPartnerProviders + = new SecurityPartnerProvidersImpl(clientObject.getSecurityPartnerProviders(), this); + } + return securityPartnerProviders; + } + + /** + * Gets the resource collection API of BgpServiceCommunities. + * + * @return Resource collection API of BgpServiceCommunities. + */ + public BgpServiceCommunities bgpServiceCommunities() { + if (this.bgpServiceCommunities == null) { + this.bgpServiceCommunities = new BgpServiceCommunitiesImpl(clientObject.getBgpServiceCommunities(), this); + } + return bgpServiceCommunities; + } + + /** + * Gets the resource collection API of ServiceEndpointPolicies. It manages ServiceEndpointPolicy. + * + * @return Resource collection API of ServiceEndpointPolicies. + */ + public ServiceEndpointPolicies serviceEndpointPolicies() { + if (this.serviceEndpointPolicies == null) { + this.serviceEndpointPolicies + = new ServiceEndpointPoliciesImpl(clientObject.getServiceEndpointPolicies(), this); + } + return serviceEndpointPolicies; + } + + /** + * Gets the resource collection API of ServiceEndpointPolicyDefinitions. It manages ServiceEndpointPolicyDefinition. + * + * @return Resource collection API of ServiceEndpointPolicyDefinitions. + */ + public ServiceEndpointPolicyDefinitions serviceEndpointPolicyDefinitions() { + if (this.serviceEndpointPolicyDefinitions == null) { + this.serviceEndpointPolicyDefinitions + = new ServiceEndpointPolicyDefinitionsImpl(clientObject.getServiceEndpointPolicyDefinitions(), this); + } + return serviceEndpointPolicyDefinitions; + } + + /** + * Gets the resource collection API of ServiceTags. + * + * @return Resource collection API of ServiceTags. + */ + public ServiceTags serviceTags() { + if (this.serviceTags == null) { + this.serviceTags = new ServiceTagsImpl(clientObject.getServiceTags(), this); + } + return serviceTags; + } + + /** + * Gets the resource collection API of ServiceTagInformations. + * + * @return Resource collection API of ServiceTagInformations. + */ + public ServiceTagInformations serviceTagInformations() { + if (this.serviceTagInformations == null) { + this.serviceTagInformations + = new ServiceTagInformationsImpl(clientObject.getServiceTagInformations(), this); + } + return serviceTagInformations; + } + + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** + * Gets the resource collection API of VirtualNetworks. It manages VirtualNetwork. + * + * @return Resource collection API of VirtualNetworks. + */ + public VirtualNetworks virtualNetworks() { + if (this.virtualNetworks == null) { + this.virtualNetworks = new VirtualNetworksImpl(clientObject.getVirtualNetworks(), this); + } + return virtualNetworks; + } + + /** + * Gets the resource collection API of Subnets. It manages Subnet. + * + * @return Resource collection API of Subnets. + */ + public Subnets subnets() { + if (this.subnets == null) { + this.subnets = new SubnetsImpl(clientObject.getSubnets(), this); + } + return subnets; + } + + /** + * Gets the resource collection API of ResourceNavigationLinks. + * + * @return Resource collection API of ResourceNavigationLinks. + */ + public ResourceNavigationLinks resourceNavigationLinks() { + if (this.resourceNavigationLinks == null) { + this.resourceNavigationLinks + = new ResourceNavigationLinksImpl(clientObject.getResourceNavigationLinks(), this); + } + return resourceNavigationLinks; + } + + /** + * Gets the resource collection API of ServiceAssociationLinks. + * + * @return Resource collection API of ServiceAssociationLinks. + */ + public ServiceAssociationLinks serviceAssociationLinks() { + if (this.serviceAssociationLinks == null) { + this.serviceAssociationLinks + = new ServiceAssociationLinksImpl(clientObject.getServiceAssociationLinks(), this); + } + return serviceAssociationLinks; + } + + /** + * Gets the resource collection API of VirtualNetworkPeerings. It manages VirtualNetworkPeering. + * + * @return Resource collection API of VirtualNetworkPeerings. + */ + public VirtualNetworkPeerings virtualNetworkPeerings() { + if (this.virtualNetworkPeerings == null) { + this.virtualNetworkPeerings + = new VirtualNetworkPeeringsImpl(clientObject.getVirtualNetworkPeerings(), this); + } + return virtualNetworkPeerings; + } + + /** + * Gets the resource collection API of VirtualNetworkGateways. It manages VirtualNetworkGateway. + * + * @return Resource collection API of VirtualNetworkGateways. + */ + public VirtualNetworkGateways virtualNetworkGateways() { + if (this.virtualNetworkGateways == null) { + this.virtualNetworkGateways + = new VirtualNetworkGatewaysImpl(clientObject.getVirtualNetworkGateways(), this); + } + return virtualNetworkGateways; + } + + /** + * Gets the resource collection API of VirtualNetworkGatewayConnections. It manages VirtualNetworkGatewayConnection. + * + * @return Resource collection API of VirtualNetworkGatewayConnections. + */ + public VirtualNetworkGatewayConnections virtualNetworkGatewayConnections() { + if (this.virtualNetworkGatewayConnections == null) { + this.virtualNetworkGatewayConnections + = new VirtualNetworkGatewayConnectionsImpl(clientObject.getVirtualNetworkGatewayConnections(), this); + } + return virtualNetworkGatewayConnections; + } + + /** + * Gets the resource collection API of LocalNetworkGateways. It manages LocalNetworkGateway. + * + * @return Resource collection API of LocalNetworkGateways. + */ + public LocalNetworkGateways localNetworkGateways() { + if (this.localNetworkGateways == null) { + this.localNetworkGateways = new LocalNetworkGatewaysImpl(clientObject.getLocalNetworkGateways(), this); + } + return localNetworkGateways; + } + + /** + * Gets the resource collection API of VirtualNetworkGatewayNatRules. It manages VirtualNetworkGatewayNatRule. + * + * @return Resource collection API of VirtualNetworkGatewayNatRules. + */ + public VirtualNetworkGatewayNatRules virtualNetworkGatewayNatRules() { + if (this.virtualNetworkGatewayNatRules == null) { + this.virtualNetworkGatewayNatRules + = new VirtualNetworkGatewayNatRulesImpl(clientObject.getVirtualNetworkGatewayNatRules(), this); + } + return virtualNetworkGatewayNatRules; + } + + /** + * Gets the resource collection API of VirtualNetworkTaps. It manages VirtualNetworkTap. + * + * @return Resource collection API of VirtualNetworkTaps. + */ + public VirtualNetworkTaps virtualNetworkTaps() { + if (this.virtualNetworkTaps == null) { + this.virtualNetworkTaps = new VirtualNetworkTapsImpl(clientObject.getVirtualNetworkTaps(), this); + } + return virtualNetworkTaps; + } + + /** + * Gets the resource collection API of VirtualRouters. It manages VirtualRouter. + * + * @return Resource collection API of VirtualRouters. + */ + public VirtualRouters virtualRouters() { + if (this.virtualRouters == null) { + this.virtualRouters = new VirtualRoutersImpl(clientObject.getVirtualRouters(), this); + } + return virtualRouters; + } + + /** + * Gets the resource collection API of VirtualRouterPeerings. It manages VirtualRouterPeering. + * + * @return Resource collection API of VirtualRouterPeerings. + */ + public VirtualRouterPeerings virtualRouterPeerings() { + if (this.virtualRouterPeerings == null) { + this.virtualRouterPeerings = new VirtualRouterPeeringsImpl(clientObject.getVirtualRouterPeerings(), this); + } + return virtualRouterPeerings; + } + + /** + * Gets the resource collection API of VirtualWans. It manages VirtualWan. + * + * @return Resource collection API of VirtualWans. + */ + public VirtualWans virtualWans() { + if (this.virtualWans == null) { + this.virtualWans = new VirtualWansImpl(clientObject.getVirtualWans(), this); + } + return virtualWans; + } + + /** + * Gets the resource collection API of VpnSites. It manages VpnSite. + * + * @return Resource collection API of VpnSites. + */ + public VpnSites vpnSites() { + if (this.vpnSites == null) { + this.vpnSites = new VpnSitesImpl(clientObject.getVpnSites(), this); + } + return vpnSites; + } + + /** + * Gets the resource collection API of VpnSiteLinks. + * + * @return Resource collection API of VpnSiteLinks. + */ + public VpnSiteLinks vpnSiteLinks() { + if (this.vpnSiteLinks == null) { + this.vpnSiteLinks = new VpnSiteLinksImpl(clientObject.getVpnSiteLinks(), this); + } + return vpnSiteLinks; + } + + /** + * Gets the resource collection API of VpnSitesConfigurations. + * + * @return Resource collection API of VpnSitesConfigurations. + */ + public VpnSitesConfigurations vpnSitesConfigurations() { + if (this.vpnSitesConfigurations == null) { + this.vpnSitesConfigurations + = new VpnSitesConfigurationsImpl(clientObject.getVpnSitesConfigurations(), this); + } + return vpnSitesConfigurations; + } + + /** + * Gets the resource collection API of VpnServerConfigurations. It manages VpnServerConfiguration. + * + * @return Resource collection API of VpnServerConfigurations. + */ + public VpnServerConfigurations vpnServerConfigurations() { + if (this.vpnServerConfigurations == null) { + this.vpnServerConfigurations + = new VpnServerConfigurationsImpl(clientObject.getVpnServerConfigurations(), this); + } + return vpnServerConfigurations; + } + + /** + * Gets the resource collection API of ConfigurationPolicyGroups. It manages VpnServerConfigurationPolicyGroup. + * + * @return Resource collection API of ConfigurationPolicyGroups. + */ + public ConfigurationPolicyGroups configurationPolicyGroups() { + if (this.configurationPolicyGroups == null) { + this.configurationPolicyGroups + = new ConfigurationPolicyGroupsImpl(clientObject.getConfigurationPolicyGroups(), this); + } + return configurationPolicyGroups; + } + + /** + * Gets the resource collection API of VirtualHubs. It manages VirtualHub. + * + * @return Resource collection API of VirtualHubs. + */ + public VirtualHubs virtualHubs() { + if (this.virtualHubs == null) { + this.virtualHubs = new VirtualHubsImpl(clientObject.getVirtualHubs(), this); + } + return virtualHubs; + } + + /** + * Gets the resource collection API of RouteMaps. It manages RouteMap. + * + * @return Resource collection API of RouteMaps. + */ + public RouteMaps routeMaps() { + if (this.routeMaps == null) { + this.routeMaps = new RouteMapsImpl(clientObject.getRouteMaps(), this); + } + return routeMaps; + } + + /** + * Gets the resource collection API of HubVirtualNetworkConnections. + * + * @return Resource collection API of HubVirtualNetworkConnections. + */ + public HubVirtualNetworkConnections hubVirtualNetworkConnections() { + if (this.hubVirtualNetworkConnections == null) { + this.hubVirtualNetworkConnections + = new HubVirtualNetworkConnectionsImpl(clientObject.getHubVirtualNetworkConnections(), this); + } + return hubVirtualNetworkConnections; + } + + /** + * Gets the resource collection API of VpnGateways. It manages VpnGateway. + * + * @return Resource collection API of VpnGateways. + */ + public VpnGateways vpnGateways() { + if (this.vpnGateways == null) { + this.vpnGateways = new VpnGatewaysImpl(clientObject.getVpnGateways(), this); + } + return vpnGateways; + } + + /** + * Gets the resource collection API of VpnLinkConnections. + * + * @return Resource collection API of VpnLinkConnections. + */ + public VpnLinkConnections vpnLinkConnections() { + if (this.vpnLinkConnections == null) { + this.vpnLinkConnections = new VpnLinkConnectionsImpl(clientObject.getVpnLinkConnections(), this); + } + return vpnLinkConnections; + } + + /** + * Gets the resource collection API of VpnConnections. + * + * @return Resource collection API of VpnConnections. + */ + public VpnConnections vpnConnections() { + if (this.vpnConnections == null) { + this.vpnConnections = new VpnConnectionsImpl(clientObject.getVpnConnections(), this); + } + return vpnConnections; + } + + /** + * Gets the resource collection API of VpnSiteLinkConnections. + * + * @return Resource collection API of VpnSiteLinkConnections. + */ + public VpnSiteLinkConnections vpnSiteLinkConnections() { + if (this.vpnSiteLinkConnections == null) { + this.vpnSiteLinkConnections + = new VpnSiteLinkConnectionsImpl(clientObject.getVpnSiteLinkConnections(), this); + } + return vpnSiteLinkConnections; + } + + /** + * Gets the resource collection API of NatRules. It manages VpnGatewayNatRule. + * + * @return Resource collection API of NatRules. + */ + public NatRules natRules() { + if (this.natRules == null) { + this.natRules = new NatRulesImpl(clientObject.getNatRules(), this); + } + return natRules; + } + + /** + * Gets the resource collection API of P2SVpnGateways. It manages P2SVpnGateway. + * + * @return Resource collection API of P2SVpnGateways. + */ + public P2SVpnGateways p2SVpnGateways() { + if (this.p2SVpnGateways == null) { + this.p2SVpnGateways = new P2SVpnGatewaysImpl(clientObject.getP2SVpnGateways(), this); + } + return p2SVpnGateways; + } + + /** + * Gets the resource collection API of VpnServerConfigurationsAssociatedWithVirtualWans. + * + * @return Resource collection API of VpnServerConfigurationsAssociatedWithVirtualWans. + */ + public VpnServerConfigurationsAssociatedWithVirtualWans vpnServerConfigurationsAssociatedWithVirtualWans() { + if (this.vpnServerConfigurationsAssociatedWithVirtualWans == null) { + this.vpnServerConfigurationsAssociatedWithVirtualWans + = new VpnServerConfigurationsAssociatedWithVirtualWansImpl( + clientObject.getVpnServerConfigurationsAssociatedWithVirtualWans(), this); + } + return vpnServerConfigurationsAssociatedWithVirtualWans; + } + + /** + * Gets the resource collection API of VirtualHubRouteTableV2S. + * + * @return Resource collection API of VirtualHubRouteTableV2S. + */ + public VirtualHubRouteTableV2S virtualHubRouteTableV2S() { + if (this.virtualHubRouteTableV2S == null) { + this.virtualHubRouteTableV2S + = new VirtualHubRouteTableV2SImpl(clientObject.getVirtualHubRouteTableV2S(), this); + } + return virtualHubRouteTableV2S; + } + + /** + * Gets the resource collection API of ExpressRouteGateways. It manages ExpressRouteGateway. + * + * @return Resource collection API of ExpressRouteGateways. + */ + public ExpressRouteGateways expressRouteGateways() { + if (this.expressRouteGateways == null) { + this.expressRouteGateways = new ExpressRouteGatewaysImpl(clientObject.getExpressRouteGateways(), this); + } + return expressRouteGateways; + } + + /** + * Gets the resource collection API of ExpressRouteConnections. + * + * @return Resource collection API of ExpressRouteConnections. + */ + public ExpressRouteConnections expressRouteConnections() { + if (this.expressRouteConnections == null) { + this.expressRouteConnections + = new ExpressRouteConnectionsImpl(clientObject.getExpressRouteConnections(), this); + } + return expressRouteConnections; + } + + /** + * Gets the resource collection API of NetworkVirtualApplianceConnections. + * + * @return Resource collection API of NetworkVirtualApplianceConnections. + */ + public NetworkVirtualApplianceConnections networkVirtualApplianceConnections() { + if (this.networkVirtualApplianceConnections == null) { + this.networkVirtualApplianceConnections = new NetworkVirtualApplianceConnectionsImpl( + clientObject.getNetworkVirtualApplianceConnections(), this); + } + return networkVirtualApplianceConnections; + } + + /** + * Gets the resource collection API of VirtualHubBgpConnections. It manages BgpConnection. + * + * @return Resource collection API of VirtualHubBgpConnections. + */ + public VirtualHubBgpConnections virtualHubBgpConnections() { + if (this.virtualHubBgpConnections == null) { + this.virtualHubBgpConnections + = new VirtualHubBgpConnectionsImpl(clientObject.getVirtualHubBgpConnections(), this); + } + return virtualHubBgpConnections; + } + + /** + * Gets the resource collection API of VirtualHubIpConfigurations. It manages HubIpConfiguration. + * + * @return Resource collection API of VirtualHubIpConfigurations. + */ + public VirtualHubIpConfigurations virtualHubIpConfigurations() { + if (this.virtualHubIpConfigurations == null) { + this.virtualHubIpConfigurations + = new VirtualHubIpConfigurationsImpl(clientObject.getVirtualHubIpConfigurations(), this); + } + return virtualHubIpConfigurations; + } + + /** + * Gets the resource collection API of HubRouteTables. It manages HubRouteTable. + * + * @return Resource collection API of HubRouteTables. + */ + public HubRouteTables hubRouteTables() { + if (this.hubRouteTables == null) { + this.hubRouteTables = new HubRouteTablesImpl(clientObject.getHubRouteTables(), this); + } + return hubRouteTables; + } + + /** + * Gets the resource collection API of RoutingIntents. It manages RoutingIntent. + * + * @return Resource collection API of RoutingIntents. + */ + public RoutingIntents routingIntents() { + if (this.routingIntents == null) { + this.routingIntents = new RoutingIntentsImpl(clientObject.getRoutingIntents(), this); + } + return routingIntents; + } + + /** + * Gets the resource collection API of WebApplicationFirewallPolicies. It manages WebApplicationFirewallPolicy. + * + * @return Resource collection API of WebApplicationFirewallPolicies. + */ + public WebApplicationFirewallPolicies webApplicationFirewallPolicies() { + if (this.webApplicationFirewallPolicies == null) { + this.webApplicationFirewallPolicies + = new WebApplicationFirewallPoliciesImpl(clientObject.getWebApplicationFirewallPolicies(), this); + } + return webApplicationFirewallPolicies; + } + + /** + * Gets wrapped service client NetworkManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client NetworkManagementClient. + */ + public NetworkManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRuleCollectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRuleCollectionsClient.java new file mode 100644 index 0000000000000..f2d52657612a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRuleCollectionsClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft 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.AdminRuleCollectionInner; + +/** + * An instance of this class provides access to all the operations defined in AdminRuleCollectionsClient. + */ +public interface AdminRuleCollectionsClient { + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security admin configuration rule collection list result as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 admin configuration rule collection list result as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security admin configuration rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context); + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security admin configuration rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdminRuleCollectionInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Creates or updates an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the admin rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, AdminRuleCollectionInner ruleCollection, Context context); + + /** + * Creates or updates an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the admin rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AdminRuleCollectionInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, AdminRuleCollectionInner ruleCollection); + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName); + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context); + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRulesClient.java new file mode 100644 index 0000000000000..39e7dd2830df7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AdminRulesClient.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.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.BaseAdminRuleInner; + +/** + * An instance of this class provides access to all the operations defined in AdminRulesClient. + */ +public interface AdminRulesClient { + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 configuration admin rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName); + + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 configuration admin rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context); + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BaseAdminRuleInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base admin rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule, + Context context); + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base admin rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BaseAdminRuleInner createOrUpdate(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule); + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName); + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context); + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context); +} 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..90c4b1ff0e8e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateEndpointConnectionsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 the {@link SyncPoller} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String applicationGatewayName, String connectionName, 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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..44a991bc09330 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayPrivateLinkResourcesClient.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.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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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/ApplicationGatewayWafDynamicManifestsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayWafDynamicManifestsClient.java new file mode 100644 index 0000000000000..b69e17c196f6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayWafDynamicManifestsClient.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.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.ApplicationGatewayWafDynamicManifestResultInner; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayWafDynamicManifestsClient. + */ +public interface ApplicationGatewayWafDynamicManifestsClient { + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get(String location); + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable get(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayWafDynamicManifestsDefaultsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayWafDynamicManifestsDefaultsClient.java new file mode 100644 index 0000000000000..703a52c8fd82f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewayWafDynamicManifestsDefaultsClient.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.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.ApplicationGatewayWafDynamicManifestResultInner; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayWafDynamicManifestsDefaultsClient. + */ +public interface ApplicationGatewayWafDynamicManifestsDefaultsClient { + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, Context context); + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationGatewayWafDynamicManifestResultInner get(String location); +} 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..4566c6ae3467b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationGatewaysClient.java @@ -0,0 +1,654 @@ +// Copyright (c) Microsoft 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of application gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of application gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String applicationGatewayName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the backend health of the specified application gateway in a + * resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(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 {@link SyncPoller} for polling of the backend health of the specified application gateway in a + * resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the backend health for given combination of backend pool and http + * setting of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand(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 {@link SyncPoller} for polling of the backend health for given combination of backend pool and http + * setting of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableServerVariablesWithResponse(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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableRequestHeadersWithResponse(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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listAvailableResponseHeadersWithResponse(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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableWafRuleSetsWithResponse(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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAvailableSslOptionsWithResponse(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 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAvailableSslPredefinedPolicies(Context context); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSslPredefinedPolicyWithResponse(String predefinedPolicyName, + 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); +} 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..72a60cbfcaff5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ApplicationSecurityGroupsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String applicationSecurityGroupName, TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..b1d60371e6cfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableDelegationsClient.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 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..85d18ad5487e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableEndpointServicesClient.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.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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..7b0756f8c080e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailablePrivateEndpointTypesClient.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; + +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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..67c61704d243b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableResourceGroupDelegationsClient.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.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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..e2d85c2d957ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AvailableServiceAliasesClient.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; + +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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..419005883e187 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallFqdnTagsClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..f845c3ffb6869 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/AzureFirewallsClient.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.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.fluent.models.IpPrefixesListInner; +import com.azure.resourcemanager.network.generated.models.FirewallPacketCaptureParameters; +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 {@link SyncPoller} for polling of list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpPrefixesListInner> beginListLearnedPrefixes(String resourceGroupName, + String azureFirewallName); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 {@link SyncPoller} for polling of list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IpPrefixesListInner> beginListLearnedPrefixes(String resourceGroupName, + String azureFirewallName, Context context); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixesListInner listLearnedPrefixes(String resourceGroupName, String azureFirewallName); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpPrefixesListInner listLearnedPrefixes(String resourceGroupName, String azureFirewallName, Context context); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPacketCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginPacketCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters, Context context); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(String resourceGroupName, String azureFirewallName, FirewallPacketCaptureParameters parameters); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(String resourceGroupName, String azureFirewallName, FirewallPacketCaptureParameters parameters, + 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..f38cd8a450fa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BastionHostsClient.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; + +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; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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); + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BastionHostInner> beginUpdateTags(String resourceGroupName, + String bastionHostname, TagsObject parameters); + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BastionHostInner> beginUpdateTags(String resourceGroupName, + String bastionHostname, TagsObject parameters, Context context); + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner updateTags(String resourceGroupName, String bastionHostname, TagsObject parameters); + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BastionHostInner updateTags(String resourceGroupName, String bastionHostname, TagsObject 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..3018f57f71ad9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/BgpServiceCommunitiesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/ConfigurationPolicyGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConfigurationPolicyGroupsClient.java new file mode 100644 index 0000000000000..9c7cfd94fa5fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConfigurationPolicyGroupsClient.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; + +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.VpnServerConfigurationPolicyGroupInner; + +/** + * An instance of this class provides access to all the operations defined in ConfigurationPolicyGroupsClient. + */ +public interface ConfigurationPolicyGroupsClient { + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VpnServerConfigurationPolicyGroupInner> + beginCreateOrUpdate(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters); + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VpnServerConfigurationPolicyGroupInner> + beginCreateOrUpdate(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, Context context); + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationPolicyGroupInner createOrUpdate(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters); + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationPolicyGroupInner createOrUpdate(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, Context context); + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName); + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, Context context); + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String configurationPolicyGroupName); + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String configurationPolicyGroupName, + Context context); + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, Context context); + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnServerConfigurationPolicyGroupInner get(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName); + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName); + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName, 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..c970f14fe4d7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectionMonitorsClient.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + 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 the {@link SyncPoller} for polling of information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, TagsObject parameters, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/ConnectivityConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectivityConfigurationsClient.java new file mode 100644 index 0000000000000..d02ebbbbc3a6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ConnectivityConfigurationsClient.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; + +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.ConnectivityConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in ConnectivityConfigurationsClient. + */ +public interface ConnectivityConfigurationsClient { + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context); + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectivityConfigurationInner get(String resourceGroupName, String networkManagerName, String configurationName); + + /** + * Creates/Updates a new network manager connectivity configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param connectivityConfiguration Parameters supplied to create/update a network manager connectivity + * 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 network manager connectivity configuration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, ConnectivityConfigurationInner connectivityConfiguration, + Context context); + + /** + * Creates/Updates a new network manager connectivity configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param connectivityConfiguration Parameters supplied to create/update a network manager connectivity + * 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 network manager connectivity configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectivityConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, ConnectivityConfigurationInner connectivityConfiguration); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, Boolean force, + Context context); + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 manager connectivity configurations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 manager connectivity configurations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, 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..a4cb3da8621ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/CustomIpPrefixesClient.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String customIpPrefixName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String customIpPrefixName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..7a86ec15ae714 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosCustomPoliciesClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String ddosCustomPolicyName, + TagsObject 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); +} 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..de27cc3805bd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DdosProtectionPlansClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String ddosProtectionPlanName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..478f278078321 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DefaultSecurityRulesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkSecurityGroupName, + String defaultSecurityRuleName, 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); +} 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..da858ac7e29cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/DscpConfigurationsClient.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.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 the {@link SyncPoller} for polling of differentiated Services Code Point configuration for any given + * network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of differentiated Services Code Point configuration for any given + * network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 differentiated Services Code Point configuration for any given network interface. + */ + @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 differentiated Services Code Point configuration for any given network interface. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..3af33c15af83f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitAuthorizationsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..1eb330e7c6ff2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitConnectionsClient.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; + +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated + * response with {@link PagedIterable}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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..28735da16b9d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCircuitPeeringsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..550ca970ba696 --- /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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String circuitName, + TagsObject 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); + + /** + * 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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of the currently advertised routes table summary associated with the + * express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of the currently advertised routes table summary associated with the + * express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getStatsWithResponse(String resourceGroupName, String circuitName, + 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPeeringStatsWithResponse(String resourceGroupName, String circuitName, + String peeringName, 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 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..203c58d059e30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteConnectionsClient.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 the {@link SyncPoller} for polling of expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String expressRouteGatewayName, + String connectionName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String expressRouteGatewayName, + 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); +} 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..53cb571944464 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionPeeringsClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..29775945062de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteCrossConnectionsClient.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=name eq + * '{circuitServiceKey}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String crossConnectionName, 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); + + /** + * 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 the {@link SyncPoller} for polling of expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String crossConnectionName, TagsObject crossConnectionParameters, 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); + + /** + * 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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the route table summary associated with the express route cross + * connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of the route table summary associated with the express route cross + * connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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..96f768f180916 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteGatewaysClient.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.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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listBySubscriptionWithResponse(Context context); + + /** + * 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByResourceGroupWithResponse(String resourceGroupName, 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); + + /** + * 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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String expressRouteGatewayName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..68f35691198b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteLinksClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String expressRoutePortName, + String linkName, 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 com.azure.core.management.exception.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * 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 expressRouteLink List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRouteLink List Result as paginated response with {@link PagedIterable}. + */ + @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/ExpressRoutePortAuthorizationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortAuthorizationsClient.java new file mode 100644 index 0000000000000..56813cd3cf9ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortAuthorizationsClient.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.ExpressRoutePortAuthorizationInner; + +/** + * An instance of this class provides access to all the operations defined in ExpressRoutePortAuthorizationsClient. + */ +public interface ExpressRoutePortAuthorizationsClient { + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName, + String authorizationName); + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName, + String authorizationName, Context context); + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 expressRoutePortName, String authorizationName); + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 expressRoutePortName, String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String expressRoutePortName, + String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortAuthorizationInner get(String resourceGroupName, String expressRoutePortName, + String authorizationName); + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 the {@link SyncPoller} for polling of expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExpressRoutePortAuthorizationInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters); + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 the {@link SyncPoller} for polling of expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExpressRoutePortAuthorizationInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters, Context context); + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortAuthorizationInner createOrUpdate(String resourceGroupName, String expressRoutePortName, + String authorizationName, ExpressRoutePortAuthorizationInner authorizationParameters); + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortAuthorizationInner createOrUpdate(String resourceGroupName, String expressRoutePortName, + String authorizationName, ExpressRoutePortAuthorizationInner authorizationParameters, Context context); + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 port as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String expressRoutePortName); + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 port as paginated response with {@link PagedIterable}. + */ + @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..eaf22240cbb4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Port along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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 expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * 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 the {@link SyncPoller} for polling of expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 expressRoute Port. + */ + @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 expressRoute Port. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Port along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String expressRoutePortName, + TagsObject 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 expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName, TagsObject parameters); + + /** + * 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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response generateLoaWithResponse(String resourceGroupName, + String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request, 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); +} 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..2d924796aa194 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRoutePortsLocationsClient.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.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 expressRoutePorts Location List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoutePorts Location List Result as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String locationName, 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 expressRoutePorts Peering Location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRoutePortsLocationInner get(String locationName); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteProviderPortsLocationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteProviderPortsLocationsClient.java new file mode 100644 index 0000000000000..2d8ce35f02f07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteProviderPortsLocationsClient.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.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortListResultInner; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteProviderPortsLocationsClient. + */ +public interface ExpressRouteProviderPortsLocationsClient { + /** + * Retrieves all the ExpressRouteProviderPorts in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=location eq '{state}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteProviderPort API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String filter, Context context); + + /** + * Retrieves all the ExpressRouteProviderPorts 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 ListExpressRouteProviderPort API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteProviderPortListResultInner list(); +} 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..3719989494fcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ExpressRouteServiceProvidersClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..aaa882f5339c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPoliciesClient.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft 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; +import com.azure.resourcemanager.network.generated.models.TagsObject; + +/** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String firewallPolicyName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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); + + /** + * Updates tags of a Azure Firewall Policy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to update Azure Firewall 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 firewallPolicy Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String firewallPolicyName, + TagsObject parameters, Context context); + + /** + * Updates tags of a Azure Firewall Policy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to update Azure Firewall 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 firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyInner updateTags(String resourceGroupName, String firewallPolicyName, TagsObject parameters); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/FirewallPolicyDeploymentsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyDeploymentsClient.java new file mode 100644 index 0000000000000..16c59e57ca156 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyDeploymentsClient.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; + +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; + +/** + * An instance of this class provides access to all the operations defined in FirewallPolicyDeploymentsClient. + */ +public interface FirewallPolicyDeploymentsClient { + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeploy(String resourceGroupName, String firewallPolicyName); + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeploy(String resourceGroupName, String firewallPolicyName, + Context context); + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 deploy(String resourceGroupName, String firewallPolicyName); + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 deploy(String resourceGroupName, String firewallPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyDraftsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyDraftsClient.java new file mode 100644 index 0000000000000..2e10bce2a7a8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyDraftsClient.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.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.FirewallPolicyDraftInner; + +/** + * An instance of this class provides access to all the operations defined in FirewallPolicyDraftsClient. + */ +public interface FirewallPolicyDraftsClient { + /** + * Create or update a draft 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 Draft 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters, Context context); + + /** + * Create or update a draft 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 Draft operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + FirewallPolicyDraftInner createOrUpdate(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters); + + /** + * Delete a draft 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String firewallPolicyName, Context context); + + /** + * Delete a draft 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); + + /** + * Get a draft 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 a draft Firewall Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String firewallPolicyName, + Context context); + + /** + * Get a draft 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 a draft Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyDraftInner get(String resourceGroupName, String firewallPolicyName); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesClient.java new file mode 100644 index 0000000000000..cc345347d2d1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesClient.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.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.QueryResultsInner; +import com.azure.resourcemanager.network.generated.models.IdpsQueryObject; + +/** + * An instance of this class provides access to all the operations defined in FirewallPolicyIdpsSignaturesClient. + */ +public interface FirewallPolicyIdpsSignaturesClient { + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String firewallPolicyName, + IdpsQueryObject parameters, Context context); + + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QueryResultsInner list(String resourceGroupName, String firewallPolicyName, IdpsQueryObject parameters); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesFilterValuesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesFilterValuesClient.java new file mode 100644 index 0000000000000..8872e554f5038 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesFilterValuesClient.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.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.SignatureOverridesFilterValuesResponseInner; +import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesQuery; + +/** + * An instance of this class provides access to all the operations defined in + * FirewallPolicyIdpsSignaturesFilterValuesClient. + */ +public interface FirewallPolicyIdpsSignaturesFilterValuesClient { + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of all possible values for a specific filter value along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, + String firewallPolicyName, SignatureOverridesFilterValuesQuery parameters, Context context); + + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of all possible values for a specific filter value. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignatureOverridesFilterValuesResponseInner list(String resourceGroupName, String firewallPolicyName, + SignatureOverridesFilterValuesQuery parameters); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesOverridesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesOverridesClient.java new file mode 100644 index 0000000000000..85e8ee05d7624 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyIdpsSignaturesOverridesClient.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.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.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesListInner; + +/** + * An instance of this class provides access to all the operations defined in + * FirewallPolicyIdpsSignaturesOverridesClient. + */ +public interface FirewallPolicyIdpsSignaturesOverridesClient { + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context); + + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignaturesOverridesInner patch(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters); + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response putWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context); + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignaturesOverridesInner put(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters); + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String firewallPolicyName, + Context context); + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignaturesOverridesInner get(String resourceGroupName, String firewallPolicyName); + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String firewallPolicyName, + Context context); + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignaturesOverridesListInner list(String resourceGroupName, String firewallPolicyName); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupDraftsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupDraftsClient.java new file mode 100644 index 0000000000000..cc28f4ba69ea1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupDraftsClient.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; + +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.FirewallPolicyRuleCollectionGroupDraftInner; + +/** + * An instance of this class provides access to all the operations defined in + * FirewallPolicyRuleCollectionGroupDraftsClient. + */ +public interface FirewallPolicyRuleCollectionGroupDraftsClient { + /** + * Delete Rule Collection Group Draft. + * + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, Context context); + + /** + * Delete Rule Collection Group Draft. + * + * @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); + + /** + * Create or Update Rule Collection Group Draft. + * + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner parameters, Context context); + + /** + * Create or Update Rule Collection Group Draft. + * + * @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) + FirewallPolicyRuleCollectionGroupDraftInner createOrUpdate(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, FirewallPolicyRuleCollectionGroupDraftInner parameters); + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FirewallPolicyRuleCollectionGroupDraftInner get(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName); +} 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..32cac868b4d5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FirewallPolicyRuleCollectionGroupsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..1a1dd4381a06f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/FlowLogsClient.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft 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 the {@link SyncPoller} for polling of a flow log resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a flow log resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String networkWatcherName, + String flowLogName, TagsObject 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkWatcherName, String flowLogName, + 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..18111b5a9872d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubRouteTablesClient.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.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 the {@link SyncPoller} for polling of routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String virtualHubName, String routeTableName, + 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..ede1ea5e5e362 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/HubVirtualNetworkConnectionsClient.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.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 the {@link SyncPoller} for polling of hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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 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 as paginated + * response with {@link PagedIterable}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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..c0ea1702b1f51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundNatRulesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String inboundNatRuleName, String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..fb0d4b2fbfa9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/InboundSecurityRuleOperationsClient.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.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.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 the {@link SyncPoller} for polling of nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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); + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkVirtualApplianceName, + String ruleCollectionName, Context context); + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 get(String resourceGroupName, String networkVirtualApplianceName, + String ruleCollectionName); +} 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..2a197068e5b3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpAllocationsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String ipAllocationName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String ipAllocationName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..f10a188e56a38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/IpGroupsClient.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String ipGroupsName, String expand, + Context context); + + /** + * 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); + + /** + * 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 {@link SyncPoller} for polling of the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateGroupsWithResponse(String resourceGroupName, String ipGroupsName, + TagsObject 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..93db3b7f65f3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerBackendAddressPoolsClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String backendAddressPoolName, 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); + + /** + * 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 the {@link SyncPoller} for polling of pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..08f9e87c27d23 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String frontendIpConfigurationName, 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); +} 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..ead8ada34e762 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerLoadBalancingRulesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String loadBalancingRuleName, 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); +} 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..3e1db244d6d8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerNetworkInterfacesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..45bb05af2f584 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerOutboundRulesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String outboundRuleName, 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); +} 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..d8c0d50e3fd20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancerProbesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String loadBalancerName, String probeName, + 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); +} 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..c9b29f90dfbfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LoadBalancersClient.java @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft 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.BackendAddressInboundNatRulePortMappingsInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.fluent.models.MigratedPoolsInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +import com.azure.resourcemanager.network.generated.models.MigrateLoadBalancerToIpBasedRequest; +import com.azure.resourcemanager.network.generated.models.QueryInboundNatRulePortMappingRequest; +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String loadBalancerName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String loadBalancerName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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); + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappings(String groupName, String loadBalancerName, String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters); + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappings(String groupName, String loadBalancerName, String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters, Context context); + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendAddressInboundNatRulePortMappingsInner listInboundNatRulePortMappings(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters); + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackendAddressInboundNatRulePortMappingsInner listInboundNatRulePortMappings(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters, + Context context); + + /** + * Migrate load balancer to IP Based. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the migrateToIpBased Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a migrateToIpBased API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response migrateToIpBasedWithResponse(String groupName, String loadBalancerName, + MigrateLoadBalancerToIpBasedRequest parameters, Context context); + + /** + * Migrate load balancer to IP Based. + * + * @param groupName 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 response for a migrateToIpBased API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MigratedPoolsInner migrateToIpBased(String groupName, String loadBalancerName); +} 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..2523be454b0bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/LocalNetworkGatewaysClient.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.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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String localNetworkGatewayName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String localNetworkGatewayName, + TagsObject parameters, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/ManagementGroupNetworkManagerConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ManagementGroupNetworkManagerConnectionsClient.java new file mode 100644 index 0000000000000..f4141bfa850c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ManagementGroupNetworkManagerConnectionsClient.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; + +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.NetworkManagerConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in + * ManagementGroupNetworkManagerConnectionsClient. + */ +public interface ManagementGroupNetworkManagerConnectionsClient { + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String managementGroupId, + String networkManagerConnectionName, NetworkManagerConnectionInner parameters, Context context); + + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerConnectionInner createOrUpdate(String managementGroupId, String networkManagerConnectionName, + NetworkManagerConnectionInner parameters); + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String managementGroupId, + String networkManagerConnectionName, Context context); + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerConnectionInner get(String managementGroupId, String networkManagerConnectionName); + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String managementGroupId, String networkManagerConnectionName, Context context); + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 managementGroupId, String networkManagerConnectionName); + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management 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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String managementGroupId); + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String managementGroupId, Integer top, String skipToken, + 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..54bd5e3070df8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatGatewaysClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String natGatewayName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String natGatewayName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..3f3c5d8746536 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NatRulesClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String gatewayName, String natRuleName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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/NetworkGroupsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkGroupsClient.java new file mode 100644 index 0000000000000..ba4ef49112a2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkGroupsClient.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.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.NetworkGroupInner; +import com.azure.resourcemanager.network.generated.models.NetworkGroupsCreateOrUpdateResponse; + +/** + * An instance of this class provides access to all the operations defined in NetworkGroupsClient. + */ +public interface NetworkGroupsClient { + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 specified network group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, Context context); + + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkGroupInner get(String resourceGroupName, String networkManagerName, String networkGroupName); + + /** + * Creates or updates a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param parameters Parameters supplied to the specify which network group need to create. + * @param ifMatch The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkGroupsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, NetworkGroupInner parameters, String ifMatch, Context context); + + /** + * Creates or updates a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param parameters Parameters supplied to the specify which network group need to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkGroupInner createOrUpdate(String resourceGroupName, String networkManagerName, String networkGroupName, + NetworkGroupInner parameters); + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String networkGroupName); + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String networkGroupName, Boolean force, Context context); + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 networkManagerName, String networkGroupName); + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String networkGroupName, Boolean force, + Context context); + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkGroup as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkGroup as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, 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..2d883ce0cacc9 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String networkInterfaceName, String ipConfigurationName, 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); +} 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..cbb08497181c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceLoadBalancersClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..8cfa6a3397943 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfaceTapConfigurationsClient.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; + +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..74e7a8c3589b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkInterfacesClient.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; + +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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCloudServiceNetworkInterfaceWithResponse(String resourceGroupName, + String cloudServiceName, String roleInstanceName, String networkInterfaceName, String expand, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String networkInterfaceName, String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String networkInterfaceName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 the {@link SyncPoller} for polling of all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated + * response with {@link PagedIterable}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineScaleSetNetworkInterfaceWithResponse(String resourceGroupName, + String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand, + 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 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 as paginated response + * with {@link PagedIterable}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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. + * @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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, + String networkInterfaceName, String ipConfigurationName, 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); +} 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..bf86ed0982938 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagementClient.java @@ -0,0 +1,1029 @@ +// Copyright (c) Microsoft 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 ApplicationGatewayWafDynamicManifestsDefaultsClient object to access its operations. + * + * @return the ApplicationGatewayWafDynamicManifestsDefaultsClient object. + */ + ApplicationGatewayWafDynamicManifestsDefaultsClient getApplicationGatewayWafDynamicManifestsDefaults(); + + /** + * Gets the ApplicationGatewayWafDynamicManifestsClient object to access its operations. + * + * @return the ApplicationGatewayWafDynamicManifestsClient object. + */ + ApplicationGatewayWafDynamicManifestsClient getApplicationGatewayWafDynamicManifests(); + + /** + * 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 VipSwapsClient object to access its operations. + * + * @return the VipSwapsClient object. + */ + VipSwapsClient getVipSwaps(); + + /** + * 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 ExpressRoutePortAuthorizationsClient object to access its operations. + * + * @return the ExpressRoutePortAuthorizationsClient object. + */ + ExpressRoutePortAuthorizationsClient getExpressRoutePortAuthorizations(); + + /** + * Gets the ExpressRouteProviderPortsLocationsClient object to access its operations. + * + * @return the ExpressRouteProviderPortsLocationsClient object. + */ + ExpressRouteProviderPortsLocationsClient getExpressRouteProviderPortsLocations(); + + /** + * 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 FirewallPolicyIdpsSignaturesClient object to access its operations. + * + * @return the FirewallPolicyIdpsSignaturesClient object. + */ + FirewallPolicyIdpsSignaturesClient getFirewallPolicyIdpsSignatures(); + + /** + * Gets the FirewallPolicyIdpsSignaturesOverridesClient object to access its operations. + * + * @return the FirewallPolicyIdpsSignaturesOverridesClient object. + */ + FirewallPolicyIdpsSignaturesOverridesClient getFirewallPolicyIdpsSignaturesOverrides(); + + /** + * Gets the FirewallPolicyIdpsSignaturesFilterValuesClient object to access its operations. + * + * @return the FirewallPolicyIdpsSignaturesFilterValuesClient object. + */ + FirewallPolicyIdpsSignaturesFilterValuesClient getFirewallPolicyIdpsSignaturesFilterValues(); + + /** + * Gets the FirewallPolicyDraftsClient object to access its operations. + * + * @return the FirewallPolicyDraftsClient object. + */ + FirewallPolicyDraftsClient getFirewallPolicyDrafts(); + + /** + * Gets the FirewallPolicyDeploymentsClient object to access its operations. + * + * @return the FirewallPolicyDeploymentsClient object. + */ + FirewallPolicyDeploymentsClient getFirewallPolicyDeployments(); + + /** + * Gets the FirewallPolicyRuleCollectionGroupDraftsClient object to access its operations. + * + * @return the FirewallPolicyRuleCollectionGroupDraftsClient object. + */ + FirewallPolicyRuleCollectionGroupDraftsClient getFirewallPolicyRuleCollectionGroupDrafts(); + + /** + * 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 NetworkManagersClient object to access its operations. + * + * @return the NetworkManagersClient object. + */ + NetworkManagersClient getNetworkManagers(); + + /** + * Gets the NetworkManagerCommitsClient object to access its operations. + * + * @return the NetworkManagerCommitsClient object. + */ + NetworkManagerCommitsClient getNetworkManagerCommits(); + + /** + * Gets the NetworkManagerDeploymentStatusOperationsClient object to access its operations. + * + * @return the NetworkManagerDeploymentStatusOperationsClient object. + */ + NetworkManagerDeploymentStatusOperationsClient getNetworkManagerDeploymentStatusOperations(); + + /** + * Gets the SubscriptionNetworkManagerConnectionsClient object to access its operations. + * + * @return the SubscriptionNetworkManagerConnectionsClient object. + */ + SubscriptionNetworkManagerConnectionsClient getSubscriptionNetworkManagerConnections(); + + /** + * Gets the ManagementGroupNetworkManagerConnectionsClient object to access its operations. + * + * @return the ManagementGroupNetworkManagerConnectionsClient object. + */ + ManagementGroupNetworkManagerConnectionsClient getManagementGroupNetworkManagerConnections(); + + /** + * Gets the ConnectivityConfigurationsClient object to access its operations. + * + * @return the ConnectivityConfigurationsClient object. + */ + ConnectivityConfigurationsClient getConnectivityConfigurations(); + + /** + * Gets the NetworkGroupsClient object to access its operations. + * + * @return the NetworkGroupsClient object. + */ + NetworkGroupsClient getNetworkGroups(); + + /** + * Gets the StaticMembersClient object to access its operations. + * + * @return the StaticMembersClient object. + */ + StaticMembersClient getStaticMembers(); + + /** + * Gets the ScopeConnectionsClient object to access its operations. + * + * @return the ScopeConnectionsClient object. + */ + ScopeConnectionsClient getScopeConnections(); + + /** + * Gets the SecurityAdminConfigurationsClient object to access its operations. + * + * @return the SecurityAdminConfigurationsClient object. + */ + SecurityAdminConfigurationsClient getSecurityAdminConfigurations(); + + /** + * Gets the AdminRuleCollectionsClient object to access its operations. + * + * @return the AdminRuleCollectionsClient object. + */ + AdminRuleCollectionsClient getAdminRuleCollections(); + + /** + * Gets the AdminRulesClient object to access its operations. + * + * @return the AdminRulesClient object. + */ + AdminRulesClient getAdminRules(); + + /** + * Gets the SecurityUserConfigurationsClient object to access its operations. + * + * @return the SecurityUserConfigurationsClient object. + */ + SecurityUserConfigurationsClient getSecurityUserConfigurations(); + + /** + * Gets the SecurityUserRuleCollectionsClient object to access its operations. + * + * @return the SecurityUserRuleCollectionsClient object. + */ + SecurityUserRuleCollectionsClient getSecurityUserRuleCollections(); + + /** + * Gets the SecurityUserRulesClient object to access its operations. + * + * @return the SecurityUserRulesClient object. + */ + SecurityUserRulesClient getSecurityUserRules(); + + /** + * Gets the NetworkManagerRoutingConfigurationsClient object to access its operations. + * + * @return the NetworkManagerRoutingConfigurationsClient object. + */ + NetworkManagerRoutingConfigurationsClient getNetworkManagerRoutingConfigurations(); + + /** + * Gets the RoutingRuleCollectionsClient object to access its operations. + * + * @return the RoutingRuleCollectionsClient object. + */ + RoutingRuleCollectionsClient getRoutingRuleCollections(); + + /** + * Gets the RoutingRulesClient object to access its operations. + * + * @return the RoutingRulesClient object. + */ + RoutingRulesClient getRoutingRules(); + + /** + * 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 ServiceTagInformationsClient object to access its operations. + * + * @return the ServiceTagInformationsClient object. + */ + ServiceTagInformationsClient getServiceTagInformations(); + + /** + * 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 ConfigurationPolicyGroupsClient object to access its operations. + * + * @return the ConfigurationPolicyGroupsClient object. + */ + ConfigurationPolicyGroupsClient getConfigurationPolicyGroups(); + + /** + * Gets the VirtualHubsClient object to access its operations. + * + * @return the VirtualHubsClient object. + */ + VirtualHubsClient getVirtualHubs(); + + /** + * Gets the RouteMapsClient object to access its operations. + * + * @return the RouteMapsClient object. + */ + RouteMapsClient getRouteMaps(); + + /** + * 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 NetworkVirtualApplianceConnectionsClient object to access its operations. + * + * @return the NetworkVirtualApplianceConnectionsClient object. + */ + NetworkVirtualApplianceConnectionsClient getNetworkVirtualApplianceConnections(); + + /** + * 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 RoutingIntentsClient object to access its operations. + * + * @return the RoutingIntentsClient object. + */ + RoutingIntentsClient getRoutingIntents(); + + /** + * 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/NetworkManagerCommitsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerCommitsClient.java new file mode 100644 index 0000000000000..dabe02365fe26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerCommitsClient.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.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.NetworkManagerCommitInner; + +/** + * An instance of this class provides access to all the operations defined in NetworkManagerCommitsClient. + */ +public interface NetworkManagerCommitsClient { + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network Manager Commit. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkManagerCommitInner> beginPost(String resourceGroupName, + String networkManagerName, NetworkManagerCommitInner parameters); + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network Manager Commit. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkManagerCommitInner> beginPost(String resourceGroupName, + String networkManagerName, NetworkManagerCommitInner parameters, Context context); + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Manager Commit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerCommitInner post(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters); + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Manager Commit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerCommitInner post(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerDeploymentStatusOperationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerDeploymentStatusOperationsClient.java new file mode 100644 index 0000000000000..55147d8a371a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerDeploymentStatusOperationsClient.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.NetworkManagerDeploymentStatusListResultInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusParameter; + +/** + * An instance of this class provides access to all the operations defined in + * NetworkManagerDeploymentStatusOperationsClient. + */ +public interface NetworkManagerDeploymentStatusOperationsClient { + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Network Manager Deployment Status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, + String networkManagerName, NetworkManagerDeploymentStatusParameter parameters, Integer top, Context context); + + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Network Manager Deployment Status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerDeploymentStatusListResultInner list(String resourceGroupName, String networkManagerName, + NetworkManagerDeploymentStatusParameter parameters); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerRoutingConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerRoutingConfigurationsClient.java new file mode 100644 index 0000000000000..ef28316f113df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagerRoutingConfigurationsClient.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; + +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.NetworkManagerRoutingConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in NetworkManagerRoutingConfigurationsClient. + */ +public interface NetworkManagerRoutingConfigurationsClient { + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager routing configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager routing configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context); + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, Context context); + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerRoutingConfigurationInner get(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Creates or updates a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param routingConfiguration The routing configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the routing configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, + NetworkManagerRoutingConfigurationInner routingConfiguration, Context context); + + /** + * Creates or updates a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param routingConfiguration The routing configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the routing configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerRoutingConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, NetworkManagerRoutingConfigurationInner routingConfiguration); + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context); + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, Boolean force, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagersClient.java new file mode 100644 index 0000000000000..df682bfcf1596 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkManagersClient.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.NetworkManagerInner; +import com.azure.resourcemanager.network.generated.models.PatchObject; + +/** + * An instance of this class provides access to all the operations defined in NetworkManagersClient. + */ +public interface NetworkManagersClient { + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Manager along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String networkManagerName, + Context context); + + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Manager. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerInner getByResourceGroup(String resourceGroupName, String networkManagerName); + + /** + * Creates or updates a Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + NetworkManagerInner parameters, Context context); + + /** + * Creates or updates a Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerInner createOrUpdate(String resourceGroupName, String networkManagerName, + NetworkManagerInner parameters); + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName); + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, Boolean force, + Context context); + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName); + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, Boolean force, Context context); + + /** + * Patch NetworkManager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response patchWithResponse(String resourceGroupName, String networkManagerName, + PatchObject parameters, Context context); + + /** + * Patch NetworkManager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerInner patch(String resourceGroupName, String networkManagerName, PatchObject parameters); + + /** + * List all network managers 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 NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all network managers in a subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, String skipToken, Context context); + + /** + * List network managers 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 result of the request to list NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List network managers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, String skipToken, + Context context); +} 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..b0a5ff11c85bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkProfilesClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String networkProfileName, + String expand, 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkProfileName, + NetworkProfileInner parameters, 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String networkProfileName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..e628de1904d49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkSecurityGroupsClient.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; + +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String networkSecurityGroupName, String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String networkSecurityGroupName, TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/NetworkVirtualApplianceConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualApplianceConnectionsClient.java new file mode 100644 index 0000000000000..128f169f990db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualApplianceConnectionsClient.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.NetworkVirtualApplianceConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in NetworkVirtualApplianceConnectionsClient. + */ +public interface NetworkVirtualApplianceConnectionsClient { + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 the {@link SyncPoller} for polling of networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkVirtualApplianceConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters); + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 the {@link SyncPoller} for polling of networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkVirtualApplianceConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, Context context); + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceConnectionInner createOrUpdate(String resourceGroupName, String networkVirtualApplianceName, + String connectionName, NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters); + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceConnectionInner createOrUpdate(String resourceGroupName, String networkVirtualApplianceName, + String connectionName, NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, + Context context); + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, Context context); + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceConnectionInner get(String resourceGroupName, String networkVirtualApplianceName, + String connectionName); + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkVirtualApplianceName, + String connectionName); + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkVirtualApplianceName, + String connectionName, Context context); + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceName, String connectionName); + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceName, String connectionName, Context context); + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, + String networkVirtualApplianceName); + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedIterable}. + */ + @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/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..eb15516769b9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkVirtualAppliancesClient.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.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.fluent.models.NetworkVirtualApplianceInstanceIdsInner; +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String expand, 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String networkVirtualApplianceName, TagsObject parameters, 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); + + /** + * 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 the {@link SyncPoller} for polling of networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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); + + /** + * Restarts one or more VMs belonging to 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 {@link SyncPoller} for polling of specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkVirtualApplianceInstanceIdsInner> + beginRestart(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NetworkVirtualApplianceInstanceIdsInner> + beginRestart(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, Context context); + + /** + * Restarts one or more VMs belonging to 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 specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInstanceIdsInner restart(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceInstanceIdsInner restart(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..b820deaa4f004 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/NetworkWatchersClient.java @@ -0,0 +1,978 @@ +// Copyright (c) Microsoft 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkWatcherName, + NetworkWatcherInner parameters, 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 com.azure.core.management.exception.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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String networkWatcherName, + 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String networkWatcherName, + TagsObject parameters, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getTopologyWithResponse(String resourceGroupName, String networkWatcherName, + TopologyParameters parameters, 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); + + /** + * 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 the {@link SyncPoller} for polling of results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the configured and effective security group rules on the specified + * VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the configured and effective security group rules on the specified + * VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of network Configuration Diagnostic data to help customers understand + * and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of network Configuration Diagnostic data to help customers understand + * and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..a29d46d26b0ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..7a29e4483deb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/P2SVpnGatewaysClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the connection health of P2S clients of the virtual wan + * P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the connection health of P2S clients of the virtual wan + * P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of 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.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of 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.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..b9e278f2212dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PacketCapturesClient.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft 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 the {@link SyncPoller} for polling of information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkWatcherName, + String packetCaptureName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..f3236df8aee52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PeerExpressRouteCircuitConnectionsClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String circuitName, + String peeringName, String connectionName, 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 com.azure.core.management.exception.ManagementException thrown 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 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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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..201fdb7ded9ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateDnsZoneGroupsClient.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; + +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..0f69f2dedb50a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PrivateEndpointsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String privateEndpointName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..dbeef7fd13ef7 --- /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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String serviceName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of private link service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of private link service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPrivateEndpointConnectionWithResponse(String resourceGroupName, + String serviceName, String peConnectionName, String expand, 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updatePrivateEndpointConnectionWithResponse(String resourceGroupName, + String serviceName, String peConnectionName, PrivateEndpointConnectionInner parameters, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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..6dbddbbe91145 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpAddressesClient.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.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.fluent.models.PublicIpDdosProtectionStatusResultInner; +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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCloudServicePublicIpAddressWithResponse(String resourceGroupName, + String cloudServiceName, String roleInstanceName, String networkInterfaceName, String ipConfigurationName, + String publicIpAddressName, String expand, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String publicIpAddressName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of public IP address resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of public IP address resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String publicIpAddressName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the Ddos Protection Status of a 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 {@link SyncPoller} for polling of the Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PublicIpDdosProtectionStatusResultInner> + beginDdosProtectionStatus(String resourceGroupName, String publicIpAddressName); + + /** + * Gets the Ddos Protection Status of a 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 {@link SyncPoller} for polling of the Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PublicIpDdosProtectionStatusResultInner> + beginDdosProtectionStatus(String resourceGroupName, String publicIpAddressName, Context context); + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpDdosProtectionStatusResultInner ddosProtectionStatus(String resourceGroupName, String publicIpAddressName); + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicIpDdosProtectionStatusResultInner ddosProtectionStatus(String resourceGroupName, String publicIpAddressName, + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVirtualMachineScaleSetPublicIpAddressWithResponse(String resourceGroupName, + String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, + String ipConfigurationName, String publicIpAddressName, String expand, 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); +} 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..1b26df1062a9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/PublicIpPrefixesClient.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String publicIpPrefixName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String publicIpPrefixName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..c061042c7da8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceNavigationLinksClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, + String virtualNetworkName, String subnetName, 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 com.azure.core.management.exception.ManagementException 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); +} 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..d6c3aa1b48f42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ResourceProvidersClient.java @@ -0,0 +1,564 @@ +// Copyright (c) Microsoft 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.ActiveConnectivityConfigurationsListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ActiveSecurityAdminRulesListResultInner; +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.ExpressRouteProviderPortInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveConnectivityConfigurationListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveSecurityAdminRulesListResultInner; +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.ActiveConfigurationParameter; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkTokenListRequest; +import com.azure.resourcemanager.network.generated.models.QueryRequestOptions; +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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 Create/Delete/Get 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 Create/Delete/Get 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 Create/Delete/Get 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 Create/Delete/Get 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); + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteBastionShareableLinkByToken(String resourceGroupName, + String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest); + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteBastionShareableLinkByToken(String resourceGroupName, + String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest, Context context); + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest); + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest, 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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkDnsNameAvailabilityWithResponse(String location, + String domainNameLabel, 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); + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response expressRouteProviderPortWithResponse(String providerport, Context context); + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExpressRouteProviderPortInner expressRouteProviderPort(String providerport); + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active connectivity configurations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listActiveConnectivityConfigurationsWithResponse( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top, + Context context); + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active connectivity configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActiveConnectivityConfigurationsListResultInner listActiveConnectivityConfigurations(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters); + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active security admin rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listActiveSecurityAdminRulesWithResponse(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters, Integer top, Context context); + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active security admin rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ActiveSecurityAdminRulesListResultInner listActiveSecurityAdminRules(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters); + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveConnectivityConfiguration along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + listNetworkManagerEffectiveConnectivityConfigurationsWithResponse(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top, Context context); + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveConnectivityConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerEffectiveConnectivityConfigurationListResultInner + listNetworkManagerEffectiveConnectivityConfigurations(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters); + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveSecurityAdminRules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + listNetworkManagerEffectiveSecurityAdminRulesWithResponse(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters, Integer top, Context context); + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveSecurityAdminRules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerEffectiveSecurityAdminRulesListResultInner listNetworkManagerEffectiveSecurityAdminRules( + String resourceGroupName, String virtualNetworkName, QueryRequestOptions parameters); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response supportedSecurityProvidersWithResponse(String resourceGroupName, + String virtualWanName, 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); + + /** + * 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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..77275b4460439 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFilterRulesClient.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..8c7a6e07a6d9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteFiltersClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String routeFilterName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String routeFilterName, + TagsObject parameters, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/RouteMapsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteMapsClient.java new file mode 100644 index 0000000000000..13c24ff954950 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteMapsClient.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.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.RouteMapInner; + +/** + * An instance of this class provides access to all the operations defined in RouteMapsClient. + */ +public interface RouteMapsClient { + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String virtualHubName, String routeMapName, + Context context); + + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteMapInner get(String resourceGroupName, String virtualHubName, String routeMapName); + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteMapInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters); + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RouteMapInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters, Context context); + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteMapInner createOrUpdate(String resourceGroupName, String virtualHubName, String routeMapName, + RouteMapInner routeMapParameters); + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RouteMapInner createOrUpdate(String resourceGroupName, String virtualHubName, String routeMapName, + RouteMapInner routeMapParameters, Context context); + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routeMapName); + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, String routeMapName, + Context context); + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeMapName); + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routeMapName, Context context); + + /** + * Retrieves the details of all RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedIterable}. + */ + @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/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..4ec66ba3dd110 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RouteTablesClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String routeTableName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of route table resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route table resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String routeTableName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..0f280c9660c2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutesClient.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of route resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/RoutingIntentsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingIntentsClient.java new file mode 100644 index 0000000000000..6ed1194344fd6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingIntentsClient.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.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.RoutingIntentInner; + +/** + * An instance of this class provides access to all the operations defined in RoutingIntentsClient. + */ +public interface RoutingIntentsClient { + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RoutingIntentInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routingIntentName, RoutingIntentInner routingIntentParameters); + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RoutingIntentInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routingIntentName, RoutingIntentInner routingIntentParameters, Context context); + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutingIntentInner createOrUpdate(String resourceGroupName, String virtualHubName, String routingIntentName, + RoutingIntentInner routingIntentParameters); + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutingIntentInner createOrUpdate(String resourceGroupName, String virtualHubName, String routingIntentName, + RoutingIntentInner routingIntentParameters, Context context); + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String virtualHubName, + String routingIntentName, Context context); + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutingIntentInner get(String resourceGroupName, String virtualHubName, String routingIntentName); + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routingIntentName); + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routingIntentName, Context context); + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routingIntentName); + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 routingIntentName, Context context); + + /** + * Retrieves the details of all RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedIterable}. + */ + @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/RoutingRuleCollectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingRuleCollectionsClient.java new file mode 100644 index 0000000000000..0249af111cc1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingRuleCollectionsClient.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.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.RoutingRuleCollectionInner; + +/** + * An instance of this class provides access to all the operations defined in RoutingRuleCollectionsClient. + */ +public interface RoutingRuleCollectionsClient { + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 routing configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager routing configuration rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context); + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager routing configuration rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutingRuleCollectionInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Creates or updates a routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the routing rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, RoutingRuleCollectionInner ruleCollection, + Context context); + + /** + * Creates or updates a routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the routing rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutingRuleCollectionInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, RoutingRuleCollectionInner ruleCollection); + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName); + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context); + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingRulesClient.java new file mode 100644 index 0000000000000..3300e626866bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/RoutingRulesClient.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.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.RoutingRuleInner; + +/** + * An instance of this class provides access to all the operations defined in RoutingRulesClient. + */ +public interface RoutingRulesClient { + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context); + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutingRuleInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Creates or updates an routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param routingRule The routing rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 routing rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, RoutingRuleInner routingRule, + Context context); + + /** + * Creates or updates an routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param routingRule The routing rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 routing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RoutingRuleInner createOrUpdate(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, RoutingRuleInner routingRule); + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName); + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context); + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ScopeConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ScopeConnectionsClient.java new file mode 100644 index 0000000000000..d38c1066567f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ScopeConnectionsClient.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; + +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.ScopeConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in ScopeConnectionsClient. + */ +public interface ScopeConnectionsClient { + /** + * Creates or updates scope connection from Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant connection. + * @param parameters Scope connection to be created/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 the Scope Connections resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String scopeConnectionName, ScopeConnectionInner parameters, Context context); + + /** + * Creates or updates scope connection from Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant connection. + * @param parameters Scope connection to be created/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 the Scope Connections resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeConnectionInner createOrUpdate(String resourceGroupName, String networkManagerName, String scopeConnectionName, + ScopeConnectionInner parameters); + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String scopeConnectionName, Context context); + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeConnectionInner get(String resourceGroupName, String networkManagerName, String scopeConnectionName); + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String networkManagerName, String scopeConnectionName, + Context context); + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 networkManagerName, String scopeConnectionName); + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 scope connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 scope connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityAdminConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityAdminConfigurationsClient.java new file mode 100644 index 0000000000000..cd4bb47ed00aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityAdminConfigurationsClient.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; + +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.SecurityAdminConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in SecurityAdminConfigurationsClient. + */ +public interface SecurityAdminConfigurationsClient { + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security admin configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security admin configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context); + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context); + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityAdminConfigurationInner get(String resourceGroupName, String networkManagerName, String configurationName); + + /** + * Creates or updates a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityAdminConfiguration The security admin configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the security admin configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, SecurityAdminConfigurationInner securityAdminConfiguration, + Context context); + + /** + * Creates or updates a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityAdminConfiguration The security admin configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the security admin configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityAdminConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, SecurityAdminConfigurationInner securityAdminConfiguration); + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context); + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, Boolean force, + 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..661639981614b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityPartnerProvidersClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String securityPartnerProviderName, TagsObject 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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..76482841f57d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityRulesClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of network security rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of network security rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/SecurityUserConfigurationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserConfigurationsClient.java new file mode 100644 index 0000000000000..345b84b1cb383 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserConfigurationsClient.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; + +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.SecurityUserConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in SecurityUserConfigurationsClient. + */ +public interface SecurityUserConfigurationsClient { + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security user configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security user configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context); + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context); + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityUserConfigurationInner get(String resourceGroupName, String networkManagerName, String configurationName); + + /** + * Creates or updates a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityUserConfiguration The security user configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the security user configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, SecurityUserConfigurationInner securityUserConfiguration, + Context context); + + /** + * Creates or updates a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityUserConfiguration The security user configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the security user configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityUserConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, SecurityUserConfigurationInner securityUserConfiguration); + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context); + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, Boolean force, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRuleCollectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRuleCollectionsClient.java new file mode 100644 index 0000000000000..7317c3d3ca8f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRuleCollectionsClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft 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.SecurityUserRuleCollectionInner; + +/** + * An instance of this class provides access to all the operations defined in SecurityUserRuleCollectionsClient. + */ +public interface SecurityUserRuleCollectionsClient { + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security user configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security user configuration rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context); + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security user configuration rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityUserRuleCollectionInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Creates or updates a security user rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param securityUserRuleCollection The Security User Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the security user rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + SecurityUserRuleCollectionInner securityUserRuleCollection, Context context); + + /** + * Creates or updates a security user rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param securityUserRuleCollection The Security User Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 the security user rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityUserRuleCollectionInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, + SecurityUserRuleCollectionInner securityUserRuleCollection); + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName); + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context); + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRulesClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRulesClient.java new file mode 100644 index 0000000000000..2236aa2c1eccd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SecurityUserRulesClient.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.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.SecurityUserRuleInner; + +/** + * An instance of this class provides access to all the operations defined in SecurityUserRulesClient. + */ +public interface SecurityUserRulesClient { + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName); + + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context); + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context); + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityUserRuleInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Creates or updates a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param securityUserRule The security user rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, SecurityUserRuleInner securityUserRule, + Context context); + + /** + * Creates or updates a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param securityUserRule The security user rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecurityUserRuleInner createOrUpdate(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, SecurityUserRuleInner securityUserRule); + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName); + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context); + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, 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..b96c07be20cae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceAssociationLinksClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, + String virtualNetworkName, String subnetName, 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 com.azure.core.management.exception.ManagementException 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); +} 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..f0423f08e732b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPoliciesClient.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; + +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String serviceEndpointPolicyName, String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String serviceEndpointPolicyName, TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..d4af1329011c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceEndpointPolicyDefinitionsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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/ServiceTagInformationsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagInformationsClient.java new file mode 100644 index 0000000000000..628677efb9f1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagInformationsClient.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; + +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.ServiceTagInformationInner; + +/** + * An instance of this class provides access to all the operations defined in ServiceTagInformationsClient. + */ +public interface ServiceTagInformationsClient { + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 with pagination as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 noAddressPrefixes Do not return address prefixes for the tag(s). + * @param tagName Return tag information for a particular tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 with pagination as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Boolean noAddressPrefixes, String tagName, + 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..f6e55e72a4a4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/ServiceTagsClient.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.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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String location, 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 com.azure.core.management.exception.ManagementException 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); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/StaticMembersClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/StaticMembersClient.java new file mode 100644 index 0000000000000..a79e8a5541f32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/StaticMembersClient.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; + +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.StaticMemberInner; + +/** + * An instance of this class provides access to all the operations defined in StaticMembersClient. + */ +public interface StaticMembersClient { + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, Context context); + + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StaticMemberInner get(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName); + + /** + * Creates or updates a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param parameters Parameters supplied to the specify the static member to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return staticMember Item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, StaticMemberInner parameters, Context context); + + /** + * Creates or updates a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param parameters Parameters supplied to the specify the static member to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return staticMember Item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StaticMemberInner createOrUpdate(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName, StaticMemberInner parameters); + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName, Context context); + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 networkManagerName, String networkGroupName, String staticMemberName); + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 StaticMember as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, String networkGroupName); + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 StaticMember as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String networkManagerName, String networkGroupName, + Integer top, String skipToken, 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..3366b6f219796 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubnetsClient.java @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String virtualNetworkName, String subnetName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/SubscriptionNetworkManagerConnectionsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubscriptionNetworkManagerConnectionsClient.java new file mode 100644 index 0000000000000..1402fd8448753 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/SubscriptionNetworkManagerConnectionsClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft 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.NetworkManagerConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in + * SubscriptionNetworkManagerConnectionsClient. + */ +public interface SubscriptionNetworkManagerConnectionsClient { + /** + * Create a network manager connection on this subscription. + * + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String networkManagerConnectionName, + NetworkManagerConnectionInner parameters, Context context); + + /** + * Create a network manager connection on this subscription. + * + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerConnectionInner createOrUpdate(String networkManagerConnectionName, + NetworkManagerConnectionInner parameters); + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String networkManagerConnectionName, Context context); + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkManagerConnectionInner get(String networkManagerConnectionName); + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String networkManagerConnectionName, Context context); + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 networkManagerConnectionName); + + /** + * List all network manager connections created by this 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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all network manager connections created by this subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, String skipToken, 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..3f863a3ca3fa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/UsagesClient.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.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/VipSwapsClient.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VipSwapsClient.java new file mode 100644 index 0000000000000..854b310acd49d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VipSwapsClient.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.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.SwapResourceInner; +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceListResultInner; + +/** + * An instance of this class provides access to all the operations defined in VipSwapsClient. + */ +public interface VipSwapsClient { + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String groupName, String resourceName, Context context); + + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SwapResourceInner get(String groupName, String resourceName); + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCreate(String groupName, String resourceName, SwapResourceInner parameters); + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginCreate(String groupName, String resourceName, SwapResourceInner parameters, + Context context); + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void create(String groupName, String resourceName, SwapResourceInner parameters); + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void create(String groupName, String resourceName, SwapResourceInner parameters, Context context); + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String groupName, String resourceName, Context context); + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SwapResourceListResultInner list(String groupName, String resourceName); +} 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..f53de87c6a287 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSitesClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..d68d99e2ed24d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualApplianceSkusClient.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.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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * 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 available NetworkVirtualApplianceSkus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String skuName, 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 available NetworkVirtualApplianceSkus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkVirtualApplianceSkuInner get(String skuName); +} 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..8ac4948a97599 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubBgpConnectionsClient.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.models.PeerRoute; +import java.util.List; +import java.util.Map; + +/** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String virtualHubName, String connectionName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>>, Map>> + 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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>>, Map>> + 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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map> 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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map> 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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>>, Map>> + 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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller>>, Map>> + 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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map> 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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map> 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..36222bf0e0540 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubIpConfigurationsClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String virtualHubName, + String ipConfigName, 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..35bec8321f3d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubRouteTableV2SClient.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.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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String virtualHubName, + String routeTableName, 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 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); + + /** + * 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 the {@link SyncPoller} for polling of virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response + * with {@link PagedIterable}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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..cd3c1a7cc7126 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualHubsClient.java @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft 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.EffectiveRouteMapRouteListInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubEffectiveRouteListInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetInboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetOutboundRoutesParameters; +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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualHubName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String virtualHubName, + TagsObject 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the effective routes configured for the Virtual Hub resource or the + * specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualHubEffectiveRouteListInner> + beginGetEffectiveVirtualHubRoutes(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. + * @return the {@link SyncPoller} for polling of the effective routes configured for the Virtual Hub resource or the + * specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualHubEffectiveRouteListInner> + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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) + VirtualHubEffectiveRouteListInner 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. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VirtualHubEffectiveRouteListInner getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, Context context); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the inbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EffectiveRouteMapRouteListInner> beginGetInboundRoutes( + String resourceGroupName, String virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the inbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EffectiveRouteMapRouteListInner> beginGetInboundRoutes( + String resourceGroupName, String virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, + Context context); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveRouteMapRouteListInner getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveRouteMapRouteListInner getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, Context context); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the outbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EffectiveRouteMapRouteListInner> beginGetOutboundRoutes( + String resourceGroupName, String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the outbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EffectiveRouteMapRouteListInner> beginGetOutboundRoutes( + String resourceGroupName, String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, + Context context); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveRouteMapRouteListInner getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EffectiveRouteMapRouteListInner getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, 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..7f572fc6fe214 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayConnectionsClient.java @@ -0,0 +1,683 @@ +// Copyright (c) Microsoft 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSharedKeyWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, 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 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 {@link SyncPoller} for polling of the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture(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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..53fa11f66fb27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewayNatRulesClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String virtualNetworkGatewayName, String natRuleName, 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..76439eb120317 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkGatewaysClient.java @@ -0,0 +1,1227 @@ +// Copyright (c) Microsoft 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkGatewayName, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworkGatewayInner> beginReset(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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of pre-generated VPN profile for P2S client of the virtual network + * gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of pre-generated VPN profile for P2S client of the virtual network + * gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BgpPeerStatusListResultInner> + beginGetBgpPeerStatus(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 the {@link SyncPoller} for polling of response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response supportedVpnDevicesWithResponse(String resourceGroupName, String virtualNetworkGatewayName, + 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); + + /** + * 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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response vpnDeviceConfigurationScriptWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture(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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vPN client connection health detail per P2S client connection of + * the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 the {@link SyncPoller} for polling of vPN client connection health detail per P2S client connection of + * the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..c4fcecd3da504 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkPeeringsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + 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 the {@link SyncPoller} for polling of peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..da303145b14a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworkTapsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String tapName, + TagsObject tapParameters, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..e0260d86a4c5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualNetworksClient.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.IpAddressAvailabilityResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpDdosProtectionStatusResultInner; +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualNetworkName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String virtualNetworkName, + TagsObject 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkIpAddressAvailabilityWithResponse(String resourceGroupName, + String virtualNetworkName, String ipAddress, 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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName, + Context context); + + /** + * Gets the Ddos Protection Status of all IP Addresses under the 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 Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName); + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName, Integer top, String skipToken, 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..b01bc34adb645 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRouterPeeringsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(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); + + /** + * 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 the {@link SyncPoller} for polling of virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..0af0d54968d74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualRoutersClient.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualRouterName, + String expand, 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); + + /** + * 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 the {@link SyncPoller} for polling of virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..f2bca83f67057 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VirtualWansClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualWanName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String virtualWanName, + TagsObject 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..23d87c5e481da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnConnectionsClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String gatewayName, String connectionName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture(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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStopPacketCapture(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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..64a53dfe41d90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnGatewaysClient.java @@ -0,0 +1,444 @@ +// Copyright (c) Microsoft 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VpnGatewayInner> beginReset(String resourceGroupName, String gatewayName, + String ipConfigurationId, 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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VpnGatewayInner reset(String resourceGroupName, String gatewayName, String ipConfigurationId, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStartPacketCapture(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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, String> beginStopPacketCapture(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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..1661284b407de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnLinkConnectionsClient.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft 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.ConnectionSharedKeyResultInner; +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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName); + + /** + * Lists all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context); + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDefaultSharedKeyWithResponse(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, Context context); + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyResultInner getDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName); + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 {@link SyncPoller} for polling of sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionSharedKeyResultInner> + beginSetOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters); + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 {@link SyncPoller} for polling of sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionSharedKeyResultInner> + beginSetOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters, Context context); + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyResultInner setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters); + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyResultInner setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters, + Context context); + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listDefaultSharedKeyWithResponse(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, Context context); + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionSharedKeyResultInner listDefaultSharedKey(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..5dd619b3b6006 --- /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 the {@link SyncPoller} for polling of vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..be33a900731d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnServerConfigurationsClient.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String vpnServerConfigurationName, 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, + String vpnServerConfigurationName, TagsObject 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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..185a5812d5c3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinkConnectionsClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, 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 com.azure.core.management.exception.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); +} 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..7be62c174d9fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSiteLinksClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..6696f53f6d674 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesClient.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String vpnSiteName, + 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 com.azure.core.management.exception.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); + + /** + * 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 the {@link SyncPoller} for polling of vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse(String resourceGroupName, String vpnSiteName, + TagsObject 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..27fcf160b1874 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/VpnSitesConfigurationsClient.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.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..cc80a1c689e67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebApplicationFirewallPoliciesClient.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; + +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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String policyName, 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); + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String policyName, + WebApplicationFirewallPolicyInner parameters, 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); + + /** + * 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..768ebe37d1676 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/WebCategoriesClient.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.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. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String name, String expand, Context context); + + /** + * 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 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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/ActiveConnectivityConfigurationsListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveConnectivityConfigurationsListResultInner.java new file mode 100644 index 0000000000000..3e021d5f0d10c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveConnectivityConfigurationsListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ActiveConnectivityConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list active connectivity configurations. It contains a list of active connectivity + * configurations and a skiptoken to get the next set of results. + */ +@Fluent +public final class ActiveConnectivityConfigurationsListResultInner + implements JsonSerializable { + /* + * Gets a page of active connectivity configurations. + */ + private List value; + + /* + * When present, the value can be passed to a subsequent query call (together with the same query and scopes used in + * the current request) to retrieve the next page of data. + */ + private String skipToken; + + /** + * Creates an instance of ActiveConnectivityConfigurationsListResultInner class. + */ + public ActiveConnectivityConfigurationsListResultInner() { + } + + /** + * Get the value property: Gets a page of active connectivity configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of active connectivity configurations. + * + * @param value the value value to set. + * @return the ActiveConnectivityConfigurationsListResultInner object itself. + */ + public ActiveConnectivityConfigurationsListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @param skipToken the skipToken value to set. + * @return the ActiveConnectivityConfigurationsListResultInner object itself. + */ + public ActiveConnectivityConfigurationsListResultInner withSkipToken(String skipToken) { + this.skipToken = skipToken; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveConnectivityConfigurationsListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveConnectivityConfigurationsListResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveConnectivityConfigurationsListResultInner. + */ + public static ActiveConnectivityConfigurationsListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveConnectivityConfigurationsListResultInner deserializedActiveConnectivityConfigurationsListResultInner + = new ActiveConnectivityConfigurationsListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ActiveConnectivityConfiguration.fromJson(reader1)); + deserializedActiveConnectivityConfigurationsListResultInner.value = value; + } else if ("skipToken".equals(fieldName)) { + deserializedActiveConnectivityConfigurationsListResultInner.skipToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveConnectivityConfigurationsListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveSecurityAdminRulesListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveSecurityAdminRulesListResultInner.java new file mode 100644 index 0000000000000..b1e423574f315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ActiveSecurityAdminRulesListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ActiveBaseSecurityAdminRule; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list active security admin rules. It contains a list of active security admin rules and a + * skiptoken to get the next set of results. + */ +@Fluent +public final class ActiveSecurityAdminRulesListResultInner + implements JsonSerializable { + /* + * Gets a page of active security admin rules. + */ + private List value; + + /* + * When present, the value can be passed to a subsequent query call (together with the same query and scopes used in + * the current request) to retrieve the next page of data. + */ + private String skipToken; + + /** + * Creates an instance of ActiveSecurityAdminRulesListResultInner class. + */ + public ActiveSecurityAdminRulesListResultInner() { + } + + /** + * Get the value property: Gets a page of active security admin rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of active security admin rules. + * + * @param value the value value to set. + * @return the ActiveSecurityAdminRulesListResultInner object itself. + */ + public ActiveSecurityAdminRulesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @param skipToken the skipToken value to set. + * @return the ActiveSecurityAdminRulesListResultInner object itself. + */ + public ActiveSecurityAdminRulesListResultInner withSkipToken(String skipToken) { + this.skipToken = skipToken; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveSecurityAdminRulesListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveSecurityAdminRulesListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveSecurityAdminRulesListResultInner. + */ + public static ActiveSecurityAdminRulesListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveSecurityAdminRulesListResultInner deserializedActiveSecurityAdminRulesListResultInner + = new ActiveSecurityAdminRulesListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ActiveBaseSecurityAdminRule.fromJson(reader1)); + deserializedActiveSecurityAdminRulesListResultInner.value = value; + } else if ("skipToken".equals(fieldName)) { + deserializedActiveSecurityAdminRulesListResultInner.skipToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveSecurityAdminRulesListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminPropertiesFormat.java new file mode 100644 index 0000000000000..6dbd457838ea1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminPropertiesFormat.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.io.IOException; +import java.util.List; + +/** + * Security admin rule resource. + */ +@Fluent +public final class AdminPropertiesFormat implements JsonSerializable { + /* + * A description for this rule. Restricted to 140 chars. + */ + private String description; + + /* + * Network protocol this rule applies to. + */ + private SecurityConfigurationRuleProtocol protocol; + + /* + * The CIDR or source IP ranges. + */ + private List sources; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + private List destinations; + + /* + * The source port ranges. + */ + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + private List destinationPortRanges; + + /* + * Indicates the access allowed for this particular rule + */ + private SecurityConfigurationRuleAccess access; + + /* + * The priority of the rule. The value can be between 1 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. + */ + private int priority; + + /* + * Indicates if the traffic matched against the rule in inbound or outbound. + */ + private SecurityConfigurationRuleDirection direction; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of AdminPropertiesFormat class. + */ + public AdminPropertiesFormat() { + } + + /** + * 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 AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withProtocol(SecurityConfigurationRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Set the sources property: The CIDR or source IP ranges. + * + * @param sources the sources value to set. + * @return the AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withSources(List sources) { + this.sources = sources; + return this; + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @param destinations the destinations value to set. + * @return the AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withDestinations(List destinations) { + this.destinations = destinations; + 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 AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat 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 AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.access; + } + + /** + * Set the access property: Indicates the access allowed for this particular rule. + * + * @param access the access value to set. + * @return the AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withAccess(SecurityConfigurationRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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 int priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the rule. The value can be between 1 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 AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @param direction the direction value to set. + * @return the AdminPropertiesFormat object itself. + */ + public AdminPropertiesFormat withDirection(SecurityConfigurationRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property protocol in model AdminPropertiesFormat")); + } + if (sources() != null) { + sources().forEach(e -> e.validate()); + } + if (destinations() != null) { + destinations().forEach(e -> e.validate()); + } + if (access() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property access in model AdminPropertiesFormat")); + } + if (direction() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property direction in model AdminPropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdminPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("access", this.access == null ? null : this.access.toString()); + jsonWriter.writeIntField("priority", this.priority); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sourcePortRanges", this.sourcePortRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPortRanges", this.destinationPortRanges, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdminPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdminPropertiesFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdminPropertiesFormat. + */ + public static AdminPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdminPropertiesFormat deserializedAdminPropertiesFormat = new AdminPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedAdminPropertiesFormat.protocol + = SecurityConfigurationRuleProtocol.fromString(reader.getString()); + } else if ("access".equals(fieldName)) { + deserializedAdminPropertiesFormat.access + = SecurityConfigurationRuleAccess.fromString(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedAdminPropertiesFormat.priority = reader.getInt(); + } else if ("direction".equals(fieldName)) { + deserializedAdminPropertiesFormat.direction + = SecurityConfigurationRuleDirection.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedAdminPropertiesFormat.description = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> AddressPrefixItem.fromJson(reader1)); + deserializedAdminPropertiesFormat.sources = sources; + } else if ("destinations".equals(fieldName)) { + List destinations + = reader.readArray(reader1 -> AddressPrefixItem.fromJson(reader1)); + deserializedAdminPropertiesFormat.destinations = destinations; + } else if ("sourcePortRanges".equals(fieldName)) { + List sourcePortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedAdminPropertiesFormat.sourcePortRanges = sourcePortRanges; + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedAdminPropertiesFormat.destinationPortRanges = destinationPortRanges; + } else if ("provisioningState".equals(fieldName)) { + deserializedAdminPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedAdminPropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdminPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionInner.java new file mode 100644 index 0000000000000..53e0f9ddf76f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.NetworkManagerSecurityGroupItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Defines the admin rule collection. + */ +@Fluent +public final class AdminRuleCollectionInner extends ChildResource { + /* + * Indicates the properties for the network manager admin rule collection. + */ + private AdminRuleCollectionPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AdminRuleCollectionInner class. + */ + public AdminRuleCollectionInner() { + } + + /** + * Get the innerProperties property: Indicates the properties for the network manager admin rule collection. + * + * @return the innerProperties value. + */ + private AdminRuleCollectionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the admin rule collection. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the admin rule collection. + * + * @param description the description value to set. + * @return the AdminRuleCollectionInner object itself. + */ + public AdminRuleCollectionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminRuleCollectionPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.innerProperties() == null ? null : this.innerProperties().appliesToGroups(); + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the AdminRuleCollectionInner object itself. + */ + public AdminRuleCollectionInner withAppliesToGroups(List appliesToGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminRuleCollectionPropertiesFormat(); + } + this.innerProperties().withAppliesToGroups(appliesToGroups); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdminRuleCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdminRuleCollectionInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdminRuleCollectionInner. + */ + public static AdminRuleCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdminRuleCollectionInner deserializedAdminRuleCollectionInner = new AdminRuleCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAdminRuleCollectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAdminRuleCollectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAdminRuleCollectionInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAdminRuleCollectionInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAdminRuleCollectionInner.innerProperties + = AdminRuleCollectionPropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAdminRuleCollectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdminRuleCollectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionPropertiesFormat.java new file mode 100644 index 0000000000000..1642742e10ee4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AdminRuleCollectionPropertiesFormat.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NetworkManagerSecurityGroupItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Defines the admin rule collection properties. + */ +@Fluent +public final class AdminRuleCollectionPropertiesFormat + implements JsonSerializable { + /* + * A description of the admin rule collection. + */ + private String description; + + /* + * Groups for configuration + */ + private List appliesToGroups; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of AdminRuleCollectionPropertiesFormat class. + */ + public AdminRuleCollectionPropertiesFormat() { + } + + /** + * Get the description property: A description of the admin rule collection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the admin rule collection. + * + * @param description the description value to set. + * @return the AdminRuleCollectionPropertiesFormat object itself. + */ + public AdminRuleCollectionPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.appliesToGroups; + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the AdminRuleCollectionPropertiesFormat object itself. + */ + public AdminRuleCollectionPropertiesFormat + withAppliesToGroups(List appliesToGroups) { + this.appliesToGroups = appliesToGroups; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appliesToGroups() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appliesToGroups in model AdminRuleCollectionPropertiesFormat")); + } else { + appliesToGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AdminRuleCollectionPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("appliesToGroups", this.appliesToGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdminRuleCollectionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdminRuleCollectionPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdminRuleCollectionPropertiesFormat. + */ + public static AdminRuleCollectionPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdminRuleCollectionPropertiesFormat deserializedAdminRuleCollectionPropertiesFormat + = new AdminRuleCollectionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appliesToGroups".equals(fieldName)) { + List appliesToGroups + = reader.readArray(reader1 -> NetworkManagerSecurityGroupItem.fromJson(reader1)); + deserializedAdminRuleCollectionPropertiesFormat.appliesToGroups = appliesToGroups; + } else if ("description".equals(fieldName)) { + deserializedAdminRuleCollectionPropertiesFormat.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedAdminRuleCollectionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedAdminRuleCollectionPropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdminRuleCollectionPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.java new file mode 100644 index 0000000000000..4928da9f21549 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAuthenticationCertificatePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Authentication certificates properties of an application gateway. + */ +@Fluent +public final class ApplicationGatewayAuthenticationCertificatePropertiesFormat + implements JsonSerializable { + /* + * Certificate public data. + */ + private String data; + + /* + * The provisioning state of the authentication certificate resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayAuthenticationCertificatePropertiesFormat class. + */ + public ApplicationGatewayAuthenticationCertificatePropertiesFormat() { + } + + /** + * 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 ApplicationGatewayAuthenticationCertificatePropertiesFormat object itself. + */ + public ApplicationGatewayAuthenticationCertificatePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("data", this.data); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayAuthenticationCertificatePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayAuthenticationCertificatePropertiesFormat if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ApplicationGatewayAuthenticationCertificatePropertiesFormat. + */ + public static ApplicationGatewayAuthenticationCertificatePropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayAuthenticationCertificatePropertiesFormat deserializedApplicationGatewayAuthenticationCertificatePropertiesFormat + = new ApplicationGatewayAuthenticationCertificatePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + deserializedApplicationGatewayAuthenticationCertificatePropertiesFormat.data = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayAuthenticationCertificatePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayAuthenticationCertificatePropertiesFormat; + }); + } +} 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..b88bdd3135bb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + */ +@Fluent +public final class ApplicationGatewayAvailableSslOptionsInner extends Resource { + /* + * Properties of the application gateway available SSL options. + */ + private ApplicationGatewayAvailableSslOptionsPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ApplicationGatewayAvailableSslOptionsInner class. + */ + public ApplicationGatewayAvailableSslOptionsInner() { + } + + /** + * Get the innerProperties property: Properties of the application gateway available SSL options. + * + * @return the innerProperties value. + */ + private ApplicationGatewayAvailableSslOptionsPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayAvailableSslOptionsInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayAvailableSslOptionsInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the predefinedPolicies property: List of available Ssl predefined policy. + * + * @return the predefinedPolicies value. + */ + public List predefinedPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); + } + this.innerProperties().withPredefinedPolicies(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); + } + this.innerProperties().withDefaultPolicy(defaultPolicy); + return this; + } + + /** + * Get the availableCipherSuites property: List of available Ssl cipher suites. + * + * @return the availableCipherSuites value. + */ + public List availableCipherSuites() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); + } + this.innerProperties().withAvailableCipherSuites(availableCipherSuites); + return this; + } + + /** + * Get the availableProtocols property: List of available Ssl protocols. + * + * @return the availableProtocols value. + */ + public List availableProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); + } + this.innerProperties().withAvailableProtocols(availableProtocols); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayAvailableSslOptionsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayAvailableSslOptionsInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayAvailableSslOptionsInner. + */ + public static ApplicationGatewayAvailableSslOptionsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayAvailableSslOptionsInner deserializedApplicationGatewayAvailableSslOptionsInner + = new ApplicationGatewayAvailableSslOptionsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApplicationGatewayAvailableSslOptionsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayAvailableSslOptionsInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedApplicationGatewayAvailableSslOptionsInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicationGatewayAvailableSslOptionsInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayAvailableSslOptionsInner.innerProperties + = ApplicationGatewayAvailableSslOptionsPropertiesFormat.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedApplicationGatewayAvailableSslOptionsInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayAvailableSslOptionsInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.java new file mode 100644 index 0000000000000..55adecdf36e08 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableSslOptionsPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.io.IOException; +import java.util.List; + +/** + * Properties of ApplicationGatewayAvailableSslOptions. + */ +@Fluent +public final class ApplicationGatewayAvailableSslOptionsPropertiesFormat + implements JsonSerializable { + /* + * List of available Ssl predefined policy. + */ + private List predefinedPolicies; + + /* + * Name of the Ssl predefined policy applied by default to application gateway. + */ + private ApplicationGatewaySslPolicyName defaultPolicy; + + /* + * List of available Ssl cipher suites. + */ + private List availableCipherSuites; + + /* + * List of available Ssl protocols. + */ + private List availableProtocols; + + /** + * Creates an instance of ApplicationGatewayAvailableSslOptionsPropertiesFormat class. + */ + public ApplicationGatewayAvailableSslOptionsPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. + */ + public ApplicationGatewayAvailableSslOptionsPropertiesFormat + 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 ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. + */ + public ApplicationGatewayAvailableSslOptionsPropertiesFormat + 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 ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. + */ + public ApplicationGatewayAvailableSslOptionsPropertiesFormat + 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 ApplicationGatewayAvailableSslOptionsPropertiesFormat object itself. + */ + public ApplicationGatewayAvailableSslOptionsPropertiesFormat + withAvailableProtocols(List availableProtocols) { + this.availableProtocols = availableProtocols; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("predefinedPolicies", this.predefinedPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("defaultPolicy", this.defaultPolicy == null ? null : this.defaultPolicy.toString()); + jsonWriter.writeArrayField("availableCipherSuites", this.availableCipherSuites, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("availableProtocols", this.availableProtocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayAvailableSslOptionsPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayAvailableSslOptionsPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayAvailableSslOptionsPropertiesFormat. + */ + public static ApplicationGatewayAvailableSslOptionsPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayAvailableSslOptionsPropertiesFormat deserializedApplicationGatewayAvailableSslOptionsPropertiesFormat + = new ApplicationGatewayAvailableSslOptionsPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("predefinedPolicies".equals(fieldName)) { + List predefinedPolicies = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewayAvailableSslOptionsPropertiesFormat.predefinedPolicies + = predefinedPolicies; + } else if ("defaultPolicy".equals(fieldName)) { + deserializedApplicationGatewayAvailableSslOptionsPropertiesFormat.defaultPolicy + = ApplicationGatewaySslPolicyName.fromString(reader.getString()); + } else if ("availableCipherSuites".equals(fieldName)) { + List availableCipherSuites + = reader.readArray(reader1 -> ApplicationGatewaySslCipherSuite.fromString(reader1.getString())); + deserializedApplicationGatewayAvailableSslOptionsPropertiesFormat.availableCipherSuites + = availableCipherSuites; + } else if ("availableProtocols".equals(fieldName)) { + List availableProtocols + = reader.readArray(reader1 -> ApplicationGatewaySslProtocol.fromString(reader1.getString())); + deserializedApplicationGatewayAvailableSslOptionsPropertiesFormat.availableProtocols + = availableProtocols; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayAvailableSslOptionsPropertiesFormat; + }); + } +} 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..552fee63baee4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayAvailableWafRuleSetsResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleSet; +import java.io.IOException; +import java.util.List; + +/** + * Response for ApplicationGatewayAvailableWafRuleSets API service call. + */ +@Fluent +public final class ApplicationGatewayAvailableWafRuleSetsResultInner + implements JsonSerializable { + /* + * The list of application gateway rule sets. + */ + private List value; + + /** + * Creates an instance of ApplicationGatewayAvailableWafRuleSetsResultInner class. + */ + public ApplicationGatewayAvailableWafRuleSetsResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayAvailableWafRuleSetsResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayAvailableWafRuleSetsResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayAvailableWafRuleSetsResultInner. + */ + public static ApplicationGatewayAvailableWafRuleSetsResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayAvailableWafRuleSetsResultInner deserializedApplicationGatewayAvailableWafRuleSetsResultInner + = new ApplicationGatewayAvailableWafRuleSetsResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApplicationGatewayFirewallRuleSet.fromJson(reader1)); + deserializedApplicationGatewayAvailableWafRuleSetsResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayAvailableWafRuleSetsResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.java new file mode 100644 index 0000000000000..50064cddeec92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendAddressPoolPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddress; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Backend Address Pool of an application gateway. + */ +@Fluent +public final class ApplicationGatewayBackendAddressPoolPropertiesFormat + implements JsonSerializable { + /* + * Collection of references to IPs defined in network interfaces. + */ + private List backendIpConfigurations; + + /* + * Backend addresses. + */ + private List backendAddresses; + + /* + * The provisioning state of the backend address pool resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayBackendAddressPoolPropertiesFormat class. + */ + public ApplicationGatewayBackendAddressPoolPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayBackendAddressPoolPropertiesFormat object itself. + */ + public ApplicationGatewayBackendAddressPoolPropertiesFormat + 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("backendAddresses", this.backendAddresses, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendAddressPoolPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendAddressPoolPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendAddressPoolPropertiesFormat. + */ + public static ApplicationGatewayBackendAddressPoolPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendAddressPoolPropertiesFormat deserializedApplicationGatewayBackendAddressPoolPropertiesFormat + = new ApplicationGatewayBackendAddressPoolPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backendIPConfigurations".equals(fieldName)) { + List backendIpConfigurations + = reader.readArray(reader1 -> NetworkInterfaceIpConfigurationInner.fromJson(reader1)); + deserializedApplicationGatewayBackendAddressPoolPropertiesFormat.backendIpConfigurations + = backendIpConfigurations; + } else if ("backendAddresses".equals(fieldName)) { + List backendAddresses + = reader.readArray(reader1 -> ApplicationGatewayBackendAddress.fromJson(reader1)); + deserializedApplicationGatewayBackendAddressPoolPropertiesFormat.backendAddresses + = backendAddresses; + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayBackendAddressPoolPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendAddressPoolPropertiesFormat; + }); + } +} 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..f6faa372cc882 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthPool; +import java.io.IOException; +import java.util.List; + +/** + * Response for ApplicationGatewayBackendHealth API service call. + */ +@Fluent +public final class ApplicationGatewayBackendHealthInner + implements JsonSerializable { + /* + * A list of ApplicationGatewayBackendHealthPool resources. + */ + private List backendAddressPools; + + /** + * Creates an instance of ApplicationGatewayBackendHealthInner class. + */ + public ApplicationGatewayBackendHealthInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("backendAddressPools", this.backendAddressPools, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendHealthInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendHealthInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendHealthInner. + */ + public static ApplicationGatewayBackendHealthInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendHealthInner deserializedApplicationGatewayBackendHealthInner + = new ApplicationGatewayBackendHealthInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backendAddressPools".equals(fieldName)) { + List backendAddressPools + = reader.readArray(reader1 -> ApplicationGatewayBackendHealthPool.fromJson(reader1)); + deserializedApplicationGatewayBackendHealthInner.backendAddressPools = backendAddressPools; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendHealthInner; + }); + } +} 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..60cc712088a20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthOnDemandInner.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthHttpSettings; +import java.io.IOException; + +/** + * Result of on demand test probe. + */ +@Fluent +public final class ApplicationGatewayBackendHealthOnDemandInner + implements JsonSerializable { + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * Application gateway BackendHealthHttp settings. + */ + private ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings; + + /** + * Creates an instance of ApplicationGatewayBackendHealthOnDemandInner class. + */ + public ApplicationGatewayBackendHealthOnDemandInner() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeJsonField("backendHealthHttpSettings", this.backendHealthHttpSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendHealthOnDemandInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendHealthOnDemandInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendHealthOnDemandInner. + */ + public static ApplicationGatewayBackendHealthOnDemandInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendHealthOnDemandInner deserializedApplicationGatewayBackendHealthOnDemandInner + = new ApplicationGatewayBackendHealthOnDemandInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthOnDemandInner.backendAddressPool + = ApplicationGatewayBackendAddressPool.fromJson(reader); + } else if ("backendHealthHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthOnDemandInner.backendHealthHttpSettings + = ApplicationGatewayBackendHealthHttpSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendHealthOnDemandInner; + }); + } +} 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..742d9d939395c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHealthServerInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHealthServerHealth; +import java.io.IOException; + +/** + * Application gateway backendhealth http settings. + */ +@Fluent +public final class ApplicationGatewayBackendHealthServerInner + implements JsonSerializable { + /* + * IP address or FQDN of backend server. + */ + private String address; + + /* + * Reference to IP configuration of backend server. + */ + private NetworkInterfaceIpConfigurationInner ipConfiguration; + + /* + * Health of backend server. + */ + private ApplicationGatewayBackendHealthServerHealth health; + + /* + * Health Probe Log. + */ + private String healthProbeLog; + + /** + * Creates an instance of ApplicationGatewayBackendHealthServerInner class. + */ + public ApplicationGatewayBackendHealthServerInner() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeJsonField("ipConfiguration", this.ipConfiguration); + jsonWriter.writeStringField("health", this.health == null ? null : this.health.toString()); + jsonWriter.writeStringField("healthProbeLog", this.healthProbeLog); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendHealthServerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendHealthServerInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendHealthServerInner. + */ + public static ApplicationGatewayBackendHealthServerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendHealthServerInner deserializedApplicationGatewayBackendHealthServerInner + = new ApplicationGatewayBackendHealthServerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthServerInner.address = reader.getString(); + } else if ("ipConfiguration".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthServerInner.ipConfiguration + = NetworkInterfaceIpConfigurationInner.fromJson(reader); + } else if ("health".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthServerInner.health + = ApplicationGatewayBackendHealthServerHealth.fromString(reader.getString()); + } else if ("healthProbeLog".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthServerInner.healthProbeLog = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendHealthServerInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.java new file mode 100644 index 0000000000000..eee3fe22ad187 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendHttpSettingsPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayConnectionDraining; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCookieBasedAffinity; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Backend address pool settings of an application gateway. + */ +@Fluent +public final class ApplicationGatewayBackendHttpSettingsPropertiesFormat + implements JsonSerializable { + /* + * The destination port on the backend. + */ + private Integer port; + + /* + * The protocol used to communicate with the backend. + */ + private ApplicationGatewayProtocol protocol; + + /* + * Cookie based affinity. + */ + 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. + */ + private Integer requestTimeout; + + /* + * Probe resource of an application gateway. + */ + private SubResource probe; + + /* + * Array of references to application gateway authentication certificates. + */ + private List authenticationCertificates; + + /* + * Array of references to application gateway trusted root certificates. + */ + private List trustedRootCertificates; + + /* + * Connection draining of the backend http settings resource. + */ + private ApplicationGatewayConnectionDraining connectionDraining; + + /* + * Host header to be sent to the backend servers. + */ + private String hostname; + + /* + * Whether to pick host header should be picked from the host name of the backend server. Default value is false. + */ + private Boolean pickHostnameFromBackendAddress; + + /* + * Cookie name to use for the affinity cookie. + */ + private String affinityCookieName; + + /* + * Whether the probe is enabled. Default value is false. + */ + 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. + */ + private String path; + + /* + * The provisioning state of the backend HTTP settings resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayBackendHttpSettingsPropertiesFormat class. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat + 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat + 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat + 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat + 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat + 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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 ApplicationGatewayBackendHttpSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendHttpSettingsPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectionDraining() != null) { + connectionDraining().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("cookieBasedAffinity", + this.cookieBasedAffinity == null ? null : this.cookieBasedAffinity.toString()); + jsonWriter.writeNumberField("requestTimeout", this.requestTimeout); + jsonWriter.writeJsonField("probe", this.probe); + jsonWriter.writeArrayField("authenticationCertificates", this.authenticationCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trustedRootCertificates", this.trustedRootCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("connectionDraining", this.connectionDraining); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeBooleanField("pickHostNameFromBackendAddress", this.pickHostnameFromBackendAddress); + jsonWriter.writeStringField("affinityCookieName", this.affinityCookieName); + jsonWriter.writeBooleanField("probeEnabled", this.probeEnabled); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendHttpSettingsPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendHttpSettingsPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendHttpSettingsPropertiesFormat. + */ + public static ApplicationGatewayBackendHttpSettingsPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendHttpSettingsPropertiesFormat deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat + = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.port + = reader.getNullable(JsonReader::getInt); + } else if ("protocol".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.protocol + = ApplicationGatewayProtocol.fromString(reader.getString()); + } else if ("cookieBasedAffinity".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.cookieBasedAffinity + = ApplicationGatewayCookieBasedAffinity.fromString(reader.getString()); + } else if ("requestTimeout".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.requestTimeout + = reader.getNullable(JsonReader::getInt); + } else if ("probe".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.probe + = SubResource.fromJson(reader); + } else if ("authenticationCertificates".equals(fieldName)) { + List authenticationCertificates + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.authenticationCertificates + = authenticationCertificates; + } else if ("trustedRootCertificates".equals(fieldName)) { + List trustedRootCertificates + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.trustedRootCertificates + = trustedRootCertificates; + } else if ("connectionDraining".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.connectionDraining + = ApplicationGatewayConnectionDraining.fromJson(reader); + } else if ("hostName".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.hostname = reader.getString(); + } else if ("pickHostNameFromBackendAddress".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.pickHostnameFromBackendAddress + = reader.getNullable(JsonReader::getBoolean); + } else if ("affinityCookieName".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.affinityCookieName + = reader.getString(); + } else if ("probeEnabled".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.probeEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("path".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.path = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendHttpSettingsPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendSettingsPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendSettingsPropertiesFormat.java new file mode 100644 index 0000000000000..fed9a83f5c9bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayBackendSettingsPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Backend address pool settings of an application gateway. + */ +@Fluent +public final class ApplicationGatewayBackendSettingsPropertiesFormat + implements JsonSerializable { + /* + * The destination port on the backend. + */ + private Integer port; + + /* + * The protocol used to communicate with the backend. + */ + private ApplicationGatewayProtocol protocol; + + /* + * Connection timeout in seconds. Application Gateway will fail the request if response is not received within + * ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. + */ + private Integer timeout; + + /* + * Probe resource of an application gateway. + */ + private SubResource probe; + + /* + * Array of references to application gateway trusted root certificates. + */ + private List trustedRootCertificates; + + /* + * Server name indication to be sent to the backend servers for Tls protocol. + */ + private String hostname; + + /* + * Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value + * is false. + */ + private Boolean pickHostnameFromBackendAddress; + + /* + * The provisioning state of the backend HTTP settings resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayBackendSettingsPropertiesFormat class. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayBackendSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat 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 ApplicationGatewayBackendSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the timeout property: Connection timeout in seconds. Application Gateway will fail the request if response is + * not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout property: Connection timeout in seconds. Application Gateway will fail the request if response is + * not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set. + * @return the ApplicationGatewayBackendSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat withTimeout(Integer timeout) { + this.timeout = timeout; + 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 ApplicationGatewayBackendSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat withProbe(SubResource probe) { + this.probe = probe; + 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 ApplicationGatewayBackendSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat + withTrustedRootCertificates(List trustedRootCertificates) { + this.trustedRootCertificates = trustedRootCertificates; + return this; + } + + /** + * Get the hostname property: Server name indication to be sent to the backend servers for Tls protocol. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: Server name indication to be sent to the backend servers for Tls protocol. + * + * @param hostname the hostname value to set. + * @return the ApplicationGatewayBackendSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the pickHostnameFromBackendAddress property: Whether to pick server name indication from the host name of the + * backend server for Tls protocol. Default value is false. + * + * @return the pickHostnameFromBackendAddress value. + */ + public Boolean pickHostnameFromBackendAddress() { + return this.pickHostnameFromBackendAddress; + } + + /** + * Set the pickHostnameFromBackendAddress property: Whether to pick server name indication from the host name of the + * backend server for Tls protocol. Default value is false. + * + * @param pickHostnameFromBackendAddress the pickHostnameFromBackendAddress value to set. + * @return the ApplicationGatewayBackendSettingsPropertiesFormat object itself. + */ + public ApplicationGatewayBackendSettingsPropertiesFormat + withPickHostnameFromBackendAddress(Boolean pickHostnameFromBackendAddress) { + this.pickHostnameFromBackendAddress = pickHostnameFromBackendAddress; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeNumberField("timeout", this.timeout); + jsonWriter.writeJsonField("probe", this.probe); + jsonWriter.writeArrayField("trustedRootCertificates", this.trustedRootCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeBooleanField("pickHostNameFromBackendAddress", this.pickHostnameFromBackendAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendSettingsPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendSettingsPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendSettingsPropertiesFormat. + */ + public static ApplicationGatewayBackendSettingsPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendSettingsPropertiesFormat deserializedApplicationGatewayBackendSettingsPropertiesFormat + = new ApplicationGatewayBackendSettingsPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedApplicationGatewayBackendSettingsPropertiesFormat.port + = reader.getNullable(JsonReader::getInt); + } else if ("protocol".equals(fieldName)) { + deserializedApplicationGatewayBackendSettingsPropertiesFormat.protocol + = ApplicationGatewayProtocol.fromString(reader.getString()); + } else if ("timeout".equals(fieldName)) { + deserializedApplicationGatewayBackendSettingsPropertiesFormat.timeout + = reader.getNullable(JsonReader::getInt); + } else if ("probe".equals(fieldName)) { + deserializedApplicationGatewayBackendSettingsPropertiesFormat.probe = SubResource.fromJson(reader); + } else if ("trustedRootCertificates".equals(fieldName)) { + List trustedRootCertificates + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewayBackendSettingsPropertiesFormat.trustedRootCertificates + = trustedRootCertificates; + } else if ("hostName".equals(fieldName)) { + deserializedApplicationGatewayBackendSettingsPropertiesFormat.hostname = reader.getString(); + } else if ("pickHostNameFromBackendAddress".equals(fieldName)) { + deserializedApplicationGatewayBackendSettingsPropertiesFormat.pickHostnameFromBackendAddress + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayBackendSettingsPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendSettingsPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.java new file mode 100644 index 0000000000000..cd0d0c0421b0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFirewallRuleSetPropertiesFormat.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRuleGroup; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTierTypes; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the web application firewall rule set. + */ +@Fluent +public final class ApplicationGatewayFirewallRuleSetPropertiesFormat + implements JsonSerializable { + /* + * The provisioning state of the web application firewall rule set. + */ + private ProvisioningState provisioningState; + + /* + * The type of the web application firewall rule set. + */ + private String ruleSetType; + + /* + * The version of the web application firewall rule set type. + */ + private String ruleSetVersion; + + /* + * The rule groups of the web application firewall rule set. + */ + private List ruleGroups; + + /* + * Tier of an application gateway that support the rule set. + */ + private List tiers; + + /** + * Creates an instance of ApplicationGatewayFirewallRuleSetPropertiesFormat class. + */ + public ApplicationGatewayFirewallRuleSetPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. + */ + public ApplicationGatewayFirewallRuleSetPropertiesFormat 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 ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. + */ + public ApplicationGatewayFirewallRuleSetPropertiesFormat 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 ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. + */ + public ApplicationGatewayFirewallRuleSetPropertiesFormat + withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Get the tiers property: Tier of an application gateway that support the rule set. + * + * @return the tiers value. + */ + public List tiers() { + return this.tiers; + } + + /** + * Set the tiers property: Tier of an application gateway that support the rule set. + * + * @param tiers the tiers value to set. + * @return the ApplicationGatewayFirewallRuleSetPropertiesFormat object itself. + */ + public ApplicationGatewayFirewallRuleSetPropertiesFormat withTiers(List tiers) { + this.tiers = tiers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleSetType in model ApplicationGatewayFirewallRuleSetPropertiesFormat")); + } + if (ruleSetVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleSetVersion in model ApplicationGatewayFirewallRuleSetPropertiesFormat")); + } + if (ruleGroups() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleGroups in model ApplicationGatewayFirewallRuleSetPropertiesFormat")); + } else { + ruleGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(ApplicationGatewayFirewallRuleSetPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleSetType", this.ruleSetType); + jsonWriter.writeStringField("ruleSetVersion", this.ruleSetVersion); + jsonWriter.writeArrayField("ruleGroups", this.ruleGroups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tiers", this.tiers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFirewallRuleSetPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFirewallRuleSetPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayFirewallRuleSetPropertiesFormat. + */ + public static ApplicationGatewayFirewallRuleSetPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFirewallRuleSetPropertiesFormat deserializedApplicationGatewayFirewallRuleSetPropertiesFormat + = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetType".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSetPropertiesFormat.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSetPropertiesFormat.ruleSetVersion = reader.getString(); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ApplicationGatewayFirewallRuleGroup.fromJson(reader1)); + deserializedApplicationGatewayFirewallRuleSetPropertiesFormat.ruleGroups = ruleGroups; + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSetPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("tiers".equals(fieldName)) { + List tiers + = reader.readArray(reader1 -> ApplicationGatewayTierTypes.fromString(reader1.getString())); + deserializedApplicationGatewayFirewallRuleSetPropertiesFormat.tiers = tiers; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFirewallRuleSetPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..81c83f8b670ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendIpConfigurationPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of Frontend IP configuration of an application gateway. + */ +@Fluent +public final class ApplicationGatewayFrontendIpConfigurationPropertiesFormat + implements JsonSerializable { + /* + * PrivateIPAddress of the network interface IP Configuration. + */ + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Reference to the subnet resource. + */ + private SubResource subnet; + + /* + * Reference to the PublicIP resource. + */ + private SubResource publicIpAddress; + + /* + * Reference to the application gateway private link configuration. + */ + private SubResource privateLinkConfiguration; + + /* + * The provisioning state of the frontend IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayFrontendIpConfigurationPropertiesFormat class. + */ + public ApplicationGatewayFrontendIpConfigurationPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayFrontendIpConfigurationPropertiesFormat 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 ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayFrontendIpConfigurationPropertiesFormat + 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 ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayFrontendIpConfigurationPropertiesFormat 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 ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayFrontendIpConfigurationPropertiesFormat 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 ApplicationGatewayFrontendIpConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayFrontendIpConfigurationPropertiesFormat + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + jsonWriter.writeJsonField("privateLinkConfiguration", this.privateLinkConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFrontendIpConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFrontendIpConfigurationPropertiesFormat if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ApplicationGatewayFrontendIpConfigurationPropertiesFormat. + */ + public static ApplicationGatewayFrontendIpConfigurationPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFrontendIpConfigurationPropertiesFormat deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat + = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAddress".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat.privateIpAddress + = reader.getString(); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat.subnet + = SubResource.fromJson(reader); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat.publicIpAddress + = SubResource.fromJson(reader); + } else if ("privateLinkConfiguration".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat.privateLinkConfiguration + = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFrontendIpConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.java new file mode 100644 index 0000000000000..f63410b3a93bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayFrontendPortPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of Frontend port of an application gateway. + */ +@Fluent +public final class ApplicationGatewayFrontendPortPropertiesFormat + implements JsonSerializable { + /* + * Frontend port. + */ + private Integer port; + + /* + * The provisioning state of the frontend port resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayFrontendPortPropertiesFormat class. + */ + public ApplicationGatewayFrontendPortPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayFrontendPortPropertiesFormat object itself. + */ + public ApplicationGatewayFrontendPortPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFrontendPortPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFrontendPortPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayFrontendPortPropertiesFormat. + */ + public static ApplicationGatewayFrontendPortPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFrontendPortPropertiesFormat deserializedApplicationGatewayFrontendPortPropertiesFormat + = new ApplicationGatewayFrontendPortPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedApplicationGatewayFrontendPortPropertiesFormat.port + = reader.getNullable(JsonReader::getInt); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayFrontendPortPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFrontendPortPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.java new file mode 100644 index 0000000000000..19d294001117e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayHttpListenerPropertiesFormat.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCustomError; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of HTTP listener of an application gateway. + */ +@Fluent +public final class ApplicationGatewayHttpListenerPropertiesFormat + implements JsonSerializable { + /* + * Frontend IP configuration resource of an application gateway. + */ + private SubResource frontendIpConfiguration; + + /* + * Frontend port resource of an application gateway. + */ + private SubResource frontendPort; + + /* + * Protocol of the HTTP listener. + */ + private ApplicationGatewayProtocol protocol; + + /* + * Host name of HTTP listener. + */ + private String hostname; + + /* + * SSL certificate resource of an application gateway. + */ + private SubResource sslCertificate; + + /* + * SSL profile resource of the application gateway. + */ + private SubResource sslProfile; + + /* + * Applicable only if protocol is https. Enables SNI for multi-hosting. + */ + private Boolean requireServerNameIndication; + + /* + * The provisioning state of the HTTP listener resource. + */ + private ProvisioningState provisioningState; + + /* + * Custom error configurations of the HTTP listener. + */ + private List customErrorConfigurations; + + /* + * Reference to the FirewallPolicy resource. + */ + private SubResource firewallPolicy; + + /* + * List of Host names for HTTP Listener that allows special wildcard characters as well. + */ + private List hostNames; + + /** + * Creates an instance of ApplicationGatewayHttpListenerPropertiesFormat class. + */ + public ApplicationGatewayHttpListenerPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat + 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat + 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat + 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat 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 ApplicationGatewayHttpListenerPropertiesFormat object itself. + */ + public ApplicationGatewayHttpListenerPropertiesFormat withHostNames(List hostNames) { + this.hostNames = hostNames; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("frontendIPConfiguration", this.frontendIpConfiguration); + jsonWriter.writeJsonField("frontendPort", this.frontendPort); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeJsonField("sslCertificate", this.sslCertificate); + jsonWriter.writeJsonField("sslProfile", this.sslProfile); + jsonWriter.writeBooleanField("requireServerNameIndication", this.requireServerNameIndication); + jsonWriter.writeArrayField("customErrorConfigurations", this.customErrorConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("firewallPolicy", this.firewallPolicy); + jsonWriter.writeArrayField("hostNames", this.hostNames, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayHttpListenerPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayHttpListenerPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayHttpListenerPropertiesFormat. + */ + public static ApplicationGatewayHttpListenerPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayHttpListenerPropertiesFormat deserializedApplicationGatewayHttpListenerPropertiesFormat + = new ApplicationGatewayHttpListenerPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frontendIPConfiguration".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.frontendIpConfiguration + = SubResource.fromJson(reader); + } else if ("frontendPort".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.frontendPort + = SubResource.fromJson(reader); + } else if ("protocol".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.protocol + = ApplicationGatewayProtocol.fromString(reader.getString()); + } else if ("hostName".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.hostname = reader.getString(); + } else if ("sslCertificate".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.sslCertificate + = SubResource.fromJson(reader); + } else if ("sslProfile".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.sslProfile + = SubResource.fromJson(reader); + } else if ("requireServerNameIndication".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.requireServerNameIndication + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("customErrorConfigurations".equals(fieldName)) { + List customErrorConfigurations + = reader.readArray(reader1 -> ApplicationGatewayCustomError.fromJson(reader1)); + deserializedApplicationGatewayHttpListenerPropertiesFormat.customErrorConfigurations + = customErrorConfigurations; + } else if ("firewallPolicy".equals(fieldName)) { + deserializedApplicationGatewayHttpListenerPropertiesFormat.firewallPolicy + = SubResource.fromJson(reader); + } else if ("hostNames".equals(fieldName)) { + List hostNames = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationGatewayHttpListenerPropertiesFormat.hostNames = hostNames; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayHttpListenerPropertiesFormat; + }); + } +} 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..b4a900721cf06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayInner.java @@ -0,0 +1,1118 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.ApplicationGatewayBackendSettings; +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.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionPolicy; +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.ApplicationGatewayRoutingRule; +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.ApplicationGatewaySslPolicyName; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Application gateway resource. + */ +@Fluent +public final class ApplicationGatewayInner extends Resource { + /* + * Properties of the application gateway. + */ + private ApplicationGatewayPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * A list of availability zones denoting where the resource needs to come from. + */ + private List zones; + + /* + * The identity of the application gateway, if configured. + */ + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ApplicationGatewayInner class. + */ + public ApplicationGatewayInner() { + } + + /** + * Get the innerProperties property: Properties of the application gateway. + * + * @return the innerProperties value. + */ + private ApplicationGatewayPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the sku property: SKU of the application gateway resource. + * + * @return the sku value. + */ + public ApplicationGatewaySku sku() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the sslPolicy property: SSL policy of the application gateway resource. + * + * @return the sslPolicy value. + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withSslPolicy(sslPolicy); + return this; + } + + /** + * Get the operationalState property: Operational state of the application gateway resource. + * + * @return the operationalState value. + */ + public ApplicationGatewayOperationalState operationalState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withGatewayIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withAuthenticationCertificates(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withTrustedRootCertificates(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withTrustedClientCertificates(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withSslCertificates(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withFrontendIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withFrontendPorts(frontendPorts); + return this; + } + + /** + * Get the probes property: Probes of the application gateway resource. + * + * @return the probes value. + */ + public List probes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withProbes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withBackendAddressPools(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withBackendHttpSettingsCollection(backendHttpSettingsCollection); + return this; + } + + /** + * Get the backendSettingsCollection property: Backend 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 backendSettingsCollection value. + */ + public List backendSettingsCollection() { + return this.innerProperties() == null ? null : this.innerProperties().backendSettingsCollection(); + } + + /** + * Set the backendSettingsCollection property: Backend 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 backendSettingsCollection the backendSettingsCollection value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner + withBackendSettingsCollection(List backendSettingsCollection) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withBackendSettingsCollection(backendSettingsCollection); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withHttpListeners(httpListeners); + return this; + } + + /** + * Get the listeners property: 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 listeners value. + */ + public List listeners() { + return this.innerProperties() == null ? null : this.innerProperties().listeners(); + } + + /** + * Set the listeners property: 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 listeners the listeners value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withListeners(List listeners) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withListeners(listeners); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withSslProfiles(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withUrlPathMaps(urlPathMaps); + return this; + } + + /** + * Get the requestRoutingRules property: Request routing rules of the application gateway resource. + * + * @return the requestRoutingRules value. + */ + public List requestRoutingRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withRequestRoutingRules(requestRoutingRules); + return this; + } + + /** + * Get the routingRules property: Routing rules of the application gateway resource. + * + * @return the routingRules value. + */ + public List routingRules() { + return this.innerProperties() == null ? null : this.innerProperties().routingRules(); + } + + /** + * Set the routingRules property: Routing rules of the application gateway resource. + * + * @param routingRules the routingRules value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withRoutingRules(List routingRules) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withRoutingRules(routingRules); + return this; + } + + /** + * Get the rewriteRuleSets property: Rewrite rules for the application gateway resource. + * + * @return the rewriteRuleSets value. + */ + public List rewriteRuleSets() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withRewriteRuleSets(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withRedirectConfigurations(redirectConfigurations); + return this; + } + + /** + * Get the webApplicationFirewallConfiguration property: Web application firewall configuration. + * + * @return the webApplicationFirewallConfiguration value. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withWebApplicationFirewallConfiguration(webApplicationFirewallConfiguration); + return this; + } + + /** + * Get the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withFirewallPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withEnableHttp2(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withEnableFips(enableFips); + return this; + } + + /** + * Get the autoscaleConfiguration property: Autoscale Configuration. + * + * @return the autoscaleConfiguration value. + */ + public ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().autoscaleConfiguration(); + } + + /** + * Set the autoscaleConfiguration property: Autoscale Configuration. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner + withAutoscaleConfiguration(ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + /** + * Get the privateLinkConfigurations property: PrivateLink configurations on application gateway. + * + * @return the privateLinkConfigurations value. + */ + public List privateLinkConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withPrivateLinkConfigurations(privateLinkConfigurations); + return this; + } + + /** + * Get the privateEndpointConnections property: Private Endpoint connections on application gateway. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the application gateway resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the application gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the customErrorConfigurations property: Custom error configurations of the application gateway resource. + * + * @return the customErrorConfigurations value. + */ + public List customErrorConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withCustomErrorConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withForceFirewallPolicyAssociation(forceFirewallPolicyAssociation); + return this; + } + + /** + * Get the loadDistributionPolicies property: Load distribution policies of the application gateway resource. + * + * @return the loadDistributionPolicies value. + */ + public List loadDistributionPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().loadDistributionPolicies(); + } + + /** + * Set the loadDistributionPolicies property: Load distribution policies of the application gateway resource. + * + * @param loadDistributionPolicies the loadDistributionPolicies value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner + withLoadDistributionPolicies(List loadDistributionPolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withLoadDistributionPolicies(loadDistributionPolicies); + return this; + } + + /** + * Get the globalConfiguration property: Global Configuration. + * + * @return the globalConfiguration value. + */ + public ApplicationGatewayGlobalConfiguration globalConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().globalConfiguration(); + } + + /** + * Set the globalConfiguration property: Global Configuration. + * + * @param globalConfiguration the globalConfiguration value to set. + * @return the ApplicationGatewayInner object itself. + */ + public ApplicationGatewayInner withGlobalConfiguration(ApplicationGatewayGlobalConfiguration globalConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPropertiesFormat(); + } + this.innerProperties().withGlobalConfiguration(globalConfiguration); + return this; + } + + /** + * Get the defaultPredefinedSslPolicy property: The default predefined SSL Policy applied on the application gateway + * resource. + * + * @return the defaultPredefinedSslPolicy value. + */ + public ApplicationGatewaySslPolicyName defaultPredefinedSslPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().defaultPredefinedSslPolicy(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayInner. + */ + public static ApplicationGatewayInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayInner deserializedApplicationGatewayInner = new ApplicationGatewayInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApplicationGatewayInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedApplicationGatewayInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicationGatewayInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayInner.innerProperties + = ApplicationGatewayPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayInner.etag = reader.getString(); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationGatewayInner.zones = zones; + } else if ("identity".equals(fieldName)) { + deserializedApplicationGatewayInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedApplicationGatewayInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..710e93a16bbe1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayIpConfigurationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of IP configuration of an application gateway. + */ +@Fluent +public final class ApplicationGatewayIpConfigurationPropertiesFormat + implements JsonSerializable { + /* + * Reference to the subnet resource. A subnet from where application gateway gets its private address. + */ + private SubResource subnet; + + /* + * The provisioning state of the application gateway IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayIpConfigurationPropertiesFormat class. + */ + public ApplicationGatewayIpConfigurationPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayIpConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayIpConfigurationPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subnet", this.subnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayIpConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayIpConfigurationPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayIpConfigurationPropertiesFormat. + */ + public static ApplicationGatewayIpConfigurationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayIpConfigurationPropertiesFormat deserializedApplicationGatewayIpConfigurationPropertiesFormat + = new ApplicationGatewayIpConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnet".equals(fieldName)) { + deserializedApplicationGatewayIpConfigurationPropertiesFormat.subnet = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayIpConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayIpConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayListenerPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayListenerPropertiesFormat.java new file mode 100644 index 0000000000000..64fbf8b4eafd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayListenerPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of listener of an application gateway. + */ +@Fluent +public final class ApplicationGatewayListenerPropertiesFormat + implements JsonSerializable { + /* + * Frontend IP configuration resource of an application gateway. + */ + private SubResource frontendIpConfiguration; + + /* + * Frontend port resource of an application gateway. + */ + private SubResource frontendPort; + + /* + * Protocol of the listener. + */ + private ApplicationGatewayProtocol protocol; + + /* + * SSL certificate resource of an application gateway. + */ + private SubResource sslCertificate; + + /* + * SSL profile resource of the application gateway. + */ + private SubResource sslProfile; + + /* + * The provisioning state of the listener resource. + */ + private ProvisioningState provisioningState; + + /* + * List of Server Name Indications(SNI) for TLS Multi-site Listener that allows special wildcard characters as well. + */ + private List hostNames; + + /** + * Creates an instance of ApplicationGatewayListenerPropertiesFormat class. + */ + public ApplicationGatewayListenerPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayListenerPropertiesFormat object itself. + */ + public ApplicationGatewayListenerPropertiesFormat 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 ApplicationGatewayListenerPropertiesFormat object itself. + */ + public ApplicationGatewayListenerPropertiesFormat withFrontendPort(SubResource frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the protocol property: Protocol of the listener. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol of the listener. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayListenerPropertiesFormat object itself. + */ + public ApplicationGatewayListenerPropertiesFormat withProtocol(ApplicationGatewayProtocol protocol) { + this.protocol = protocol; + 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 ApplicationGatewayListenerPropertiesFormat object itself. + */ + public ApplicationGatewayListenerPropertiesFormat 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 ApplicationGatewayListenerPropertiesFormat object itself. + */ + public ApplicationGatewayListenerPropertiesFormat withSslProfile(SubResource sslProfile) { + this.sslProfile = sslProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the listener resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the hostNames property: List of Server Name Indications(SNI) for TLS Multi-site Listener that allows special + * wildcard characters as well. + * + * @return the hostNames value. + */ + public List hostNames() { + return this.hostNames; + } + + /** + * Set the hostNames property: List of Server Name Indications(SNI) for TLS Multi-site Listener that allows special + * wildcard characters as well. + * + * @param hostNames the hostNames value to set. + * @return the ApplicationGatewayListenerPropertiesFormat object itself. + */ + public ApplicationGatewayListenerPropertiesFormat withHostNames(List hostNames) { + this.hostNames = hostNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("frontendIPConfiguration", this.frontendIpConfiguration); + jsonWriter.writeJsonField("frontendPort", this.frontendPort); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeJsonField("sslCertificate", this.sslCertificate); + jsonWriter.writeJsonField("sslProfile", this.sslProfile); + jsonWriter.writeArrayField("hostNames", this.hostNames, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayListenerPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayListenerPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayListenerPropertiesFormat. + */ + public static ApplicationGatewayListenerPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayListenerPropertiesFormat deserializedApplicationGatewayListenerPropertiesFormat + = new ApplicationGatewayListenerPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frontendIPConfiguration".equals(fieldName)) { + deserializedApplicationGatewayListenerPropertiesFormat.frontendIpConfiguration + = SubResource.fromJson(reader); + } else if ("frontendPort".equals(fieldName)) { + deserializedApplicationGatewayListenerPropertiesFormat.frontendPort = SubResource.fromJson(reader); + } else if ("protocol".equals(fieldName)) { + deserializedApplicationGatewayListenerPropertiesFormat.protocol + = ApplicationGatewayProtocol.fromString(reader.getString()); + } else if ("sslCertificate".equals(fieldName)) { + deserializedApplicationGatewayListenerPropertiesFormat.sslCertificate + = SubResource.fromJson(reader); + } else if ("sslProfile".equals(fieldName)) { + deserializedApplicationGatewayListenerPropertiesFormat.sslProfile = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayListenerPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("hostNames".equals(fieldName)) { + List hostNames = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationGatewayListenerPropertiesFormat.hostNames = hostNames; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayListenerPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.java new file mode 100644 index 0000000000000..d575607edfa25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionPolicyPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionAlgorithm; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionTarget; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Load Distribution Policy of an application gateway. + */ +@Fluent +public final class ApplicationGatewayLoadDistributionPolicyPropertiesFormat + implements JsonSerializable { + /* + * Load Distribution Targets resource of an application gateway. + */ + private List loadDistributionTargets; + + /* + * Load Distribution Targets resource of an application gateway. + */ + private ApplicationGatewayLoadDistributionAlgorithm loadDistributionAlgorithm; + + /* + * The provisioning state of the Load Distribution Policy resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayLoadDistributionPolicyPropertiesFormat class. + */ + public ApplicationGatewayLoadDistributionPolicyPropertiesFormat() { + } + + /** + * Get the loadDistributionTargets property: Load Distribution Targets resource of an application gateway. + * + * @return the loadDistributionTargets value. + */ + public List loadDistributionTargets() { + return this.loadDistributionTargets; + } + + /** + * Set the loadDistributionTargets property: Load Distribution Targets resource of an application gateway. + * + * @param loadDistributionTargets the loadDistributionTargets value to set. + * @return the ApplicationGatewayLoadDistributionPolicyPropertiesFormat object itself. + */ + public ApplicationGatewayLoadDistributionPolicyPropertiesFormat + withLoadDistributionTargets(List loadDistributionTargets) { + this.loadDistributionTargets = loadDistributionTargets; + return this; + } + + /** + * Get the loadDistributionAlgorithm property: Load Distribution Targets resource of an application gateway. + * + * @return the loadDistributionAlgorithm value. + */ + public ApplicationGatewayLoadDistributionAlgorithm loadDistributionAlgorithm() { + return this.loadDistributionAlgorithm; + } + + /** + * Set the loadDistributionAlgorithm property: Load Distribution Targets resource of an application gateway. + * + * @param loadDistributionAlgorithm the loadDistributionAlgorithm value to set. + * @return the ApplicationGatewayLoadDistributionPolicyPropertiesFormat object itself. + */ + public ApplicationGatewayLoadDistributionPolicyPropertiesFormat + withLoadDistributionAlgorithm(ApplicationGatewayLoadDistributionAlgorithm loadDistributionAlgorithm) { + this.loadDistributionAlgorithm = loadDistributionAlgorithm; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Load Distribution Policy 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() { + if (loadDistributionTargets() != null) { + loadDistributionTargets().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("loadDistributionTargets", this.loadDistributionTargets, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("loadDistributionAlgorithm", + this.loadDistributionAlgorithm == null ? null : this.loadDistributionAlgorithm.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayLoadDistributionPolicyPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayLoadDistributionPolicyPropertiesFormat if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ApplicationGatewayLoadDistributionPolicyPropertiesFormat. + */ + public static ApplicationGatewayLoadDistributionPolicyPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayLoadDistributionPolicyPropertiesFormat deserializedApplicationGatewayLoadDistributionPolicyPropertiesFormat + = new ApplicationGatewayLoadDistributionPolicyPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("loadDistributionTargets".equals(fieldName)) { + List loadDistributionTargets + = reader.readArray(reader1 -> ApplicationGatewayLoadDistributionTarget.fromJson(reader1)); + deserializedApplicationGatewayLoadDistributionPolicyPropertiesFormat.loadDistributionTargets + = loadDistributionTargets; + } else if ("loadDistributionAlgorithm".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionPolicyPropertiesFormat.loadDistributionAlgorithm + = ApplicationGatewayLoadDistributionAlgorithm.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionPolicyPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayLoadDistributionPolicyPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.java new file mode 100644 index 0000000000000..d50b48a104984 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayLoadDistributionTargetPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ApplicationGatewayLoadDistributionTargetPropertiesFormat model. + */ +@Fluent +public final class ApplicationGatewayLoadDistributionTargetPropertiesFormat + implements JsonSerializable { + /* + * Weight per server. Range between 1 and 100. + */ + private Integer weightPerServer; + + /* + * Backend address pool resource of the application gateway. + */ + private SubResource backendAddressPool; + + /** + * Creates an instance of ApplicationGatewayLoadDistributionTargetPropertiesFormat class. + */ + public ApplicationGatewayLoadDistributionTargetPropertiesFormat() { + } + + /** + * Get the weightPerServer property: Weight per server. Range between 1 and 100. + * + * @return the weightPerServer value. + */ + public Integer weightPerServer() { + return this.weightPerServer; + } + + /** + * Set the weightPerServer property: Weight per server. Range between 1 and 100. + * + * @param weightPerServer the weightPerServer value to set. + * @return the ApplicationGatewayLoadDistributionTargetPropertiesFormat object itself. + */ + public ApplicationGatewayLoadDistributionTargetPropertiesFormat withWeightPerServer(Integer weightPerServer) { + this.weightPerServer = weightPerServer; + 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 ApplicationGatewayLoadDistributionTargetPropertiesFormat object itself. + */ + public ApplicationGatewayLoadDistributionTargetPropertiesFormat + withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("weightPerServer", this.weightPerServer); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayLoadDistributionTargetPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayLoadDistributionTargetPropertiesFormat if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ApplicationGatewayLoadDistributionTargetPropertiesFormat. + */ + public static ApplicationGatewayLoadDistributionTargetPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayLoadDistributionTargetPropertiesFormat deserializedApplicationGatewayLoadDistributionTargetPropertiesFormat + = new ApplicationGatewayLoadDistributionTargetPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("weightPerServer".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionTargetPropertiesFormat.weightPerServer + = reader.getNullable(JsonReader::getInt); + } else if ("backendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionTargetPropertiesFormat.backendAddressPool + = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayLoadDistributionTargetPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPathRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPathRulePropertiesFormat.java new file mode 100644 index 0000000000000..9ff6128c8c530 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPathRulePropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of path rule of an application gateway. + */ +@Fluent +public final class ApplicationGatewayPathRulePropertiesFormat + implements JsonSerializable { + /* + * Path rules of URL path map. + */ + private List paths; + + /* + * Backend address pool resource of URL path map path rule. + */ + private SubResource backendAddressPool; + + /* + * Backend http settings resource of URL path map path rule. + */ + private SubResource backendHttpSettings; + + /* + * Redirect configuration resource of URL path map path rule. + */ + private SubResource redirectConfiguration; + + /* + * Rewrite rule set resource of URL path map path rule. + */ + private SubResource rewriteRuleSet; + + /* + * Load Distribution Policy resource of URL path map path rule. + */ + private SubResource loadDistributionPolicy; + + /* + * The provisioning state of the path rule resource. + */ + private ProvisioningState provisioningState; + + /* + * Reference to the FirewallPolicy resource. + */ + private SubResource firewallPolicy; + + /** + * Creates an instance of ApplicationGatewayPathRulePropertiesFormat class. + */ + public ApplicationGatewayPathRulePropertiesFormat() { + } + + /** + * 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 ApplicationGatewayPathRulePropertiesFormat object itself. + */ + public ApplicationGatewayPathRulePropertiesFormat 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 ApplicationGatewayPathRulePropertiesFormat object itself. + */ + public ApplicationGatewayPathRulePropertiesFormat 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 ApplicationGatewayPathRulePropertiesFormat object itself. + */ + public ApplicationGatewayPathRulePropertiesFormat 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 ApplicationGatewayPathRulePropertiesFormat object itself. + */ + public ApplicationGatewayPathRulePropertiesFormat 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 ApplicationGatewayPathRulePropertiesFormat object itself. + */ + public ApplicationGatewayPathRulePropertiesFormat withRewriteRuleSet(SubResource rewriteRuleSet) { + this.rewriteRuleSet = rewriteRuleSet; + return this; + } + + /** + * Get the loadDistributionPolicy property: Load Distribution Policy resource of URL path map path rule. + * + * @return the loadDistributionPolicy value. + */ + public SubResource loadDistributionPolicy() { + return this.loadDistributionPolicy; + } + + /** + * Set the loadDistributionPolicy property: Load Distribution Policy resource of URL path map path rule. + * + * @param loadDistributionPolicy the loadDistributionPolicy value to set. + * @return the ApplicationGatewayPathRulePropertiesFormat object itself. + */ + public ApplicationGatewayPathRulePropertiesFormat withLoadDistributionPolicy(SubResource loadDistributionPolicy) { + this.loadDistributionPolicy = loadDistributionPolicy; + 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 ApplicationGatewayPathRulePropertiesFormat object itself. + */ + public ApplicationGatewayPathRulePropertiesFormat withFirewallPolicy(SubResource firewallPolicy) { + this.firewallPolicy = firewallPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("paths", this.paths, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeJsonField("backendHttpSettings", this.backendHttpSettings); + jsonWriter.writeJsonField("redirectConfiguration", this.redirectConfiguration); + jsonWriter.writeJsonField("rewriteRuleSet", this.rewriteRuleSet); + jsonWriter.writeJsonField("loadDistributionPolicy", this.loadDistributionPolicy); + jsonWriter.writeJsonField("firewallPolicy", this.firewallPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPathRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPathRulePropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPathRulePropertiesFormat. + */ + public static ApplicationGatewayPathRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPathRulePropertiesFormat deserializedApplicationGatewayPathRulePropertiesFormat + = new ApplicationGatewayPathRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("paths".equals(fieldName)) { + List paths = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationGatewayPathRulePropertiesFormat.paths = paths; + } else if ("backendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayPathRulePropertiesFormat.backendAddressPool + = SubResource.fromJson(reader); + } else if ("backendHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayPathRulePropertiesFormat.backendHttpSettings + = SubResource.fromJson(reader); + } else if ("redirectConfiguration".equals(fieldName)) { + deserializedApplicationGatewayPathRulePropertiesFormat.redirectConfiguration + = SubResource.fromJson(reader); + } else if ("rewriteRuleSet".equals(fieldName)) { + deserializedApplicationGatewayPathRulePropertiesFormat.rewriteRuleSet + = SubResource.fromJson(reader); + } else if ("loadDistributionPolicy".equals(fieldName)) { + deserializedApplicationGatewayPathRulePropertiesFormat.loadDistributionPolicy + = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayPathRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("firewallPolicy".equals(fieldName)) { + deserializedApplicationGatewayPathRulePropertiesFormat.firewallPolicy + = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPathRulePropertiesFormat; + }); + } +} 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..360da059368b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Private Endpoint connection on an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionInner extends SubResource { + /* + * Properties of the application gateway private endpoint connection. + */ + private ApplicationGatewayPrivateEndpointConnectionPropertiesInner innerProperties; + + /* + * Name of the private endpoint connection on an application gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayPrivateEndpointConnectionInner class. + */ + public ApplicationGatewayPrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the application gateway private endpoint connection. + * + * @return the innerProperties value. + */ + private ApplicationGatewayPrivateEndpointConnectionPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayPrivateEndpointConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointInner privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPrivateEndpointConnectionPropertiesInner(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + public String linkIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().linkIdentifier(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateEndpointConnectionInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateEndpointConnectionInner. + */ + public static ApplicationGatewayPrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateEndpointConnectionInner deserializedApplicationGatewayPrivateEndpointConnectionInner + = new ApplicationGatewayPrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionInner.innerProperties + = ApplicationGatewayPrivateEndpointConnectionPropertiesInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionPropertiesInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionPropertiesInner.java new file mode 100644 index 0000000000000..f9a17aeb7ff78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateEndpointConnectionPropertiesInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of Private Link Resource of an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionPropertiesInner + implements JsonSerializable { + /* + * The resource of private end point. + */ + private PrivateEndpointInner privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the application gateway private endpoint connection resource. + */ + private ProvisioningState provisioningState; + + /* + * The consumer link id. + */ + private String linkIdentifier; + + /** + * Creates an instance of ApplicationGatewayPrivateEndpointConnectionPropertiesInner class. + */ + public ApplicationGatewayPrivateEndpointConnectionPropertiesInner() { + } + + /** + * 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 ApplicationGatewayPrivateEndpointConnectionPropertiesInner object itself. + */ + public ApplicationGatewayPrivateEndpointConnectionPropertiesInner + 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateEndpointConnectionPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateEndpointConnectionPropertiesInner if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ApplicationGatewayPrivateEndpointConnectionPropertiesInner. + */ + public static ApplicationGatewayPrivateEndpointConnectionPropertiesInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateEndpointConnectionPropertiesInner deserializedApplicationGatewayPrivateEndpointConnectionPropertiesInner + = new ApplicationGatewayPrivateEndpointConnectionPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateEndpoint".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionPropertiesInner.privateEndpoint + = PrivateEndpointInner.fromJson(reader); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionPropertiesInner.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("linkIdentifier".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionPropertiesInner.linkIdentifier + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateEndpointConnectionPropertiesInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkConfigurationProperties.java new file mode 100644 index 0000000000000..431b13265d76b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateLinkIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of private link configuration on an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkConfigurationProperties + implements JsonSerializable { + /* + * An array of application gateway private link ip configurations. + */ + private List ipConfigurations; + + /* + * The provisioning state of the application gateway private link configuration. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayPrivateLinkConfigurationProperties class. + */ + public ApplicationGatewayPrivateLinkConfigurationProperties() { + } + + /** + * 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 ApplicationGatewayPrivateLinkConfigurationProperties object itself. + */ + public ApplicationGatewayPrivateLinkConfigurationProperties + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateLinkConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateLinkConfigurationProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateLinkConfigurationProperties. + */ + public static ApplicationGatewayPrivateLinkConfigurationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateLinkConfigurationProperties deserializedApplicationGatewayPrivateLinkConfigurationProperties + = new ApplicationGatewayPrivateLinkConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> ApplicationGatewayPrivateLinkIpConfiguration.fromJson(reader1)); + deserializedApplicationGatewayPrivateLinkConfigurationProperties.ipConfigurations + = ipConfigurations; + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateLinkConfigurationProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkIpConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkIpConfigurationProperties.java new file mode 100644 index 0000000000000..d4cfb2ca77d6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkIpConfigurationProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of an application gateway private link IP configuration. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkIpConfigurationProperties + implements JsonSerializable { + /* + * The private IP address of the IP configuration. + */ + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Reference to the subnet resource. + */ + private SubResource subnet; + + /* + * Whether the ip configuration is primary or not. + */ + private Boolean primary; + + /* + * The provisioning state of the application gateway private link IP configuration. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayPrivateLinkIpConfigurationProperties class. + */ + public ApplicationGatewayPrivateLinkIpConfigurationProperties() { + } + + /** + * 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 ApplicationGatewayPrivateLinkIpConfigurationProperties object itself. + */ + public ApplicationGatewayPrivateLinkIpConfigurationProperties 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 ApplicationGatewayPrivateLinkIpConfigurationProperties object itself. + */ + public ApplicationGatewayPrivateLinkIpConfigurationProperties + 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 ApplicationGatewayPrivateLinkIpConfigurationProperties object itself. + */ + public ApplicationGatewayPrivateLinkIpConfigurationProperties 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 ApplicationGatewayPrivateLinkIpConfigurationProperties object itself. + */ + public ApplicationGatewayPrivateLinkIpConfigurationProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeBooleanField("primary", this.primary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateLinkIpConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateLinkIpConfigurationProperties if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateLinkIpConfigurationProperties. + */ + public static ApplicationGatewayPrivateLinkIpConfigurationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateLinkIpConfigurationProperties deserializedApplicationGatewayPrivateLinkIpConfigurationProperties + = new ApplicationGatewayPrivateLinkIpConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAddress".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfigurationProperties.privateIpAddress + = reader.getString(); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfigurationProperties.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfigurationProperties.subnet + = SubResource.fromJson(reader); + } else if ("primary".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfigurationProperties.primary + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateLinkIpConfigurationProperties; + }); + } +} 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..00d1dcdf7050d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * PrivateLink Resource of an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceInner extends SubResource { + /* + * Properties of the application gateway private link resource. + */ + private ApplicationGatewayPrivateLinkResourceProperties innerProperties; + + /* + * Name of the private link resource that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayPrivateLinkResourceInner class. + */ + public ApplicationGatewayPrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Properties of the application gateway private link resource. + * + * @return the innerProperties value. + */ + private ApplicationGatewayPrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayPrivateLinkResourceInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the groupId property: Group identifier of private link resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: Required member names of private link resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateLinkResourceInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateLinkResourceInner. + */ + public static ApplicationGatewayPrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateLinkResourceInner deserializedApplicationGatewayPrivateLinkResourceInner + = new ApplicationGatewayPrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkResourceInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkResourceInner.innerProperties + = ApplicationGatewayPrivateLinkResourceProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkResourceInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkResourceInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkResourceInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..7e9389bf97a25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPrivateLinkResourceProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a private link resource. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceProperties + implements JsonSerializable { + /* + * Group identifier of private link resource. + */ + private String groupId; + + /* + * Required member names of private link resource. + */ + private List requiredMembers; + + /* + * Required DNS zone names of the the private link resource. + */ + private List requiredZoneNames; + + /** + * Creates an instance of ApplicationGatewayPrivateLinkResourceProperties class. + */ + public ApplicationGatewayPrivateLinkResourceProperties() { + } + + /** + * 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 ApplicationGatewayPrivateLinkResourceProperties object itself. + */ + public ApplicationGatewayPrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateLinkResourceProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateLinkResourceProperties. + */ + public static ApplicationGatewayPrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateLinkResourceProperties deserializedApplicationGatewayPrivateLinkResourceProperties + = new ApplicationGatewayPrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationGatewayPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationGatewayPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayProbePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayProbePropertiesFormat.java new file mode 100644 index 0000000000000..3b50d62d37047 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayProbePropertiesFormat.java @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProbeHealthResponseMatch; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of probe of an application gateway. + */ +@Fluent +public final class ApplicationGatewayProbePropertiesFormat + implements JsonSerializable { + /* + * The protocol used for the probe. + */ + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + */ + 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. + */ + 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. + */ + 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. + */ + private Integer unhealthyThreshold; + + /* + * Whether the host header should be picked from the backend http settings. Default value is false. + */ + private Boolean pickHostnameFromBackendHttpSettings; + + /* + * Whether the server name indication should be picked from the backend settings for Tls protocol. Default value is + * false. + */ + private Boolean pickHostnameFromBackendSettings; + + /* + * Minimum number of servers that are always marked healthy. Default value is 0. + */ + private Integer minServers; + + /* + * Criterion for classifying a healthy probe response. + */ + private ApplicationGatewayProbeHealthResponseMatch match; + + /* + * The provisioning state of the probe resource. + */ + 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 Basic, Standard_v2 and WAF_v2 only. + */ + private Integer port; + + /** + * Creates an instance of ApplicationGatewayProbePropertiesFormat class. + */ + public ApplicationGatewayProbePropertiesFormat() { + } + + /** + * 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat + withPickHostnameFromBackendHttpSettings(Boolean pickHostnameFromBackendHttpSettings) { + this.pickHostnameFromBackendHttpSettings = pickHostnameFromBackendHttpSettings; + return this; + } + + /** + * Get the pickHostnameFromBackendSettings property: Whether the server name indication should be picked from the + * backend settings for Tls protocol. Default value is false. + * + * @return the pickHostnameFromBackendSettings value. + */ + public Boolean pickHostnameFromBackendSettings() { + return this.pickHostnameFromBackendSettings; + } + + /** + * Set the pickHostnameFromBackendSettings property: Whether the server name indication should be picked from the + * backend settings for Tls protocol. Default value is false. + * + * @param pickHostnameFromBackendSettings the pickHostnameFromBackendSettings value to set. + * @return the ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat + withPickHostnameFromBackendSettings(Boolean pickHostnameFromBackendSettings) { + this.pickHostnameFromBackendSettings = pickHostnameFromBackendSettings; + 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat 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 Basic, + * 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 Basic, + * Standard_v2 and WAF_v2 only. + * + * @param port the port value to set. + * @return the ApplicationGatewayProbePropertiesFormat object itself. + */ + public ApplicationGatewayProbePropertiesFormat withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (match() != null) { + match().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeNumberField("timeout", this.timeout); + jsonWriter.writeNumberField("unhealthyThreshold", this.unhealthyThreshold); + jsonWriter.writeBooleanField("pickHostNameFromBackendHttpSettings", this.pickHostnameFromBackendHttpSettings); + jsonWriter.writeBooleanField("pickHostNameFromBackendSettings", this.pickHostnameFromBackendSettings); + jsonWriter.writeNumberField("minServers", this.minServers); + jsonWriter.writeJsonField("match", this.match); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayProbePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayProbePropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayProbePropertiesFormat. + */ + public static ApplicationGatewayProbePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayProbePropertiesFormat deserializedApplicationGatewayProbePropertiesFormat + = new ApplicationGatewayProbePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.protocol + = ApplicationGatewayProtocol.fromString(reader.getString()); + } else if ("host".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.host = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.path = reader.getString(); + } else if ("interval".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.interval + = reader.getNullable(JsonReader::getInt); + } else if ("timeout".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.timeout + = reader.getNullable(JsonReader::getInt); + } else if ("unhealthyThreshold".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.unhealthyThreshold + = reader.getNullable(JsonReader::getInt); + } else if ("pickHostNameFromBackendHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.pickHostnameFromBackendHttpSettings + = reader.getNullable(JsonReader::getBoolean); + } else if ("pickHostNameFromBackendSettings".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.pickHostnameFromBackendSettings + = reader.getNullable(JsonReader::getBoolean); + } else if ("minServers".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.minServers + = reader.getNullable(JsonReader::getInt); + } else if ("match".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.match + = ApplicationGatewayProbeHealthResponseMatch.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("port".equals(fieldName)) { + deserializedApplicationGatewayProbePropertiesFormat.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayProbePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPropertiesFormat.java new file mode 100644 index 0000000000000..79322050dcb14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayPropertiesFormat.java @@ -0,0 +1,1304 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.ApplicationGatewayBackendSettings; +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.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionPolicy; +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.ApplicationGatewayRoutingRule; +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.ApplicationGatewaySslPolicyName; +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.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the application gateway. + */ +@Fluent +public final class ApplicationGatewayPropertiesFormat implements JsonSerializable { + /* + * SKU of the application gateway resource. + */ + private ApplicationGatewaySku sku; + + /* + * SSL policy of the application gateway resource. + */ + private ApplicationGatewaySslPolicy sslPolicy; + + /* + * Operational state of the application gateway resource. + */ + 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). + */ + 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). + */ + 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). + */ + 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). + */ + 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). + */ + 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). + */ + 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). + */ + private List frontendPorts; + + /* + * Probes of the application gateway resource. + */ + 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). + */ + 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). + */ + private List backendHttpSettingsCollection; + + /* + * Backend 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). + */ + private List backendSettingsCollection; + + /* + * 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). + */ + private List httpListeners; + + /* + * 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). + */ + private List listeners; + + /* + * 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). + */ + 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). + */ + private List urlPathMaps; + + /* + * Request routing rules of the application gateway resource. + */ + private List requestRoutingRules; + + /* + * Routing rules of the application gateway resource. + */ + private List routingRules; + + /* + * Rewrite rules for the application gateway resource. + */ + 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). + */ + private List redirectConfigurations; + + /* + * Web application firewall configuration. + */ + private ApplicationGatewayWebApplicationFirewallConfiguration webApplicationFirewallConfiguration; + + /* + * Reference to the FirewallPolicy resource. + */ + private SubResource firewallPolicy; + + /* + * Whether HTTP2 is enabled on the application gateway resource. + */ + private Boolean enableHttp2; + + /* + * Whether FIPS is enabled on the application gateway resource. + */ + private Boolean enableFips; + + /* + * Autoscale Configuration. + */ + private ApplicationGatewayAutoscaleConfiguration autoscaleConfiguration; + + /* + * PrivateLink configurations on application gateway. + */ + private List privateLinkConfigurations; + + /* + * Private Endpoint connections on application gateway. + */ + private List privateEndpointConnections; + + /* + * The resource GUID property of the application gateway resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the application gateway resource. + */ + private ProvisioningState provisioningState; + + /* + * Custom error configurations of the application gateway resource. + */ + private List customErrorConfigurations; + + /* + * If true, associates a firewall policy with an application gateway regardless whether the policy differs from the + * WAF Config. + */ + private Boolean forceFirewallPolicyAssociation; + + /* + * Load distribution policies of the application gateway resource. + */ + private List loadDistributionPolicies; + + /* + * Global Configuration. + */ + private ApplicationGatewayGlobalConfiguration globalConfiguration; + + /* + * The default predefined SSL Policy applied on the application gateway resource. + */ + private ApplicationGatewaySslPolicyName defaultPredefinedSslPolicy; + + /** + * Creates an instance of ApplicationGatewayPropertiesFormat class. + */ + public ApplicationGatewayPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + withBackendHttpSettingsCollection(List backendHttpSettingsCollection) { + this.backendHttpSettingsCollection = backendHttpSettingsCollection; + return this; + } + + /** + * Get the backendSettingsCollection property: Backend 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 backendSettingsCollection value. + */ + public List backendSettingsCollection() { + return this.backendSettingsCollection; + } + + /** + * Set the backendSettingsCollection property: Backend 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 backendSettingsCollection the backendSettingsCollection value to set. + * @return the ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + withBackendSettingsCollection(List backendSettingsCollection) { + this.backendSettingsCollection = backendSettingsCollection; + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat withHttpListeners(List httpListeners) { + this.httpListeners = httpListeners; + return this; + } + + /** + * Get the listeners property: 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 listeners value. + */ + public List listeners() { + return this.listeners; + } + + /** + * Set the listeners property: 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 listeners the listeners value to set. + * @return the ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat withListeners(List listeners) { + this.listeners = listeners; + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + withRequestRoutingRules(List requestRoutingRules) { + this.requestRoutingRules = requestRoutingRules; + return this; + } + + /** + * Get the routingRules property: Routing rules of the application gateway resource. + * + * @return the routingRules value. + */ + public List routingRules() { + return this.routingRules; + } + + /** + * Set the routingRules property: Routing rules of the application gateway resource. + * + * @param routingRules the routingRules value to set. + * @return the ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat withRoutingRules(List routingRules) { + this.routingRules = routingRules; + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + 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 ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + withForceFirewallPolicyAssociation(Boolean forceFirewallPolicyAssociation) { + this.forceFirewallPolicyAssociation = forceFirewallPolicyAssociation; + return this; + } + + /** + * Get the loadDistributionPolicies property: Load distribution policies of the application gateway resource. + * + * @return the loadDistributionPolicies value. + */ + public List loadDistributionPolicies() { + return this.loadDistributionPolicies; + } + + /** + * Set the loadDistributionPolicies property: Load distribution policies of the application gateway resource. + * + * @param loadDistributionPolicies the loadDistributionPolicies value to set. + * @return the ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + withLoadDistributionPolicies(List loadDistributionPolicies) { + this.loadDistributionPolicies = loadDistributionPolicies; + return this; + } + + /** + * Get the globalConfiguration property: Global Configuration. + * + * @return the globalConfiguration value. + */ + public ApplicationGatewayGlobalConfiguration globalConfiguration() { + return this.globalConfiguration; + } + + /** + * Set the globalConfiguration property: Global Configuration. + * + * @param globalConfiguration the globalConfiguration value to set. + * @return the ApplicationGatewayPropertiesFormat object itself. + */ + public ApplicationGatewayPropertiesFormat + withGlobalConfiguration(ApplicationGatewayGlobalConfiguration globalConfiguration) { + this.globalConfiguration = globalConfiguration; + return this; + } + + /** + * Get the defaultPredefinedSslPolicy property: The default predefined SSL Policy applied on the application gateway + * resource. + * + * @return the defaultPredefinedSslPolicy value. + */ + public ApplicationGatewaySslPolicyName defaultPredefinedSslPolicy() { + return this.defaultPredefinedSslPolicy; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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 (backendSettingsCollection() != null) { + backendSettingsCollection().forEach(e -> e.validate()); + } + if (httpListeners() != null) { + httpListeners().forEach(e -> e.validate()); + } + if (listeners() != null) { + listeners().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 (routingRules() != null) { + routingRules().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()); + } + if (loadDistributionPolicies() != null) { + loadDistributionPolicies().forEach(e -> e.validate()); + } + if (globalConfiguration() != null) { + globalConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("sslPolicy", this.sslPolicy); + jsonWriter.writeArrayField("gatewayIPConfigurations", this.gatewayIpConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("authenticationCertificates", this.authenticationCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trustedRootCertificates", this.trustedRootCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trustedClientCertificates", this.trustedClientCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslCertificates", this.sslCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("frontendIPConfigurations", this.frontendIpConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("frontendPorts", this.frontendPorts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("probes", this.probes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("backendAddressPools", this.backendAddressPools, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("backendHttpSettingsCollection", this.backendHttpSettingsCollection, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("backendSettingsCollection", this.backendSettingsCollection, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("httpListeners", this.httpListeners, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("listeners", this.listeners, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sslProfiles", this.sslProfiles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("urlPathMaps", this.urlPathMaps, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("requestRoutingRules", this.requestRoutingRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("routingRules", this.routingRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("rewriteRuleSets", this.rewriteRuleSets, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("redirectConfigurations", this.redirectConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("webApplicationFirewallConfiguration", this.webApplicationFirewallConfiguration); + jsonWriter.writeJsonField("firewallPolicy", this.firewallPolicy); + jsonWriter.writeBooleanField("enableHttp2", this.enableHttp2); + jsonWriter.writeBooleanField("enableFips", this.enableFips); + jsonWriter.writeJsonField("autoscaleConfiguration", this.autoscaleConfiguration); + jsonWriter.writeArrayField("privateLinkConfigurations", this.privateLinkConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("customErrorConfigurations", this.customErrorConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("forceFirewallPolicyAssociation", this.forceFirewallPolicyAssociation); + jsonWriter.writeArrayField("loadDistributionPolicies", this.loadDistributionPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("globalConfiguration", this.globalConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPropertiesFormat. + */ + public static ApplicationGatewayPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPropertiesFormat deserializedApplicationGatewayPropertiesFormat + = new ApplicationGatewayPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.sku = ApplicationGatewaySku.fromJson(reader); + } else if ("sslPolicy".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.sslPolicy + = ApplicationGatewaySslPolicy.fromJson(reader); + } else if ("operationalState".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.operationalState + = ApplicationGatewayOperationalState.fromString(reader.getString()); + } else if ("gatewayIPConfigurations".equals(fieldName)) { + List gatewayIpConfigurations + = reader.readArray(reader1 -> ApplicationGatewayIpConfiguration.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.gatewayIpConfigurations = gatewayIpConfigurations; + } else if ("authenticationCertificates".equals(fieldName)) { + List authenticationCertificates + = reader.readArray(reader1 -> ApplicationGatewayAuthenticationCertificate.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.authenticationCertificates + = authenticationCertificates; + } else if ("trustedRootCertificates".equals(fieldName)) { + List trustedRootCertificates + = reader.readArray(reader1 -> ApplicationGatewayTrustedRootCertificate.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.trustedRootCertificates = trustedRootCertificates; + } else if ("trustedClientCertificates".equals(fieldName)) { + List trustedClientCertificates + = reader.readArray(reader1 -> ApplicationGatewayTrustedClientCertificate.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.trustedClientCertificates + = trustedClientCertificates; + } else if ("sslCertificates".equals(fieldName)) { + List sslCertificates + = reader.readArray(reader1 -> ApplicationGatewaySslCertificate.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.sslCertificates = sslCertificates; + } else if ("frontendIPConfigurations".equals(fieldName)) { + List frontendIpConfigurations + = reader.readArray(reader1 -> ApplicationGatewayFrontendIpConfiguration.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.frontendIpConfigurations = frontendIpConfigurations; + } else if ("frontendPorts".equals(fieldName)) { + List frontendPorts + = reader.readArray(reader1 -> ApplicationGatewayFrontendPort.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.frontendPorts = frontendPorts; + } else if ("probes".equals(fieldName)) { + List probes + = reader.readArray(reader1 -> ApplicationGatewayProbe.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.probes = probes; + } else if ("backendAddressPools".equals(fieldName)) { + List backendAddressPools + = reader.readArray(reader1 -> ApplicationGatewayBackendAddressPool.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.backendAddressPools = backendAddressPools; + } else if ("backendHttpSettingsCollection".equals(fieldName)) { + List backendHttpSettingsCollection + = reader.readArray(reader1 -> ApplicationGatewayBackendHttpSettings.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.backendHttpSettingsCollection + = backendHttpSettingsCollection; + } else if ("backendSettingsCollection".equals(fieldName)) { + List backendSettingsCollection + = reader.readArray(reader1 -> ApplicationGatewayBackendSettings.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.backendSettingsCollection + = backendSettingsCollection; + } else if ("httpListeners".equals(fieldName)) { + List httpListeners + = reader.readArray(reader1 -> ApplicationGatewayHttpListener.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.httpListeners = httpListeners; + } else if ("listeners".equals(fieldName)) { + List listeners + = reader.readArray(reader1 -> ApplicationGatewayListener.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.listeners = listeners; + } else if ("sslProfiles".equals(fieldName)) { + List sslProfiles + = reader.readArray(reader1 -> ApplicationGatewaySslProfile.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.sslProfiles = sslProfiles; + } else if ("urlPathMaps".equals(fieldName)) { + List urlPathMaps + = reader.readArray(reader1 -> ApplicationGatewayUrlPathMap.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.urlPathMaps = urlPathMaps; + } else if ("requestRoutingRules".equals(fieldName)) { + List requestRoutingRules + = reader.readArray(reader1 -> ApplicationGatewayRequestRoutingRule.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.requestRoutingRules = requestRoutingRules; + } else if ("routingRules".equals(fieldName)) { + List routingRules + = reader.readArray(reader1 -> ApplicationGatewayRoutingRule.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.routingRules = routingRules; + } else if ("rewriteRuleSets".equals(fieldName)) { + List rewriteRuleSets + = reader.readArray(reader1 -> ApplicationGatewayRewriteRuleSet.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.rewriteRuleSets = rewriteRuleSets; + } else if ("redirectConfigurations".equals(fieldName)) { + List redirectConfigurations + = reader.readArray(reader1 -> ApplicationGatewayRedirectConfiguration.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.redirectConfigurations = redirectConfigurations; + } else if ("webApplicationFirewallConfiguration".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.webApplicationFirewallConfiguration + = ApplicationGatewayWebApplicationFirewallConfiguration.fromJson(reader); + } else if ("firewallPolicy".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.firewallPolicy = SubResource.fromJson(reader); + } else if ("enableHttp2".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.enableHttp2 + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableFips".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.enableFips + = reader.getNullable(JsonReader::getBoolean); + } else if ("autoscaleConfiguration".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.autoscaleConfiguration + = ApplicationGatewayAutoscaleConfiguration.fromJson(reader); + } else if ("privateLinkConfigurations".equals(fieldName)) { + List privateLinkConfigurations + = reader.readArray(reader1 -> ApplicationGatewayPrivateLinkConfiguration.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.privateLinkConfigurations + = privateLinkConfigurations; + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections = reader + .readArray(reader1 -> ApplicationGatewayPrivateEndpointConnectionInner.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.privateEndpointConnections + = privateEndpointConnections; + } else if ("resourceGuid".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("customErrorConfigurations".equals(fieldName)) { + List customErrorConfigurations + = reader.readArray(reader1 -> ApplicationGatewayCustomError.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.customErrorConfigurations + = customErrorConfigurations; + } else if ("forceFirewallPolicyAssociation".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.forceFirewallPolicyAssociation + = reader.getNullable(JsonReader::getBoolean); + } else if ("loadDistributionPolicies".equals(fieldName)) { + List loadDistributionPolicies + = reader.readArray(reader1 -> ApplicationGatewayLoadDistributionPolicy.fromJson(reader1)); + deserializedApplicationGatewayPropertiesFormat.loadDistributionPolicies = loadDistributionPolicies; + } else if ("globalConfiguration".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.globalConfiguration + = ApplicationGatewayGlobalConfiguration.fromJson(reader); + } else if ("defaultPredefinedSslPolicy".equals(fieldName)) { + deserializedApplicationGatewayPropertiesFormat.defaultPredefinedSslPolicy + = ApplicationGatewaySslPolicyName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..684731eda9ae5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRedirectConfigurationPropertiesFormat.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRedirectType; +import java.io.IOException; +import java.util.List; + +/** + * Properties of redirect configuration of the application gateway. + */ +@Fluent +public final class ApplicationGatewayRedirectConfigurationPropertiesFormat + implements JsonSerializable { + /* + * HTTP redirection type. + */ + private ApplicationGatewayRedirectType redirectType; + + /* + * Reference to a listener to redirect the request to. + */ + private SubResource targetListener; + + /* + * Url to redirect the request to. + */ + private String targetUrl; + + /* + * Include path in the redirected url. + */ + private Boolean includePath; + + /* + * Include query string in the redirected url. + */ + private Boolean includeQueryString; + + /* + * Request routing specifying redirect configuration. + */ + private List requestRoutingRules; + + /* + * Url path maps specifying default redirect configuration. + */ + private List urlPathMaps; + + /* + * Path rules specifying redirect configuration. + */ + private List pathRules; + + /** + * Creates an instance of ApplicationGatewayRedirectConfigurationPropertiesFormat class. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat + 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat + 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat 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 ApplicationGatewayRedirectConfigurationPropertiesFormat object itself. + */ + public ApplicationGatewayRedirectConfigurationPropertiesFormat withPathRules(List pathRules) { + this.pathRules = pathRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("redirectType", this.redirectType == null ? null : this.redirectType.toString()); + jsonWriter.writeJsonField("targetListener", this.targetListener); + jsonWriter.writeStringField("targetUrl", this.targetUrl); + jsonWriter.writeBooleanField("includePath", this.includePath); + jsonWriter.writeBooleanField("includeQueryString", this.includeQueryString); + jsonWriter.writeArrayField("requestRoutingRules", this.requestRoutingRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("urlPathMaps", this.urlPathMaps, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("pathRules", this.pathRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRedirectConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRedirectConfigurationPropertiesFormat if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRedirectConfigurationPropertiesFormat. + */ + public static ApplicationGatewayRedirectConfigurationPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRedirectConfigurationPropertiesFormat deserializedApplicationGatewayRedirectConfigurationPropertiesFormat + = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("redirectType".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.redirectType + = ApplicationGatewayRedirectType.fromString(reader.getString()); + } else if ("targetListener".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.targetListener + = SubResource.fromJson(reader); + } else if ("targetUrl".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.targetUrl = reader.getString(); + } else if ("includePath".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.includePath + = reader.getNullable(JsonReader::getBoolean); + } else if ("includeQueryString".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.includeQueryString + = reader.getNullable(JsonReader::getBoolean); + } else if ("requestRoutingRules".equals(fieldName)) { + List requestRoutingRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.requestRoutingRules + = requestRoutingRules; + } else if ("urlPathMaps".equals(fieldName)) { + List urlPathMaps = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.urlPathMaps = urlPathMaps; + } else if ("pathRules".equals(fieldName)) { + List pathRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewayRedirectConfigurationPropertiesFormat.pathRules = pathRules; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRedirectConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java new file mode 100644 index 0000000000000..39dfb7d11c977 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRequestRoutingRulePropertiesFormat.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of request routing rule of the application gateway. + */ +@Fluent +public final class ApplicationGatewayRequestRoutingRulePropertiesFormat + implements JsonSerializable { + /* + * Rule type. + */ + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /* + * Priority of the request routing rule. + */ + private Integer priority; + + /* + * Backend address pool resource of the application gateway. + */ + private SubResource backendAddressPool; + + /* + * Backend http settings resource of the application gateway. + */ + private SubResource backendHttpSettings; + + /* + * Http listener resource of the application gateway. + */ + private SubResource httpListener; + + /* + * URL path map resource of the application gateway. + */ + private SubResource urlPathMap; + + /* + * Rewrite Rule Set resource in Basic rule of the application gateway. + */ + private SubResource rewriteRuleSet; + + /* + * Redirect configuration resource of the application gateway. + */ + private SubResource redirectConfiguration; + + /* + * Load Distribution Policy resource of the application gateway. + */ + private SubResource loadDistributionPolicy; + + /* + * The provisioning state of the request routing rule resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayRequestRoutingRulePropertiesFormat class. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat() { + } + + /** + * 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat + 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat + 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat 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 ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat + withRedirectConfiguration(SubResource redirectConfiguration) { + this.redirectConfiguration = redirectConfiguration; + return this; + } + + /** + * Get the loadDistributionPolicy property: Load Distribution Policy resource of the application gateway. + * + * @return the loadDistributionPolicy value. + */ + public SubResource loadDistributionPolicy() { + return this.loadDistributionPolicy; + } + + /** + * Set the loadDistributionPolicy property: Load Distribution Policy resource of the application gateway. + * + * @param loadDistributionPolicy the loadDistributionPolicy value to set. + * @return the ApplicationGatewayRequestRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRequestRoutingRulePropertiesFormat + withLoadDistributionPolicy(SubResource loadDistributionPolicy) { + this.loadDistributionPolicy = loadDistributionPolicy; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeJsonField("backendHttpSettings", this.backendHttpSettings); + jsonWriter.writeJsonField("httpListener", this.httpListener); + jsonWriter.writeJsonField("urlPathMap", this.urlPathMap); + jsonWriter.writeJsonField("rewriteRuleSet", this.rewriteRuleSet); + jsonWriter.writeJsonField("redirectConfiguration", this.redirectConfiguration); + jsonWriter.writeJsonField("loadDistributionPolicy", this.loadDistributionPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRequestRoutingRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRequestRoutingRulePropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRequestRoutingRulePropertiesFormat. + */ + public static ApplicationGatewayRequestRoutingRulePropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRequestRoutingRulePropertiesFormat deserializedApplicationGatewayRequestRoutingRulePropertiesFormat + = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleType".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.ruleType + = ApplicationGatewayRequestRoutingRuleType.fromString(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.priority + = reader.getNullable(JsonReader::getInt); + } else if ("backendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.backendAddressPool + = SubResource.fromJson(reader); + } else if ("backendHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.backendHttpSettings + = SubResource.fromJson(reader); + } else if ("httpListener".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.httpListener + = SubResource.fromJson(reader); + } else if ("urlPathMap".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.urlPathMap + = SubResource.fromJson(reader); + } else if ("rewriteRuleSet".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.rewriteRuleSet + = SubResource.fromJson(reader); + } else if ("redirectConfiguration".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.redirectConfiguration + = SubResource.fromJson(reader); + } else if ("loadDistributionPolicy".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.loadDistributionPolicy + = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRequestRoutingRulePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.java new file mode 100644 index 0000000000000..6da0cf1df02ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRewriteRuleSetPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of rewrite rule set of the application gateway. + */ +@Fluent +public final class ApplicationGatewayRewriteRuleSetPropertiesFormat + implements JsonSerializable { + /* + * Rewrite rules in the rewrite rule set. + */ + private List rewriteRules; + + /* + * The provisioning state of the rewrite rule set resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayRewriteRuleSetPropertiesFormat class. + */ + public ApplicationGatewayRewriteRuleSetPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayRewriteRuleSetPropertiesFormat object itself. + */ + public ApplicationGatewayRewriteRuleSetPropertiesFormat + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rewriteRules() != null) { + rewriteRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rewriteRules", this.rewriteRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRewriteRuleSetPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRewriteRuleSetPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRewriteRuleSetPropertiesFormat. + */ + public static ApplicationGatewayRewriteRuleSetPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRewriteRuleSetPropertiesFormat deserializedApplicationGatewayRewriteRuleSetPropertiesFormat + = new ApplicationGatewayRewriteRuleSetPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rewriteRules".equals(fieldName)) { + List rewriteRules + = reader.readArray(reader1 -> ApplicationGatewayRewriteRule.fromJson(reader1)); + deserializedApplicationGatewayRewriteRuleSetPropertiesFormat.rewriteRules = rewriteRules; + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleSetPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRewriteRuleSetPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRoutingRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRoutingRulePropertiesFormat.java new file mode 100644 index 0000000000000..6177a6b3b1f18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayRoutingRulePropertiesFormat.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of routing rule of the application gateway. + */ +@Fluent +public final class ApplicationGatewayRoutingRulePropertiesFormat + implements JsonSerializable { + /* + * Rule type. + */ + private ApplicationGatewayRequestRoutingRuleType ruleType; + + /* + * Priority of the routing rule. + */ + private int priority; + + /* + * Backend address pool resource of the application gateway. + */ + private SubResource backendAddressPool; + + /* + * Backend settings resource of the application gateway. + */ + private SubResource backendSettings; + + /* + * Listener resource of the application gateway. + */ + private SubResource listener; + + /* + * The provisioning state of the request routing rule resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayRoutingRulePropertiesFormat class. + */ + public ApplicationGatewayRoutingRulePropertiesFormat() { + } + + /** + * 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 ApplicationGatewayRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRoutingRulePropertiesFormat + withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the priority property: Priority of the routing rule. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: Priority of the routing rule. + * + * @param priority the priority value to set. + * @return the ApplicationGatewayRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRoutingRulePropertiesFormat withPriority(int 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 ApplicationGatewayRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRoutingRulePropertiesFormat withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + return this; + } + + /** + * Get the backendSettings property: Backend settings resource of the application gateway. + * + * @return the backendSettings value. + */ + public SubResource backendSettings() { + return this.backendSettings; + } + + /** + * Set the backendSettings property: Backend settings resource of the application gateway. + * + * @param backendSettings the backendSettings value to set. + * @return the ApplicationGatewayRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRoutingRulePropertiesFormat withBackendSettings(SubResource backendSettings) { + this.backendSettings = backendSettings; + return this; + } + + /** + * Get the listener property: Listener resource of the application gateway. + * + * @return the listener value. + */ + public SubResource listener() { + return this.listener; + } + + /** + * Set the listener property: Listener resource of the application gateway. + * + * @param listener the listener value to set. + * @return the ApplicationGatewayRoutingRulePropertiesFormat object itself. + */ + public ApplicationGatewayRoutingRulePropertiesFormat withListener(SubResource listener) { + this.listener = listener; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("priority", this.priority); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeJsonField("backendSettings", this.backendSettings); + jsonWriter.writeJsonField("listener", this.listener); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRoutingRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRoutingRulePropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayRoutingRulePropertiesFormat. + */ + public static ApplicationGatewayRoutingRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRoutingRulePropertiesFormat deserializedApplicationGatewayRoutingRulePropertiesFormat + = new ApplicationGatewayRoutingRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedApplicationGatewayRoutingRulePropertiesFormat.priority = reader.getInt(); + } else if ("ruleType".equals(fieldName)) { + deserializedApplicationGatewayRoutingRulePropertiesFormat.ruleType + = ApplicationGatewayRequestRoutingRuleType.fromString(reader.getString()); + } else if ("backendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayRoutingRulePropertiesFormat.backendAddressPool + = SubResource.fromJson(reader); + } else if ("backendSettings".equals(fieldName)) { + deserializedApplicationGatewayRoutingRulePropertiesFormat.backendSettings + = SubResource.fromJson(reader); + } else if ("listener".equals(fieldName)) { + deserializedApplicationGatewayRoutingRulePropertiesFormat.listener = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayRoutingRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRoutingRulePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.java new file mode 100644 index 0000000000000..672b5e9884c73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslCertificatePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of SSL certificates of an application gateway. + */ +@Fluent +public final class ApplicationGatewaySslCertificatePropertiesFormat + implements JsonSerializable { + /* + * Base-64 encoded pfx certificate. Only applicable in PUT Request. + */ + private String data; + + /* + * Password for the pfx file specified in data. Only applicable in PUT request. + */ + private String password; + + /* + * Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. + */ + private String publicCertData; + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + */ + private String keyVaultSecretId; + + /* + * The provisioning state of the SSL certificate resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewaySslCertificatePropertiesFormat class. + */ + public ApplicationGatewaySslCertificatePropertiesFormat() { + } + + /** + * 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 ApplicationGatewaySslCertificatePropertiesFormat object itself. + */ + public ApplicationGatewaySslCertificatePropertiesFormat 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 ApplicationGatewaySslCertificatePropertiesFormat object itself. + */ + public ApplicationGatewaySslCertificatePropertiesFormat 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 ApplicationGatewaySslCertificatePropertiesFormat object itself. + */ + public ApplicationGatewaySslCertificatePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("data", this.data); + jsonWriter.writeStringField("password", this.password); + jsonWriter.writeStringField("keyVaultSecretId", this.keyVaultSecretId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySslCertificatePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySslCertificatePropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySslCertificatePropertiesFormat. + */ + public static ApplicationGatewaySslCertificatePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySslCertificatePropertiesFormat deserializedApplicationGatewaySslCertificatePropertiesFormat + = new ApplicationGatewaySslCertificatePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + deserializedApplicationGatewaySslCertificatePropertiesFormat.data = reader.getString(); + } else if ("password".equals(fieldName)) { + deserializedApplicationGatewaySslCertificatePropertiesFormat.password = reader.getString(); + } else if ("publicCertData".equals(fieldName)) { + deserializedApplicationGatewaySslCertificatePropertiesFormat.publicCertData = reader.getString(); + } else if ("keyVaultSecretId".equals(fieldName)) { + deserializedApplicationGatewaySslCertificatePropertiesFormat.keyVaultSecretId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewaySslCertificatePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySslCertificatePropertiesFormat; + }); + } +} 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..88c770ed173f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import java.io.IOException; +import java.util.List; + +/** + * An Ssl predefined policy. + */ +@Fluent +public final class ApplicationGatewaySslPredefinedPolicyInner extends SubResource { + /* + * Name of the Ssl predefined policy. + */ + private String name; + + /* + * Properties of the application gateway SSL predefined policy. + */ + private ApplicationGatewaySslPredefinedPolicyPropertiesFormat innerProperties; + + /** + * Creates an instance of ApplicationGatewaySslPredefinedPolicyInner class. + */ + public ApplicationGatewaySslPredefinedPolicyInner() { + } + + /** + * 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 innerProperties property: Properties of the application gateway SSL predefined policy. + * + * @return the innerProperties value. + */ + private ApplicationGatewaySslPredefinedPolicyPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewaySslPredefinedPolicyInner withId(String id) { + super.withId(id); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslPredefinedPolicyPropertiesFormat(); + } + this.innerProperties().withCipherSuites(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslPredefinedPolicyPropertiesFormat(); + } + this.innerProperties().withMinProtocolVersion(minProtocolVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySslPredefinedPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySslPredefinedPolicyInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySslPredefinedPolicyInner. + */ + public static ApplicationGatewaySslPredefinedPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySslPredefinedPolicyInner deserializedApplicationGatewaySslPredefinedPolicyInner + = new ApplicationGatewaySslPredefinedPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewaySslPredefinedPolicyInner.withId(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewaySslPredefinedPolicyInner.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewaySslPredefinedPolicyInner.innerProperties + = ApplicationGatewaySslPredefinedPolicyPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySslPredefinedPolicyInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.java new file mode 100644 index 0000000000000..4e8921325c9a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslPredefinedPolicyPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import java.io.IOException; +import java.util.List; + +/** + * Properties of ApplicationGatewaySslPredefinedPolicy. + */ +@Fluent +public final class ApplicationGatewaySslPredefinedPolicyPropertiesFormat + implements JsonSerializable { + /* + * Ssl cipher suites to be enabled in the specified order for application gateway. + */ + private List cipherSuites; + + /* + * Minimum version of Ssl protocol to be supported on application gateway. + */ + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Creates an instance of ApplicationGatewaySslPredefinedPolicyPropertiesFormat class. + */ + public ApplicationGatewaySslPredefinedPolicyPropertiesFormat() { + } + + /** + * 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 ApplicationGatewaySslPredefinedPolicyPropertiesFormat object itself. + */ + public ApplicationGatewaySslPredefinedPolicyPropertiesFormat + 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 ApplicationGatewaySslPredefinedPolicyPropertiesFormat object itself. + */ + public ApplicationGatewaySslPredefinedPolicyPropertiesFormat + withMinProtocolVersion(ApplicationGatewaySslProtocol minProtocolVersion) { + this.minProtocolVersion = minProtocolVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("cipherSuites", this.cipherSuites, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("minProtocolVersion", + this.minProtocolVersion == null ? null : this.minProtocolVersion.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySslPredefinedPolicyPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySslPredefinedPolicyPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySslPredefinedPolicyPropertiesFormat. + */ + public static ApplicationGatewaySslPredefinedPolicyPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySslPredefinedPolicyPropertiesFormat deserializedApplicationGatewaySslPredefinedPolicyPropertiesFormat + = new ApplicationGatewaySslPredefinedPolicyPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cipherSuites".equals(fieldName)) { + List cipherSuites + = reader.readArray(reader1 -> ApplicationGatewaySslCipherSuite.fromString(reader1.getString())); + deserializedApplicationGatewaySslPredefinedPolicyPropertiesFormat.cipherSuites = cipherSuites; + } else if ("minProtocolVersion".equals(fieldName)) { + deserializedApplicationGatewaySslPredefinedPolicyPropertiesFormat.minProtocolVersion + = ApplicationGatewaySslProtocol.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySslPredefinedPolicyPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslProfilePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslProfilePropertiesFormat.java new file mode 100644 index 0000000000000..52cd3f853edbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewaySslProfilePropertiesFormat.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayClientAuthConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicy; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of SSL profile of an application gateway. + */ +@Fluent +public final class ApplicationGatewaySslProfilePropertiesFormat + implements JsonSerializable { + /* + * Array of references to application gateway trusted client certificates. + */ + private List trustedClientCertificates; + + /* + * SSL policy of the application gateway resource. + */ + private ApplicationGatewaySslPolicy sslPolicy; + + /* + * Client authentication configuration of the application gateway resource. + */ + private ApplicationGatewayClientAuthConfiguration clientAuthConfiguration; + + /* + * The provisioning state of the HTTP listener resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewaySslProfilePropertiesFormat class. + */ + public ApplicationGatewaySslProfilePropertiesFormat() { + } + + /** + * 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 ApplicationGatewaySslProfilePropertiesFormat object itself. + */ + public ApplicationGatewaySslProfilePropertiesFormat + 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 ApplicationGatewaySslProfilePropertiesFormat object itself. + */ + public ApplicationGatewaySslProfilePropertiesFormat 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 ApplicationGatewaySslProfilePropertiesFormat object itself. + */ + public ApplicationGatewaySslProfilePropertiesFormat + 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("trustedClientCertificates", this.trustedClientCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sslPolicy", this.sslPolicy); + jsonWriter.writeJsonField("clientAuthConfiguration", this.clientAuthConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySslProfilePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySslProfilePropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySslProfilePropertiesFormat. + */ + public static ApplicationGatewaySslProfilePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySslProfilePropertiesFormat deserializedApplicationGatewaySslProfilePropertiesFormat + = new ApplicationGatewaySslProfilePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trustedClientCertificates".equals(fieldName)) { + List trustedClientCertificates + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedApplicationGatewaySslProfilePropertiesFormat.trustedClientCertificates + = trustedClientCertificates; + } else if ("sslPolicy".equals(fieldName)) { + deserializedApplicationGatewaySslProfilePropertiesFormat.sslPolicy + = ApplicationGatewaySslPolicy.fromJson(reader); + } else if ("clientAuthConfiguration".equals(fieldName)) { + deserializedApplicationGatewaySslProfilePropertiesFormat.clientAuthConfiguration + = ApplicationGatewayClientAuthConfiguration.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewaySslProfilePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySslProfilePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.java new file mode 100644 index 0000000000000..aa8bd954711e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedClientCertificatePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Trusted client certificates properties of an application gateway. + */ +@Fluent +public final class ApplicationGatewayTrustedClientCertificatePropertiesFormat + implements JsonSerializable { + /* + * Certificate public data. + */ + private String data; + + /* + * Validated certificate data. + */ + private String validatedCertData; + + /* + * Distinguished name of client certificate issuer. + */ + private String clientCertIssuerDN; + + /* + * The provisioning state of the trusted client certificate resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayTrustedClientCertificatePropertiesFormat class. + */ + public ApplicationGatewayTrustedClientCertificatePropertiesFormat() { + } + + /** + * 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 ApplicationGatewayTrustedClientCertificatePropertiesFormat object itself. + */ + public ApplicationGatewayTrustedClientCertificatePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("data", this.data); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayTrustedClientCertificatePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayTrustedClientCertificatePropertiesFormat if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ApplicationGatewayTrustedClientCertificatePropertiesFormat. + */ + public static ApplicationGatewayTrustedClientCertificatePropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayTrustedClientCertificatePropertiesFormat deserializedApplicationGatewayTrustedClientCertificatePropertiesFormat + = new ApplicationGatewayTrustedClientCertificatePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificatePropertiesFormat.data = reader.getString(); + } else if ("validatedCertData".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificatePropertiesFormat.validatedCertData + = reader.getString(); + } else if ("clientCertIssuerDN".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificatePropertiesFormat.clientCertIssuerDN + = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificatePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayTrustedClientCertificatePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.java new file mode 100644 index 0000000000000..83b43146fb492 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayTrustedRootCertificatePropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Trusted Root certificates properties of an application gateway. + */ +@Fluent +public final class ApplicationGatewayTrustedRootCertificatePropertiesFormat + implements JsonSerializable { + /* + * Certificate public data. + */ + private String data; + + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + */ + private String keyVaultSecretId; + + /* + * The provisioning state of the trusted root certificate resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayTrustedRootCertificatePropertiesFormat class. + */ + public ApplicationGatewayTrustedRootCertificatePropertiesFormat() { + } + + /** + * 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 ApplicationGatewayTrustedRootCertificatePropertiesFormat object itself. + */ + public ApplicationGatewayTrustedRootCertificatePropertiesFormat 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 ApplicationGatewayTrustedRootCertificatePropertiesFormat object itself. + */ + public ApplicationGatewayTrustedRootCertificatePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("data", this.data); + jsonWriter.writeStringField("keyVaultSecretId", this.keyVaultSecretId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayTrustedRootCertificatePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayTrustedRootCertificatePropertiesFormat if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ApplicationGatewayTrustedRootCertificatePropertiesFormat. + */ + public static ApplicationGatewayTrustedRootCertificatePropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayTrustedRootCertificatePropertiesFormat deserializedApplicationGatewayTrustedRootCertificatePropertiesFormat + = new ApplicationGatewayTrustedRootCertificatePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificatePropertiesFormat.data = reader.getString(); + } else if ("keyVaultSecretId".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificatePropertiesFormat.keyVaultSecretId + = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificatePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayTrustedRootCertificatePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.java new file mode 100644 index 0000000000000..67649cfb977f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayUrlPathMapPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPathRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of UrlPathMap of the application gateway. + */ +@Fluent +public final class ApplicationGatewayUrlPathMapPropertiesFormat + implements JsonSerializable { + /* + * Default backend address pool resource of URL path map. + */ + private SubResource defaultBackendAddressPool; + + /* + * Default backend http settings resource of URL path map. + */ + private SubResource defaultBackendHttpSettings; + + /* + * Default Rewrite rule set resource of URL path map. + */ + private SubResource defaultRewriteRuleSet; + + /* + * Default redirect configuration resource of URL path map. + */ + private SubResource defaultRedirectConfiguration; + + /* + * Default Load Distribution Policy resource of URL path map. + */ + private SubResource defaultLoadDistributionPolicy; + + /* + * Path rule of URL path map resource. + */ + private List pathRules; + + /* + * The provisioning state of the URL path map resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationGatewayUrlPathMapPropertiesFormat class. + */ + public ApplicationGatewayUrlPathMapPropertiesFormat() { + } + + /** + * 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 ApplicationGatewayUrlPathMapPropertiesFormat object itself. + */ + public ApplicationGatewayUrlPathMapPropertiesFormat + 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 ApplicationGatewayUrlPathMapPropertiesFormat object itself. + */ + public ApplicationGatewayUrlPathMapPropertiesFormat + 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 ApplicationGatewayUrlPathMapPropertiesFormat object itself. + */ + public ApplicationGatewayUrlPathMapPropertiesFormat 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 ApplicationGatewayUrlPathMapPropertiesFormat object itself. + */ + public ApplicationGatewayUrlPathMapPropertiesFormat + withDefaultRedirectConfiguration(SubResource defaultRedirectConfiguration) { + this.defaultRedirectConfiguration = defaultRedirectConfiguration; + return this; + } + + /** + * Get the defaultLoadDistributionPolicy property: Default Load Distribution Policy resource of URL path map. + * + * @return the defaultLoadDistributionPolicy value. + */ + public SubResource defaultLoadDistributionPolicy() { + return this.defaultLoadDistributionPolicy; + } + + /** + * Set the defaultLoadDistributionPolicy property: Default Load Distribution Policy resource of URL path map. + * + * @param defaultLoadDistributionPolicy the defaultLoadDistributionPolicy value to set. + * @return the ApplicationGatewayUrlPathMapPropertiesFormat object itself. + */ + public ApplicationGatewayUrlPathMapPropertiesFormat + withDefaultLoadDistributionPolicy(SubResource defaultLoadDistributionPolicy) { + this.defaultLoadDistributionPolicy = defaultLoadDistributionPolicy; + 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 ApplicationGatewayUrlPathMapPropertiesFormat object itself. + */ + public ApplicationGatewayUrlPathMapPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pathRules() != null) { + pathRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("defaultBackendAddressPool", this.defaultBackendAddressPool); + jsonWriter.writeJsonField("defaultBackendHttpSettings", this.defaultBackendHttpSettings); + jsonWriter.writeJsonField("defaultRewriteRuleSet", this.defaultRewriteRuleSet); + jsonWriter.writeJsonField("defaultRedirectConfiguration", this.defaultRedirectConfiguration); + jsonWriter.writeJsonField("defaultLoadDistributionPolicy", this.defaultLoadDistributionPolicy); + jsonWriter.writeArrayField("pathRules", this.pathRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayUrlPathMapPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayUrlPathMapPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayUrlPathMapPropertiesFormat. + */ + public static ApplicationGatewayUrlPathMapPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayUrlPathMapPropertiesFormat deserializedApplicationGatewayUrlPathMapPropertiesFormat + = new ApplicationGatewayUrlPathMapPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultBackendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMapPropertiesFormat.defaultBackendAddressPool + = SubResource.fromJson(reader); + } else if ("defaultBackendHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMapPropertiesFormat.defaultBackendHttpSettings + = SubResource.fromJson(reader); + } else if ("defaultRewriteRuleSet".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMapPropertiesFormat.defaultRewriteRuleSet + = SubResource.fromJson(reader); + } else if ("defaultRedirectConfiguration".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMapPropertiesFormat.defaultRedirectConfiguration + = SubResource.fromJson(reader); + } else if ("defaultLoadDistributionPolicy".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMapPropertiesFormat.defaultLoadDistributionPolicy + = SubResource.fromJson(reader); + } else if ("pathRules".equals(fieldName)) { + List pathRules + = reader.readArray(reader1 -> ApplicationGatewayPathRule.fromJson(reader1)); + deserializedApplicationGatewayUrlPathMapPropertiesFormat.pathRules = pathRules; + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMapPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayUrlPathMapPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestPropertiesResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestPropertiesResult.java new file mode 100644 index 0000000000000..32278c6582782 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestPropertiesResult.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallManifestRuleSet; +import java.io.IOException; +import java.util.List; + +/** + * Properties of ApplicationGatewayWafDynamicManifest. + */ +@Fluent +public final class ApplicationGatewayWafDynamicManifestPropertiesResult + implements JsonSerializable { + /* + * The default ruleset. + */ + private DefaultRuleSetPropertyFormat innerDefaultRuleSet; + + /* + * The available rulesets. + */ + private List availableRuleSets; + + /** + * Creates an instance of ApplicationGatewayWafDynamicManifestPropertiesResult class. + */ + public ApplicationGatewayWafDynamicManifestPropertiesResult() { + } + + /** + * Get the innerDefaultRuleSet property: The default ruleset. + * + * @return the innerDefaultRuleSet value. + */ + private DefaultRuleSetPropertyFormat innerDefaultRuleSet() { + return this.innerDefaultRuleSet; + } + + /** + * Get the availableRuleSets property: The available rulesets. + * + * @return the availableRuleSets value. + */ + public List availableRuleSets() { + return this.availableRuleSets; + } + + /** + * Set the availableRuleSets property: The available rulesets. + * + * @param availableRuleSets the availableRuleSets value to set. + * @return the ApplicationGatewayWafDynamicManifestPropertiesResult object itself. + */ + public ApplicationGatewayWafDynamicManifestPropertiesResult + withAvailableRuleSets(List availableRuleSets) { + this.availableRuleSets = availableRuleSets; + return this; + } + + /** + * Get the ruleSetType property: The type of the web application firewall rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.innerDefaultRuleSet() == null ? null : this.innerDefaultRuleSet().ruleSetType(); + } + + /** + * Set the ruleSetType property: The type of the web application firewall rule set. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ApplicationGatewayWafDynamicManifestPropertiesResult object itself. + */ + public ApplicationGatewayWafDynamicManifestPropertiesResult withRuleSetType(String ruleSetType) { + if (this.innerDefaultRuleSet() == null) { + this.innerDefaultRuleSet = new DefaultRuleSetPropertyFormat(); + } + this.innerDefaultRuleSet().withRuleSetType(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.innerDefaultRuleSet() == null ? null : this.innerDefaultRuleSet().ruleSetVersion(); + } + + /** + * Set the ruleSetVersion property: The version of the web application firewall rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ApplicationGatewayWafDynamicManifestPropertiesResult object itself. + */ + public ApplicationGatewayWafDynamicManifestPropertiesResult withRuleSetVersion(String ruleSetVersion) { + if (this.innerDefaultRuleSet() == null) { + this.innerDefaultRuleSet = new DefaultRuleSetPropertyFormat(); + } + this.innerDefaultRuleSet().withRuleSetVersion(ruleSetVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerDefaultRuleSet() != null) { + innerDefaultRuleSet().validate(); + } + if (availableRuleSets() != null) { + availableRuleSets().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("defaultRuleSet", this.innerDefaultRuleSet); + jsonWriter.writeArrayField("availableRuleSets", this.availableRuleSets, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayWafDynamicManifestPropertiesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayWafDynamicManifestPropertiesResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayWafDynamicManifestPropertiesResult. + */ + public static ApplicationGatewayWafDynamicManifestPropertiesResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayWafDynamicManifestPropertiesResult deserializedApplicationGatewayWafDynamicManifestPropertiesResult + = new ApplicationGatewayWafDynamicManifestPropertiesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultRuleSet".equals(fieldName)) { + deserializedApplicationGatewayWafDynamicManifestPropertiesResult.innerDefaultRuleSet + = DefaultRuleSetPropertyFormat.fromJson(reader); + } else if ("availableRuleSets".equals(fieldName)) { + List availableRuleSets + = reader.readArray(reader1 -> ApplicationGatewayFirewallManifestRuleSet.fromJson(reader1)); + deserializedApplicationGatewayWafDynamicManifestPropertiesResult.availableRuleSets + = availableRuleSets; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayWafDynamicManifestPropertiesResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestResultInner.java new file mode 100644 index 0000000000000..c2d64a369b663 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationGatewayWafDynamicManifestResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallManifestRuleSet; +import java.io.IOException; +import java.util.List; + +/** + * Response for ApplicationGatewayWafDynamicManifest API service call. + */ +@Fluent +public final class ApplicationGatewayWafDynamicManifestResultInner + implements JsonSerializable { + /* + * Resource ID. + */ + private String id; + + /* + * Resource name. + */ + private String name; + + /* + * Resource type. + */ + private String type; + + /* + * Properties of the ApplicationGatewayWafDynamicManifest . + */ + private ApplicationGatewayWafDynamicManifestPropertiesResult innerProperties; + + /** + * Creates an instance of ApplicationGatewayWafDynamicManifestResultInner class. + */ + public ApplicationGatewayWafDynamicManifestResultInner() { + } + + /** + * 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 ApplicationGatewayWafDynamicManifestResultInner object itself. + */ + public ApplicationGatewayWafDynamicManifestResultInner 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 innerProperties property: Properties of the ApplicationGatewayWafDynamicManifest . + * + * @return the innerProperties value. + */ + private ApplicationGatewayWafDynamicManifestPropertiesResult innerProperties() { + return this.innerProperties; + } + + /** + * Get the availableRuleSets property: The available rulesets. + * + * @return the availableRuleSets value. + */ + public List availableRuleSets() { + return this.innerProperties() == null ? null : this.innerProperties().availableRuleSets(); + } + + /** + * Set the availableRuleSets property: The available rulesets. + * + * @param availableRuleSets the availableRuleSets value to set. + * @return the ApplicationGatewayWafDynamicManifestResultInner object itself. + */ + public ApplicationGatewayWafDynamicManifestResultInner + withAvailableRuleSets(List availableRuleSets) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayWafDynamicManifestPropertiesResult(); + } + this.innerProperties().withAvailableRuleSets(availableRuleSets); + return this; + } + + /** + * Get the ruleSetType property: The type of the web application firewall rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleSetType(); + } + + /** + * Set the ruleSetType property: The type of the web application firewall rule set. + * + * @param ruleSetType the ruleSetType value to set. + * @return the ApplicationGatewayWafDynamicManifestResultInner object itself. + */ + public ApplicationGatewayWafDynamicManifestResultInner withRuleSetType(String ruleSetType) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayWafDynamicManifestPropertiesResult(); + } + this.innerProperties().withRuleSetType(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.innerProperties() == null ? null : this.innerProperties().ruleSetVersion(); + } + + /** + * Set the ruleSetVersion property: The version of the web application firewall rule set type. + * + * @param ruleSetVersion the ruleSetVersion value to set. + * @return the ApplicationGatewayWafDynamicManifestResultInner object itself. + */ + public ApplicationGatewayWafDynamicManifestResultInner withRuleSetVersion(String ruleSetVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayWafDynamicManifestPropertiesResult(); + } + this.innerProperties().withRuleSetVersion(ruleSetVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayWafDynamicManifestResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayWafDynamicManifestResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayWafDynamicManifestResultInner. + */ + public static ApplicationGatewayWafDynamicManifestResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayWafDynamicManifestResultInner deserializedApplicationGatewayWafDynamicManifestResultInner + = new ApplicationGatewayWafDynamicManifestResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayWafDynamicManifestResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayWafDynamicManifestResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayWafDynamicManifestResultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayWafDynamicManifestResultInner.innerProperties + = ApplicationGatewayWafDynamicManifestPropertiesResult.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayWafDynamicManifestResultInner; + }); + } +} 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..c2d7dd9158bd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.Map; + +/** + * An application security group in a resource group. + */ +@Fluent +public final class ApplicationSecurityGroupInner extends Resource { + /* + * Properties of the application security group. + */ + private ApplicationSecurityGroupPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ApplicationSecurityGroupInner class. + */ + public ApplicationSecurityGroupInner() { + } + + /** + * Get the innerProperties property: Properties of the application security group. + * + * @return the innerProperties value. + */ + private ApplicationSecurityGroupPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 ApplicationSecurityGroupInner object itself. + */ + public ApplicationSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationSecurityGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationSecurityGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the application security group resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationSecurityGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationSecurityGroupInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationSecurityGroupInner. + */ + public static ApplicationSecurityGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationSecurityGroupInner deserializedApplicationSecurityGroupInner + = new ApplicationSecurityGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApplicationSecurityGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationSecurityGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedApplicationSecurityGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicationSecurityGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedApplicationSecurityGroupInner.innerProperties + = ApplicationSecurityGroupPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedApplicationSecurityGroupInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedApplicationSecurityGroupInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationSecurityGroupInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupPropertiesFormat.java new file mode 100644 index 0000000000000..d194a64152207 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ApplicationSecurityGroupPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Application security group properties. + */ +@Immutable +public final class ApplicationSecurityGroupPropertiesFormat + implements JsonSerializable { + /* + * 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. + */ + private String resourceGuid; + + /* + * The provisioning state of the application security group resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ApplicationSecurityGroupPropertiesFormat class. + */ + public ApplicationSecurityGroupPropertiesFormat() { + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationSecurityGroupPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationSecurityGroupPropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationSecurityGroupPropertiesFormat. + */ + public static ApplicationSecurityGroupPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationSecurityGroupPropertiesFormat deserializedApplicationSecurityGroupPropertiesFormat + = new ApplicationSecurityGroupPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceGuid".equals(fieldName)) { + deserializedApplicationSecurityGroupPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedApplicationSecurityGroupPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationSecurityGroupPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AuthorizationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AuthorizationPropertiesFormat.java new file mode 100644 index 0000000000000..389afcb9547e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AuthorizationPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of ExpressRouteCircuitAuthorization. + */ +@Fluent +public final class AuthorizationPropertiesFormat implements JsonSerializable { + /* + * The authorization key. + */ + private String authorizationKey; + + /* + * The authorization use status. + */ + private AuthorizationUseStatus authorizationUseStatus; + + /* + * The reference to the ExpressRoute connection resource using the authorization. + */ + private String connectionResourceUri; + + /* + * The provisioning state of the authorization resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AuthorizationPropertiesFormat class. + */ + public AuthorizationPropertiesFormat() { + } + + /** + * 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 AuthorizationPropertiesFormat object itself. + */ + public AuthorizationPropertiesFormat 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 AuthorizationPropertiesFormat object itself. + */ + public AuthorizationPropertiesFormat withAuthorizationUseStatus(AuthorizationUseStatus authorizationUseStatus) { + this.authorizationUseStatus = authorizationUseStatus; + return this; + } + + /** + * Get the connectionResourceUri property: The reference to the ExpressRoute connection resource using the + * authorization. + * + * @return the connectionResourceUri value. + */ + public String connectionResourceUri() { + return this.connectionResourceUri; + } + + /** + * Get the provisioningState property: The provisioning state of the authorization 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authorizationKey", this.authorizationKey); + jsonWriter.writeStringField("authorizationUseStatus", + this.authorizationUseStatus == null ? null : this.authorizationUseStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthorizationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthorizationPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthorizationPropertiesFormat. + */ + public static AuthorizationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthorizationPropertiesFormat deserializedAuthorizationPropertiesFormat + = new AuthorizationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authorizationKey".equals(fieldName)) { + deserializedAuthorizationPropertiesFormat.authorizationKey = reader.getString(); + } else if ("authorizationUseStatus".equals(fieldName)) { + deserializedAuthorizationPropertiesFormat.authorizationUseStatus + = AuthorizationUseStatus.fromString(reader.getString()); + } else if ("connectionResourceUri".equals(fieldName)) { + deserializedAuthorizationPropertiesFormat.connectionResourceUri = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedAuthorizationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthorizationPropertiesFormat; + }); + } +} 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..edeb70a89df28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AutoApprovedPrivateLinkServiceInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The information of an AutoApprovedPrivateLinkService. + */ +@Fluent +public final class AutoApprovedPrivateLinkServiceInner + implements JsonSerializable { + /* + * The id of the private link service resource. + */ + private String privateLinkService; + + /** + * Creates an instance of AutoApprovedPrivateLinkServiceInner class. + */ + public AutoApprovedPrivateLinkServiceInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateLinkService", this.privateLinkService); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoApprovedPrivateLinkServiceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoApprovedPrivateLinkServiceInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoApprovedPrivateLinkServiceInner. + */ + public static AutoApprovedPrivateLinkServiceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoApprovedPrivateLinkServiceInner deserializedAutoApprovedPrivateLinkServiceInner + = new AutoApprovedPrivateLinkServiceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkService".equals(fieldName)) { + deserializedAutoApprovedPrivateLinkServiceInner.privateLinkService = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoApprovedPrivateLinkServiceInner; + }); + } +} 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..49b328c614c43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableDelegationInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The serviceName of an AvailableDelegation indicates a possible delegation for a subnet. + */ +@Fluent +public final class AvailableDelegationInner implements JsonSerializable { + /* + * The name of the AvailableDelegation resource. + */ + private String name; + + /* + * A unique identifier of the AvailableDelegation resource. + */ + private String id; + + /* + * Resource type. + */ + private String type; + + /* + * The name of the service and resource. + */ + private String serviceName; + + /* + * The actions permitted to the service upon delegation. + */ + private List actions; + + /** + * Creates an instance of AvailableDelegationInner class. + */ + public AvailableDelegationInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("serviceName", this.serviceName); + jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableDelegationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableDelegationInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableDelegationInner. + */ + public static AvailableDelegationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableDelegationInner deserializedAvailableDelegationInner = new AvailableDelegationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAvailableDelegationInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAvailableDelegationInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvailableDelegationInner.type = reader.getString(); + } else if ("serviceName".equals(fieldName)) { + deserializedAvailableDelegationInner.serviceName = reader.getString(); + } else if ("actions".equals(fieldName)) { + List actions = reader.readArray(reader1 -> reader1.getString()); + deserializedAvailableDelegationInner.actions = actions; + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableDelegationInner; + }); + } +} 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..fb1e3a4d26e06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailablePrivateEndpointTypeInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The information of an AvailablePrivateEndpointType. + */ +@Fluent +public final class AvailablePrivateEndpointTypeInner implements JsonSerializable { + /* + * The name of the service and resource. + */ + private String name; + + /* + * A unique identifier of the AvailablePrivateEndpoint Type resource. + */ + private String id; + + /* + * Resource type. + */ + private String type; + + /* + * The name of the service and resource. + */ + private String resourceName; + + /* + * Display name of the resource. + */ + private String displayName; + + /** + * Creates an instance of AvailablePrivateEndpointTypeInner class. + */ + public AvailablePrivateEndpointTypeInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailablePrivateEndpointTypeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailablePrivateEndpointTypeInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailablePrivateEndpointTypeInner. + */ + public static AvailablePrivateEndpointTypeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailablePrivateEndpointTypeInner deserializedAvailablePrivateEndpointTypeInner + = new AvailablePrivateEndpointTypeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAvailablePrivateEndpointTypeInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAvailablePrivateEndpointTypeInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvailablePrivateEndpointTypeInner.type = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedAvailablePrivateEndpointTypeInner.resourceName = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAvailablePrivateEndpointTypeInner.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailablePrivateEndpointTypeInner; + }); + } +} 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..82693dca6b47d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableProvidersListInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListCountry; +import java.io.IOException; +import java.util.List; + +/** + * List of available countries with details. + */ +@Fluent +public final class AvailableProvidersListInner implements JsonSerializable { + /* + * List of available countries. + */ + private List countries; + + /** + * Creates an instance of AvailableProvidersListInner class. + */ + public AvailableProvidersListInner() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property countries in model AvailableProvidersListInner")); + } else { + countries().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AvailableProvidersListInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("countries", this.countries, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableProvidersListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableProvidersListInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AvailableProvidersListInner. + */ + public static AvailableProvidersListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableProvidersListInner deserializedAvailableProvidersListInner = new AvailableProvidersListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("countries".equals(fieldName)) { + List countries + = reader.readArray(reader1 -> AvailableProvidersListCountry.fromJson(reader1)); + deserializedAvailableProvidersListInner.countries = countries; + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableProvidersListInner; + }); + } +} 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..9d1d491908fd7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AvailableServiceAliasInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The available service alias. + */ +@Fluent +public final class AvailableServiceAliasInner implements JsonSerializable { + /* + * The name of the service alias. + */ + private String name; + + /* + * The ID of the service alias. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The resource name of the service alias. + */ + private String resourceName; + + /** + * Creates an instance of AvailableServiceAliasInner class. + */ + public AvailableServiceAliasInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("resourceName", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableServiceAliasInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableServiceAliasInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableServiceAliasInner. + */ + public static AvailableServiceAliasInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableServiceAliasInner deserializedAvailableServiceAliasInner = new AvailableServiceAliasInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAvailableServiceAliasInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAvailableServiceAliasInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAvailableServiceAliasInner.type = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedAvailableServiceAliasInner.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableServiceAliasInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.java new file mode 100644 index 0000000000000..49332a99a1d35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallApplicationRuleCollectionPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCAction; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the application rule collection. + */ +@Fluent +public final class AzureFirewallApplicationRuleCollectionPropertiesFormat + implements JsonSerializable { + /* + * Priority of the application rule collection resource. + */ + private Integer priority; + + /* + * The action type of a rule collection. + */ + private AzureFirewallRCAction action; + + /* + * Collection of rules used by a application rule collection. + */ + private List rules; + + /* + * The provisioning state of the application rule collection resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AzureFirewallApplicationRuleCollectionPropertiesFormat class. + */ + public AzureFirewallApplicationRuleCollectionPropertiesFormat() { + } + + /** + * 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 AzureFirewallApplicationRuleCollectionPropertiesFormat object itself. + */ + public AzureFirewallApplicationRuleCollectionPropertiesFormat 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 AzureFirewallApplicationRuleCollectionPropertiesFormat object itself. + */ + public AzureFirewallApplicationRuleCollectionPropertiesFormat 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 AzureFirewallApplicationRuleCollectionPropertiesFormat object itself. + */ + public AzureFirewallApplicationRuleCollectionPropertiesFormat 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeJsonField("action", this.action); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallApplicationRuleCollectionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallApplicationRuleCollectionPropertiesFormat if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallApplicationRuleCollectionPropertiesFormat. + */ + public static AzureFirewallApplicationRuleCollectionPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallApplicationRuleCollectionPropertiesFormat deserializedAzureFirewallApplicationRuleCollectionPropertiesFormat + = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleCollectionPropertiesFormat.priority + = reader.getNullable(JsonReader::getInt); + } else if ("action".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleCollectionPropertiesFormat.action + = AzureFirewallRCAction.fromJson(reader); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> AzureFirewallApplicationRule.fromJson(reader1)); + deserializedAzureFirewallApplicationRuleCollectionPropertiesFormat.rules = rules; + } else if ("provisioningState".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleCollectionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallApplicationRuleCollectionPropertiesFormat; + }); + } +} 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..e2480d7b17969 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagInner.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.Map; + +/** + * Azure Firewall FQDN Tag Resource. + */ +@Fluent +public final class AzureFirewallFqdnTagInner extends Resource { + /* + * Properties of the azure firewall FQDN tag. + */ + private AzureFirewallFqdnTagPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of AzureFirewallFqdnTagInner class. + */ + public AzureFirewallFqdnTagInner() { + } + + /** + * Get the innerProperties property: Properties of the azure firewall FQDN tag. + * + * @return the innerProperties value. + */ + private AzureFirewallFqdnTagPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 AzureFirewallFqdnTagInner object itself. + */ + public AzureFirewallFqdnTagInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallFqdnTagInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallFqdnTagInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Azure firewall FQDN tag resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the fqdnTagName property: The name of this FQDN Tag. + * + * @return the fqdnTagName value. + */ + public String fqdnTagName() { + return this.innerProperties() == null ? null : this.innerProperties().fqdnTagName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallFqdnTagInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallFqdnTagInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureFirewallFqdnTagInner. + */ + public static AzureFirewallFqdnTagInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallFqdnTagInner deserializedAzureFirewallFqdnTagInner = new AzureFirewallFqdnTagInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureFirewallFqdnTagInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureFirewallFqdnTagInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAzureFirewallFqdnTagInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureFirewallFqdnTagInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAzureFirewallFqdnTagInner.innerProperties + = AzureFirewallFqdnTagPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedAzureFirewallFqdnTagInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAzureFirewallFqdnTagInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallFqdnTagInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagPropertiesFormat.java new file mode 100644 index 0000000000000..3fbb1145c1b62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallFqdnTagPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Azure Firewall FQDN Tag Properties. + */ +@Immutable +public final class AzureFirewallFqdnTagPropertiesFormat + implements JsonSerializable { + /* + * The provisioning state of the Azure firewall FQDN tag resource. + */ + private ProvisioningState provisioningState; + + /* + * The name of this FQDN Tag. + */ + private String fqdnTagName; + + /** + * Creates an instance of AzureFirewallFqdnTagPropertiesFormat class. + */ + public AzureFirewallFqdnTagPropertiesFormat() { + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallFqdnTagPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallFqdnTagPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallFqdnTagPropertiesFormat. + */ + public static AzureFirewallFqdnTagPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallFqdnTagPropertiesFormat deserializedAzureFirewallFqdnTagPropertiesFormat + = new AzureFirewallFqdnTagPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedAzureFirewallFqdnTagPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("fqdnTagName".equals(fieldName)) { + deserializedAzureFirewallFqdnTagPropertiesFormat.fqdnTagName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallFqdnTagPropertiesFormat; + }); + } +} 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..97aaa5a879769 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallInner.java @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallAutoscaleConfiguration; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Azure Firewall resource. + */ +@Fluent +public final class AzureFirewallInner extends Resource { + /* + * Properties of the azure firewall. + */ + private AzureFirewallPropertiesFormat innerProperties; + + /* + * A list of availability zones denoting where the resource needs to come from. + */ + private List zones; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of AzureFirewallInner class. + */ + public AzureFirewallInner() { + } + + /** + * Get the innerProperties property: Properties of the azure firewall. + * + * @return the innerProperties value. + */ + private AzureFirewallPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the applicationRuleCollections property: Collection of application rule collections used by Azure Firewall. + * + * @return the applicationRuleCollections value. + */ + public List applicationRuleCollections() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withApplicationRuleCollections(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withNatRuleCollections(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withNetworkRuleCollections(networkRuleCollections); + return this; + } + + /** + * Get the ipConfigurations property: IP configuration of the Azure Firewall resource. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withManagementIpConfiguration(managementIpConfiguration); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Azure firewall resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @return the threatIntelMode value. + */ + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withThreatIntelMode(threatIntelMode); + return this; + } + + /** + * Get the virtualHub property: The virtualHub to which the firewall belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withVirtualHub(virtualHub); + return this; + } + + /** + * Get the firewallPolicy property: The firewallPolicy associated with this azure firewall. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withFirewallPolicy(firewallPolicy); + return this; + } + + /** + * Get the hubIpAddresses property: IP addresses associated with AzureFirewall. + * + * @return the hubIpAddresses value. + */ + public HubIpAddresses hubIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withHubIpAddresses(hubIpAddresses); + return this; + } + + /** + * Get the ipGroups property: IpGroups associated with AzureFirewall. + * + * @return the ipGroups value. + */ + public List ipGroups() { + return this.innerProperties() == null ? null : this.innerProperties().ipGroups(); + } + + /** + * Get the sku property: The Azure Firewall Resource SKU. + * + * @return the sku value. + */ + public AzureFirewallSku sku() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withSku(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withAdditionalProperties(additionalProperties); + return this; + } + + /** + * Get the autoscaleConfiguration property: Properties to provide a custom autoscale configuration to this azure + * firewall. + * + * @return the autoscaleConfiguration value. + */ + public AzureFirewallAutoscaleConfiguration autoscaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().autoscaleConfiguration(); + } + + /** + * Set the autoscaleConfiguration property: Properties to provide a custom autoscale configuration to this azure + * firewall. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set. + * @return the AzureFirewallInner object itself. + */ + public AzureFirewallInner withAutoscaleConfiguration(AzureFirewallAutoscaleConfiguration autoscaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallPropertiesFormat(); + } + this.innerProperties().withAutoscaleConfiguration(autoscaleConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureFirewallInner. + */ + public static AzureFirewallInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallInner deserializedAzureFirewallInner = new AzureFirewallInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureFirewallInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureFirewallInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAzureFirewallInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureFirewallInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAzureFirewallInner.innerProperties = AzureFirewallPropertiesFormat.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallInner.zones = zones; + } else if ("etag".equals(fieldName)) { + deserializedAzureFirewallInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAzureFirewallInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..194ac2ffac0cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallIpConfigurationPropertiesFormat.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of IP configuration of an Azure Firewall. + */ +@Fluent +public final class AzureFirewallIpConfigurationPropertiesFormat + implements JsonSerializable { + /* + * The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. + */ + private String privateIpAddress; + + /* + * Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or + * 'AzureFirewallManagementSubnet'. + */ + private SubResource subnet; + + /* + * Reference to the PublicIP resource. This field is a mandatory input if subnet is not null. + */ + private SubResource publicIpAddress; + + /* + * The provisioning state of the Azure firewall IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AzureFirewallIpConfigurationPropertiesFormat class. + */ + public AzureFirewallIpConfigurationPropertiesFormat() { + } + + /** + * 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 AzureFirewallIpConfigurationPropertiesFormat object itself. + */ + public AzureFirewallIpConfigurationPropertiesFormat 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 AzureFirewallIpConfigurationPropertiesFormat object itself. + */ + public AzureFirewallIpConfigurationPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallIpConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallIpConfigurationPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallIpConfigurationPropertiesFormat. + */ + public static AzureFirewallIpConfigurationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallIpConfigurationPropertiesFormat deserializedAzureFirewallIpConfigurationPropertiesFormat + = new AzureFirewallIpConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAddress".equals(fieldName)) { + deserializedAzureFirewallIpConfigurationPropertiesFormat.privateIpAddress = reader.getString(); + } else if ("subnet".equals(fieldName)) { + deserializedAzureFirewallIpConfigurationPropertiesFormat.subnet = SubResource.fromJson(reader); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedAzureFirewallIpConfigurationPropertiesFormat.publicIpAddress + = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedAzureFirewallIpConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallIpConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNatRuleCollectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNatRuleCollectionProperties.java new file mode 100644 index 0000000000000..0f8f4ab05677a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNatRuleCollectionProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRCAction; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRule; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the NAT rule collection. + */ +@Fluent +public final class AzureFirewallNatRuleCollectionProperties + implements JsonSerializable { + /* + * Priority of the NAT rule collection resource. + */ + private Integer priority; + + /* + * The action type of a NAT rule collection. + */ + private AzureFirewallNatRCAction action; + + /* + * Collection of rules used by a NAT rule collection. + */ + private List rules; + + /* + * The provisioning state of the NAT rule collection resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AzureFirewallNatRuleCollectionProperties class. + */ + public AzureFirewallNatRuleCollectionProperties() { + } + + /** + * 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 AzureFirewallNatRuleCollectionProperties object itself. + */ + public AzureFirewallNatRuleCollectionProperties 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 AzureFirewallNatRuleCollectionProperties object itself. + */ + public AzureFirewallNatRuleCollectionProperties 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 AzureFirewallNatRuleCollectionProperties object itself. + */ + public AzureFirewallNatRuleCollectionProperties 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeJsonField("action", this.action); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallNatRuleCollectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallNatRuleCollectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallNatRuleCollectionProperties. + */ + public static AzureFirewallNatRuleCollectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallNatRuleCollectionProperties deserializedAzureFirewallNatRuleCollectionProperties + = new AzureFirewallNatRuleCollectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedAzureFirewallNatRuleCollectionProperties.priority + = reader.getNullable(JsonReader::getInt); + } else if ("action".equals(fieldName)) { + deserializedAzureFirewallNatRuleCollectionProperties.action + = AzureFirewallNatRCAction.fromJson(reader); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> AzureFirewallNatRule.fromJson(reader1)); + deserializedAzureFirewallNatRuleCollectionProperties.rules = rules; + } else if ("provisioningState".equals(fieldName)) { + deserializedAzureFirewallNatRuleCollectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallNatRuleCollectionProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.java new file mode 100644 index 0000000000000..f8f0b092379b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallNetworkRuleCollectionPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCAction; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the network rule collection. + */ +@Fluent +public final class AzureFirewallNetworkRuleCollectionPropertiesFormat + implements JsonSerializable { + /* + * Priority of the network rule collection resource. + */ + private Integer priority; + + /* + * The action type of a rule collection. + */ + private AzureFirewallRCAction action; + + /* + * Collection of rules used by a network rule collection. + */ + private List rules; + + /* + * The provisioning state of the network rule collection resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AzureFirewallNetworkRuleCollectionPropertiesFormat class. + */ + public AzureFirewallNetworkRuleCollectionPropertiesFormat() { + } + + /** + * 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 AzureFirewallNetworkRuleCollectionPropertiesFormat object itself. + */ + public AzureFirewallNetworkRuleCollectionPropertiesFormat 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 AzureFirewallNetworkRuleCollectionPropertiesFormat object itself. + */ + public AzureFirewallNetworkRuleCollectionPropertiesFormat 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 AzureFirewallNetworkRuleCollectionPropertiesFormat object itself. + */ + public AzureFirewallNetworkRuleCollectionPropertiesFormat 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeJsonField("action", this.action); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallNetworkRuleCollectionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallNetworkRuleCollectionPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallNetworkRuleCollectionPropertiesFormat. + */ + public static AzureFirewallNetworkRuleCollectionPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallNetworkRuleCollectionPropertiesFormat deserializedAzureFirewallNetworkRuleCollectionPropertiesFormat + = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedAzureFirewallNetworkRuleCollectionPropertiesFormat.priority + = reader.getNullable(JsonReader::getInt); + } else if ("action".equals(fieldName)) { + deserializedAzureFirewallNetworkRuleCollectionPropertiesFormat.action + = AzureFirewallRCAction.fromJson(reader); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> AzureFirewallNetworkRule.fromJson(reader1)); + deserializedAzureFirewallNetworkRuleCollectionPropertiesFormat.rules = rules; + } else if ("provisioningState".equals(fieldName)) { + deserializedAzureFirewallNetworkRuleCollectionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallNetworkRuleCollectionPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallPropertiesFormat.java new file mode 100644 index 0000000000000..7195a6d76d324 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureFirewallPropertiesFormat.java @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallAutoscaleConfiguration; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Properties of the Azure Firewall. + */ +@Fluent +public final class AzureFirewallPropertiesFormat implements JsonSerializable { + /* + * Collection of application rule collections used by Azure Firewall. + */ + private List applicationRuleCollections; + + /* + * Collection of NAT rule collections used by Azure Firewall. + */ + private List natRuleCollections; + + /* + * Collection of network rule collections used by Azure Firewall. + */ + private List networkRuleCollections; + + /* + * IP configuration of the Azure Firewall resource. + */ + private List ipConfigurations; + + /* + * IP configuration of the Azure Firewall used for management traffic. + */ + private AzureFirewallIpConfiguration managementIpConfiguration; + + /* + * The provisioning state of the Azure firewall resource. + */ + private ProvisioningState provisioningState; + + /* + * The operation mode for Threat Intelligence. + */ + private AzureFirewallThreatIntelMode threatIntelMode; + + /* + * The virtualHub to which the firewall belongs. + */ + private SubResource virtualHub; + + /* + * The firewallPolicy associated with this azure firewall. + */ + private SubResource firewallPolicy; + + /* + * IP addresses associated with AzureFirewall. + */ + private HubIpAddresses hubIpAddresses; + + /* + * IpGroups associated with AzureFirewall. + */ + private List ipGroups; + + /* + * The Azure Firewall Resource SKU. + */ + private AzureFirewallSku sku; + + /* + * The additional properties used to further config this azure firewall. + */ + private Map additionalProperties; + + /* + * Properties to provide a custom autoscale configuration to this azure firewall. + */ + private AzureFirewallAutoscaleConfiguration autoscaleConfiguration; + + /** + * Creates an instance of AzureFirewallPropertiesFormat class. + */ + public AzureFirewallPropertiesFormat() { + } + + /** + * 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat + 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat + 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat + 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat + 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat 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 AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Get the autoscaleConfiguration property: Properties to provide a custom autoscale configuration to this azure + * firewall. + * + * @return the autoscaleConfiguration value. + */ + public AzureFirewallAutoscaleConfiguration autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set the autoscaleConfiguration property: Properties to provide a custom autoscale configuration to this azure + * firewall. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set. + * @return the AzureFirewallPropertiesFormat object itself. + */ + public AzureFirewallPropertiesFormat + withAutoscaleConfiguration(AzureFirewallAutoscaleConfiguration autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + 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(); + } + if (autoscaleConfiguration() != null) { + autoscaleConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("applicationRuleCollections", this.applicationRuleCollections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("natRuleCollections", this.natRuleCollections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("networkRuleCollections", this.networkRuleCollections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("managementIpConfiguration", this.managementIpConfiguration); + jsonWriter.writeStringField("threatIntelMode", + this.threatIntelMode == null ? null : this.threatIntelMode.toString()); + jsonWriter.writeJsonField("virtualHub", this.virtualHub); + jsonWriter.writeJsonField("firewallPolicy", this.firewallPolicy); + jsonWriter.writeJsonField("hubIPAddresses", this.hubIpAddresses); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("additionalProperties", this.additionalProperties, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("autoscaleConfiguration", this.autoscaleConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallPropertiesFormat. + */ + public static AzureFirewallPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallPropertiesFormat deserializedAzureFirewallPropertiesFormat + = new AzureFirewallPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationRuleCollections".equals(fieldName)) { + List applicationRuleCollections + = reader.readArray(reader1 -> AzureFirewallApplicationRuleCollection.fromJson(reader1)); + deserializedAzureFirewallPropertiesFormat.applicationRuleCollections = applicationRuleCollections; + } else if ("natRuleCollections".equals(fieldName)) { + List natRuleCollections + = reader.readArray(reader1 -> AzureFirewallNatRuleCollection.fromJson(reader1)); + deserializedAzureFirewallPropertiesFormat.natRuleCollections = natRuleCollections; + } else if ("networkRuleCollections".equals(fieldName)) { + List networkRuleCollections + = reader.readArray(reader1 -> AzureFirewallNetworkRuleCollection.fromJson(reader1)); + deserializedAzureFirewallPropertiesFormat.networkRuleCollections = networkRuleCollections; + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> AzureFirewallIpConfiguration.fromJson(reader1)); + deserializedAzureFirewallPropertiesFormat.ipConfigurations = ipConfigurations; + } else if ("managementIpConfiguration".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.managementIpConfiguration + = AzureFirewallIpConfiguration.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("threatIntelMode".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.threatIntelMode + = AzureFirewallThreatIntelMode.fromString(reader.getString()); + } else if ("virtualHub".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.virtualHub = SubResource.fromJson(reader); + } else if ("firewallPolicy".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.firewallPolicy = SubResource.fromJson(reader); + } else if ("hubIPAddresses".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.hubIpAddresses = HubIpAddresses.fromJson(reader); + } else if ("ipGroups".equals(fieldName)) { + List ipGroups + = reader.readArray(reader1 -> AzureFirewallIpGroups.fromJson(reader1)); + deserializedAzureFirewallPropertiesFormat.ipGroups = ipGroups; + } else if ("sku".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.sku = AzureFirewallSku.fromJson(reader); + } else if ("additionalProperties".equals(fieldName)) { + Map additionalProperties = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureFirewallPropertiesFormat.additionalProperties = additionalProperties; + } else if ("autoscaleConfiguration".equals(fieldName)) { + deserializedAzureFirewallPropertiesFormat.autoscaleConfiguration + = AzureFirewallAutoscaleConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallPropertiesFormat; + }); + } +} 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..6882c3da681d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureReachabilityReportInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportItem; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import java.io.IOException; +import java.util.List; + +/** + * Azure reachability report details. + */ +@Fluent +public final class AzureReachabilityReportInner implements JsonSerializable { + /* + * The aggregation level of Azure reachability report. Can be Country, State or City. + */ + private String aggregationLevel; + + /* + * Parameters that define a geographic location. + */ + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Azure reachability report items. + */ + private List reachabilityReport; + + /** + * Creates an instance of AzureReachabilityReportInner class. + */ + public AzureReachabilityReportInner() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property aggregationLevel in model AzureReachabilityReportInner")); + } + if (providerLocation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportInner")); + } else { + providerLocation().validate(); + } + if (reachabilityReport() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property reachabilityReport in model AzureReachabilityReportInner")); + } else { + reachabilityReport().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureReachabilityReportInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("aggregationLevel", this.aggregationLevel); + jsonWriter.writeJsonField("providerLocation", this.providerLocation); + jsonWriter.writeArrayField("reachabilityReport", this.reachabilityReport, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureReachabilityReportInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureReachabilityReportInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureReachabilityReportInner. + */ + public static AzureReachabilityReportInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureReachabilityReportInner deserializedAzureReachabilityReportInner = new AzureReachabilityReportInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aggregationLevel".equals(fieldName)) { + deserializedAzureReachabilityReportInner.aggregationLevel = reader.getString(); + } else if ("providerLocation".equals(fieldName)) { + deserializedAzureReachabilityReportInner.providerLocation + = AzureReachabilityReportLocation.fromJson(reader); + } else if ("reachabilityReport".equals(fieldName)) { + List reachabilityReport + = reader.readArray(reader1 -> AzureReachabilityReportItem.fromJson(reader1)); + deserializedAzureReachabilityReportInner.reachabilityReport = reachabilityReport; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureReachabilityReportInner; + }); + } +} 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..0a0846895a5d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Web Category Resource. + */ +@Fluent +public final class AzureWebCategoryInner implements JsonSerializable { + /* + * Properties of the Azure Web Category. + */ + private AzureWebCategoryPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * Resource name. + */ + private String name; + + /* + * Resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of AzureWebCategoryInner class. + */ + public AzureWebCategoryInner() { + } + + /** + * Get the innerProperties property: Properties of the Azure Web Category. + * + * @return the innerProperties value. + */ + private AzureWebCategoryPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().group(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWebCategoryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWebCategoryInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureWebCategoryInner. + */ + public static AzureWebCategoryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWebCategoryInner deserializedAzureWebCategoryInner = new AzureWebCategoryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAzureWebCategoryInner.innerProperties + = AzureWebCategoryPropertiesFormat.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedAzureWebCategoryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAzureWebCategoryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureWebCategoryInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAzureWebCategoryInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWebCategoryInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryPropertiesFormat.java new file mode 100644 index 0000000000000..ad30f22d1e450 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/AzureWebCategoryPropertiesFormat.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Web Category Properties. + */ +@Immutable +public final class AzureWebCategoryPropertiesFormat implements JsonSerializable { + /* + * The name of the group that the category belongs to. + */ + private String group; + + /** + * Creates an instance of AzureWebCategoryPropertiesFormat class. + */ + public AzureWebCategoryPropertiesFormat() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWebCategoryPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWebCategoryPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureWebCategoryPropertiesFormat. + */ + public static AzureWebCategoryPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWebCategoryPropertiesFormat deserializedAzureWebCategoryPropertiesFormat + = new AzureWebCategoryPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("group".equals(fieldName)) { + deserializedAzureWebCategoryPropertiesFormat.group = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWebCategoryPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressInboundNatRulePortMappingsInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressInboundNatRulePortMappingsInner.java new file mode 100644 index 0000000000000..97fec7dc6eb99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressInboundNatRulePortMappingsInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.InboundNatRulePortMapping; +import java.io.IOException; +import java.util.List; + +/** + * The response for a QueryInboundNatRulePortMapping API. + */ +@Fluent +public final class BackendAddressInboundNatRulePortMappingsInner + implements JsonSerializable { + /* + * Collection of inbound NAT rule port mappings. + */ + private List inboundNatRulePortMappings; + + /** + * Creates an instance of BackendAddressInboundNatRulePortMappingsInner class. + */ + public BackendAddressInboundNatRulePortMappingsInner() { + } + + /** + * Get the inboundNatRulePortMappings property: Collection of inbound NAT rule port mappings. + * + * @return the inboundNatRulePortMappings value. + */ + public List inboundNatRulePortMappings() { + return this.inboundNatRulePortMappings; + } + + /** + * Set the inboundNatRulePortMappings property: Collection of inbound NAT rule port mappings. + * + * @param inboundNatRulePortMappings the inboundNatRulePortMappings value to set. + * @return the BackendAddressInboundNatRulePortMappingsInner object itself. + */ + public BackendAddressInboundNatRulePortMappingsInner + withInboundNatRulePortMappings(List inboundNatRulePortMappings) { + this.inboundNatRulePortMappings = inboundNatRulePortMappings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inboundNatRulePortMappings() != null) { + inboundNatRulePortMappings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("inboundNatRulePortMappings", this.inboundNatRulePortMappings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackendAddressInboundNatRulePortMappingsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackendAddressInboundNatRulePortMappingsInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BackendAddressInboundNatRulePortMappingsInner. + */ + public static BackendAddressInboundNatRulePortMappingsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackendAddressInboundNatRulePortMappingsInner deserializedBackendAddressInboundNatRulePortMappingsInner + = new BackendAddressInboundNatRulePortMappingsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inboundNatRulePortMappings".equals(fieldName)) { + List inboundNatRulePortMappings + = reader.readArray(reader1 -> InboundNatRulePortMapping.fromJson(reader1)); + deserializedBackendAddressInboundNatRulePortMappingsInner.inboundNatRulePortMappings + = inboundNatRulePortMappings; + } else { + reader.skipChildren(); + } + } + + return deserializedBackendAddressInboundNatRulePortMappingsInner; + }); + } +} 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..cf27f8b65da7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolInner.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.azure.resourcemanager.network.generated.models.SyncMode; +import java.io.IOException; +import java.util.List; + +/** + * Pool of backend IP addresses. + */ +@Fluent +public final class BackendAddressPoolInner extends SubResource { + /* + * Properties of load balancer backend address pool. + */ + private BackendAddressPoolPropertiesFormat innerProperties; + + /* + * 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. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of BackendAddressPoolInner class. + */ + public BackendAddressPoolInner() { + } + + /** + * Get the innerProperties property: Properties of load balancer backend address pool. + * + * @return the innerProperties value. + */ + private BackendAddressPoolPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public BackendAddressPoolInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the location property: The location of the backend address pool. + * + * @return the location value. + */ + public String location() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BackendAddressPoolPropertiesFormat(); + } + this.innerProperties().withLocation(location); + return this; + } + + /** + * Get the tunnelInterfaces property: An array of gateway load balancer tunnel interfaces. + * + * @return the tunnelInterfaces value. + */ + public List tunnelInterfaces() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BackendAddressPoolPropertiesFormat(); + } + this.innerProperties().withTunnelInterfaces(tunnelInterfaces); + return this; + } + + /** + * Get the loadBalancerBackendAddresses property: An array of backend addresses. + * + * @return the loadBalancerBackendAddresses value. + */ + public List loadBalancerBackendAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BackendAddressPoolPropertiesFormat(); + } + this.innerProperties().withLoadBalancerBackendAddresses(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().outboundRules(); + } + + /** + * Get the inboundNatRules property: An array of references to inbound NAT rules that use this backend address pool. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().inboundNatRules(); + } + + /** + * Get the provisioningState property: The provisioning state of the backend address pool resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the drainPeriodInSeconds property: Amount of seconds Load Balancer waits for before sending RESET to client + * and backend address. + * + * @return the drainPeriodInSeconds value. + */ + public Integer drainPeriodInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().drainPeriodInSeconds(); + } + + /** + * Set the drainPeriodInSeconds property: Amount of seconds Load Balancer waits for before sending RESET to client + * and backend address. + * + * @param drainPeriodInSeconds the drainPeriodInSeconds value to set. + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withDrainPeriodInSeconds(Integer drainPeriodInSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new BackendAddressPoolPropertiesFormat(); + } + this.innerProperties().withDrainPeriodInSeconds(drainPeriodInSeconds); + return this; + } + + /** + * Get the virtualNetwork property: A reference to a virtual network. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetwork(); + } + + /** + * Set the virtualNetwork property: A reference to a virtual network. + * + * @param virtualNetwork the virtualNetwork value to set. + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withVirtualNetwork(SubResource virtualNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new BackendAddressPoolPropertiesFormat(); + } + this.innerProperties().withVirtualNetwork(virtualNetwork); + return this; + } + + /** + * Get the syncMode property: Backend address synchronous mode for the backend pool. + * + * @return the syncMode value. + */ + public SyncMode syncMode() { + return this.innerProperties() == null ? null : this.innerProperties().syncMode(); + } + + /** + * Set the syncMode property: Backend address synchronous mode for the backend pool. + * + * @param syncMode the syncMode value to set. + * @return the BackendAddressPoolInner object itself. + */ + public BackendAddressPoolInner withSyncMode(SyncMode syncMode) { + if (this.innerProperties() == null) { + this.innerProperties = new BackendAddressPoolPropertiesFormat(); + } + this.innerProperties().withSyncMode(syncMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackendAddressPoolInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackendAddressPoolInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BackendAddressPoolInner. + */ + public static BackendAddressPoolInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackendAddressPoolInner deserializedBackendAddressPoolInner = new BackendAddressPoolInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBackendAddressPoolInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedBackendAddressPoolInner.innerProperties + = BackendAddressPoolPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedBackendAddressPoolInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedBackendAddressPoolInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBackendAddressPoolInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBackendAddressPoolInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolPropertiesFormat.java new file mode 100644 index 0000000000000..e3b582e0df315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BackendAddressPoolPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.azure.resourcemanager.network.generated.models.SyncMode; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the backend address pool. + */ +@Fluent +public final class BackendAddressPoolPropertiesFormat implements JsonSerializable { + /* + * The location of the backend address pool. + */ + private String location; + + /* + * An array of gateway load balancer tunnel interfaces. + */ + private List tunnelInterfaces; + + /* + * An array of backend addresses. + */ + private List loadBalancerBackendAddresses; + + /* + * An array of references to IP addresses defined in network interfaces. + */ + private List backendIpConfigurations; + + /* + * An array of references to load balancing rules that use this backend address pool. + */ + private List loadBalancingRules; + + /* + * A reference to an outbound rule that uses this backend address pool. + */ + private SubResource outboundRule; + + /* + * An array of references to outbound rules that use this backend address pool. + */ + private List outboundRules; + + /* + * An array of references to inbound NAT rules that use this backend address pool. + */ + private List inboundNatRules; + + /* + * The provisioning state of the backend address pool resource. + */ + private ProvisioningState provisioningState; + + /* + * Amount of seconds Load Balancer waits for before sending RESET to client and backend address. + */ + private Integer drainPeriodInSeconds; + + /* + * A reference to a virtual network. + */ + private SubResource virtualNetwork; + + /* + * Backend address synchronous mode for the backend pool + */ + private SyncMode syncMode; + + /** + * Creates an instance of BackendAddressPoolPropertiesFormat class. + */ + public BackendAddressPoolPropertiesFormat() { + } + + /** + * 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 BackendAddressPoolPropertiesFormat object itself. + */ + public BackendAddressPoolPropertiesFormat 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 BackendAddressPoolPropertiesFormat object itself. + */ + public BackendAddressPoolPropertiesFormat + 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 BackendAddressPoolPropertiesFormat object itself. + */ + public BackendAddressPoolPropertiesFormat + 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 inboundNatRules property: An array of references to inbound NAT rules that use this backend address pool. + * + * @return the inboundNatRules value. + */ + public List inboundNatRules() { + return this.inboundNatRules; + } + + /** + * Get the provisioningState property: The provisioning state of the backend address pool resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the drainPeriodInSeconds property: Amount of seconds Load Balancer waits for before sending RESET to client + * and backend address. + * + * @return the drainPeriodInSeconds value. + */ + public Integer drainPeriodInSeconds() { + return this.drainPeriodInSeconds; + } + + /** + * Set the drainPeriodInSeconds property: Amount of seconds Load Balancer waits for before sending RESET to client + * and backend address. + * + * @param drainPeriodInSeconds the drainPeriodInSeconds value to set. + * @return the BackendAddressPoolPropertiesFormat object itself. + */ + public BackendAddressPoolPropertiesFormat withDrainPeriodInSeconds(Integer drainPeriodInSeconds) { + this.drainPeriodInSeconds = drainPeriodInSeconds; + return this; + } + + /** + * Get the virtualNetwork property: A reference to a virtual network. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.virtualNetwork; + } + + /** + * Set the virtualNetwork property: A reference to a virtual network. + * + * @param virtualNetwork the virtualNetwork value to set. + * @return the BackendAddressPoolPropertiesFormat object itself. + */ + public BackendAddressPoolPropertiesFormat withVirtualNetwork(SubResource virtualNetwork) { + this.virtualNetwork = virtualNetwork; + return this; + } + + /** + * Get the syncMode property: Backend address synchronous mode for the backend pool. + * + * @return the syncMode value. + */ + public SyncMode syncMode() { + return this.syncMode; + } + + /** + * Set the syncMode property: Backend address synchronous mode for the backend pool. + * + * @param syncMode the syncMode value to set. + * @return the BackendAddressPoolPropertiesFormat object itself. + */ + public BackendAddressPoolPropertiesFormat withSyncMode(SyncMode syncMode) { + this.syncMode = syncMode; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeArrayField("tunnelInterfaces", this.tunnelInterfaces, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("loadBalancerBackendAddresses", this.loadBalancerBackendAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("drainPeriodInSeconds", this.drainPeriodInSeconds); + jsonWriter.writeJsonField("virtualNetwork", this.virtualNetwork); + jsonWriter.writeStringField("syncMode", this.syncMode == null ? null : this.syncMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackendAddressPoolPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackendAddressPoolPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BackendAddressPoolPropertiesFormat. + */ + public static BackendAddressPoolPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackendAddressPoolPropertiesFormat deserializedBackendAddressPoolPropertiesFormat + = new BackendAddressPoolPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedBackendAddressPoolPropertiesFormat.location = reader.getString(); + } else if ("tunnelInterfaces".equals(fieldName)) { + List tunnelInterfaces + = reader.readArray(reader1 -> GatewayLoadBalancerTunnelInterface.fromJson(reader1)); + deserializedBackendAddressPoolPropertiesFormat.tunnelInterfaces = tunnelInterfaces; + } else if ("loadBalancerBackendAddresses".equals(fieldName)) { + List loadBalancerBackendAddresses + = reader.readArray(reader1 -> LoadBalancerBackendAddress.fromJson(reader1)); + deserializedBackendAddressPoolPropertiesFormat.loadBalancerBackendAddresses + = loadBalancerBackendAddresses; + } else if ("backendIPConfigurations".equals(fieldName)) { + List backendIpConfigurations + = reader.readArray(reader1 -> NetworkInterfaceIpConfigurationInner.fromJson(reader1)); + deserializedBackendAddressPoolPropertiesFormat.backendIpConfigurations = backendIpConfigurations; + } else if ("loadBalancingRules".equals(fieldName)) { + List loadBalancingRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedBackendAddressPoolPropertiesFormat.loadBalancingRules = loadBalancingRules; + } else if ("outboundRule".equals(fieldName)) { + deserializedBackendAddressPoolPropertiesFormat.outboundRule = SubResource.fromJson(reader); + } else if ("outboundRules".equals(fieldName)) { + List outboundRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedBackendAddressPoolPropertiesFormat.outboundRules = outboundRules; + } else if ("inboundNatRules".equals(fieldName)) { + List inboundNatRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedBackendAddressPoolPropertiesFormat.inboundNatRules = inboundNatRules; + } else if ("provisioningState".equals(fieldName)) { + deserializedBackendAddressPoolPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("drainPeriodInSeconds".equals(fieldName)) { + deserializedBackendAddressPoolPropertiesFormat.drainPeriodInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("virtualNetwork".equals(fieldName)) { + deserializedBackendAddressPoolPropertiesFormat.virtualNetwork = SubResource.fromJson(reader); + } else if ("syncMode".equals(fieldName)) { + deserializedBackendAddressPoolPropertiesFormat.syncMode = SyncMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBackendAddressPoolPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BaseAdminRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BaseAdminRuleInner.java new file mode 100644 index 0000000000000..5347b51d524fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BaseAdminRuleInner.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.Immutable; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AdminRule; +import com.azure.resourcemanager.network.generated.models.AdminRuleKind; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.DefaultAdminRule; +import java.io.IOException; + +/** + * Network base admin rule. + */ +@Immutable +public class BaseAdminRuleInner extends ChildResource { + /* + * Whether the rule is custom or default. + */ + private AdminRuleKind kind = AdminRuleKind.fromString("BaseAdminRule"); + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of BaseAdminRuleInner class. + */ + public BaseAdminRuleInner() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + public AdminRuleKind kind() { + return this.kind; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Set the systemData property: The system metadata related to this resource. + * + * @param systemData the systemData value to set. + * @return the BaseAdminRuleInner object itself. + */ + BaseAdminRuleInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaseAdminRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaseAdminRuleInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BaseAdminRuleInner. + */ + public static BaseAdminRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Custom".equals(discriminatorValue)) { + return AdminRule.fromJson(readerToUse.reset()); + } else if ("Default".equals(discriminatorValue)) { + return DefaultAdminRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static BaseAdminRuleInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaseAdminRuleInner deserializedBaseAdminRuleInner = new BaseAdminRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBaseAdminRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBaseAdminRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBaseAdminRuleInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedBaseAdminRuleInner.etag = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedBaseAdminRuleInner.kind = AdminRuleKind.fromString(reader.getString()); + } else if ("systemData".equals(fieldName)) { + deserializedBaseAdminRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBaseAdminRuleInner; + }); + } +} 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..3fca6156c9c97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionActiveSessionInner.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.BastionConnectProtocol; +import java.io.IOException; + +/** + * The session detail for a target. + */ +@Immutable +public final class BastionActiveSessionInner implements JsonSerializable { + /* + * A unique id for the session. + */ + private String sessionId; + + /* + * The time when the session started. + */ + private Object startTime; + + /* + * The subscription id for the target virtual machine. + */ + private String targetSubscriptionId; + + /* + * The type of the resource. + */ + private String resourceType; + + /* + * The host name of the target. + */ + private String targetHostname; + + /* + * The resource group of the target. + */ + private String targetResourceGroup; + + /* + * The user name who is active on this session. + */ + private String username; + + /* + * The IP Address of the target. + */ + private String targetIpAddress; + + /* + * The protocol used to connect to the target. + */ + private BastionConnectProtocol protocol; + + /* + * The resource id of the target. + */ + private String targetResourceId; + + /* + * Duration in mins the session has been active. + */ + private Float sessionDurationInMins; + + /** + * Creates an instance of BastionActiveSessionInner class. + */ + public BastionActiveSessionInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionActiveSessionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionActiveSessionInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionActiveSessionInner. + */ + public static BastionActiveSessionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionActiveSessionInner deserializedBastionActiveSessionInner = new BastionActiveSessionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sessionId".equals(fieldName)) { + deserializedBastionActiveSessionInner.sessionId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedBastionActiveSessionInner.startTime = reader.readUntyped(); + } else if ("targetSubscriptionId".equals(fieldName)) { + deserializedBastionActiveSessionInner.targetSubscriptionId = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedBastionActiveSessionInner.resourceType = reader.getString(); + } else if ("targetHostName".equals(fieldName)) { + deserializedBastionActiveSessionInner.targetHostname = reader.getString(); + } else if ("targetResourceGroup".equals(fieldName)) { + deserializedBastionActiveSessionInner.targetResourceGroup = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedBastionActiveSessionInner.username = reader.getString(); + } else if ("targetIpAddress".equals(fieldName)) { + deserializedBastionActiveSessionInner.targetIpAddress = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedBastionActiveSessionInner.protocol + = BastionConnectProtocol.fromString(reader.getString()); + } else if ("targetResourceId".equals(fieldName)) { + deserializedBastionActiveSessionInner.targetResourceId = reader.getString(); + } else if ("sessionDurationInMins".equals(fieldName)) { + deserializedBastionActiveSessionInner.sessionDurationInMins + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionActiveSessionInner; + }); + } +} 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..e5d996905b40a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostInner.java @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.BastionHostPropertiesFormatNetworkAcls; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Sku; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Bastion Host resource. + */ +@Fluent +public final class BastionHostInner extends Resource { + /* + * Represents the bastion host resource. + */ + private BastionHostPropertiesFormat innerProperties; + + /* + * A list of availability zones denoting where the resource needs to come from. + */ + private List zones; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The sku of this Bastion Host. + */ + private Sku sku; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of BastionHostInner class. + */ + public BastionHostInner() { + } + + /** + * Get the innerProperties property: Represents the bastion host resource. + * + * @return the innerProperties value. + */ + private BastionHostPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 BastionHostInner object itself. + */ + public BastionHostInner 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 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public BastionHostInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public BastionHostInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the ipConfigurations property: IP configuration of the Bastion Host resource. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withDnsName(dnsName); + return this; + } + + /** + * Get the virtualNetwork property: Reference to an existing virtual network required for Developer Bastion Host + * only. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetwork(); + } + + /** + * Set the virtualNetwork property: Reference to an existing virtual network required for Developer Bastion Host + * only. + * + * @param virtualNetwork the virtualNetwork value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withVirtualNetwork(SubResource virtualNetwork) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withVirtualNetwork(virtualNetwork); + return this; + } + + /** + * Get the networkAcls property: The networkAcls property. + * + * @return the networkAcls value. + */ + public BastionHostPropertiesFormatNetworkAcls networkAcls() { + return this.innerProperties() == null ? null : this.innerProperties().networkAcls(); + } + + /** + * Set the networkAcls property: The networkAcls property. + * + * @param networkAcls the networkAcls value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withNetworkAcls(BastionHostPropertiesFormatNetworkAcls networkAcls) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withNetworkAcls(networkAcls); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the bastion host resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the scaleUnits property: The scale units for the Bastion Host resource. + * + * @return the scaleUnits value. + */ + public Integer scaleUnits() { + return this.innerProperties() == null ? null : this.innerProperties().scaleUnits(); + } + + /** + * Set the scaleUnits property: The scale units for the Bastion Host resource. + * + * @param scaleUnits the scaleUnits value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withScaleUnits(Integer scaleUnits) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withScaleUnits(scaleUnits); + return this; + } + + /** + * Get the disableCopyPaste property: Enable/Disable Copy/Paste feature of the Bastion Host resource. + * + * @return the disableCopyPaste value. + */ + public Boolean disableCopyPaste() { + return this.innerProperties() == null ? null : this.innerProperties().disableCopyPaste(); + } + + /** + * Set the disableCopyPaste property: Enable/Disable Copy/Paste feature of the Bastion Host resource. + * + * @param disableCopyPaste the disableCopyPaste value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withDisableCopyPaste(Boolean disableCopyPaste) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withDisableCopyPaste(disableCopyPaste); + return this; + } + + /** + * Get the enableFileCopy property: Enable/Disable File Copy feature of the Bastion Host resource. + * + * @return the enableFileCopy value. + */ + public Boolean enableFileCopy() { + return this.innerProperties() == null ? null : this.innerProperties().enableFileCopy(); + } + + /** + * Set the enableFileCopy property: Enable/Disable File Copy feature of the Bastion Host resource. + * + * @param enableFileCopy the enableFileCopy value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withEnableFileCopy(Boolean enableFileCopy) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withEnableFileCopy(enableFileCopy); + return this; + } + + /** + * Get the enableIpConnect property: Enable/Disable IP Connect feature of the Bastion Host resource. + * + * @return the enableIpConnect value. + */ + public Boolean enableIpConnect() { + return this.innerProperties() == null ? null : this.innerProperties().enableIpConnect(); + } + + /** + * Set the enableIpConnect property: Enable/Disable IP Connect feature of the Bastion Host resource. + * + * @param enableIpConnect the enableIpConnect value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withEnableIpConnect(Boolean enableIpConnect) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withEnableIpConnect(enableIpConnect); + return this; + } + + /** + * Get the enableShareableLink property: Enable/Disable Shareable Link of the Bastion Host resource. + * + * @return the enableShareableLink value. + */ + public Boolean enableShareableLink() { + return this.innerProperties() == null ? null : this.innerProperties().enableShareableLink(); + } + + /** + * Set the enableShareableLink property: Enable/Disable Shareable Link of the Bastion Host resource. + * + * @param enableShareableLink the enableShareableLink value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withEnableShareableLink(Boolean enableShareableLink) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withEnableShareableLink(enableShareableLink); + return this; + } + + /** + * Get the enableTunneling property: Enable/Disable Tunneling feature of the Bastion Host resource. + * + * @return the enableTunneling value. + */ + public Boolean enableTunneling() { + return this.innerProperties() == null ? null : this.innerProperties().enableTunneling(); + } + + /** + * Set the enableTunneling property: Enable/Disable Tunneling feature of the Bastion Host resource. + * + * @param enableTunneling the enableTunneling value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withEnableTunneling(Boolean enableTunneling) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withEnableTunneling(enableTunneling); + return this; + } + + /** + * Get the enableKerberos property: Enable/Disable Kerberos feature of the Bastion Host resource. + * + * @return the enableKerberos value. + */ + public Boolean enableKerberos() { + return this.innerProperties() == null ? null : this.innerProperties().enableKerberos(); + } + + /** + * Set the enableKerberos property: Enable/Disable Kerberos feature of the Bastion Host resource. + * + * @param enableKerberos the enableKerberos value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withEnableKerberos(Boolean enableKerberos) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withEnableKerberos(enableKerberos); + return this; + } + + /** + * Get the enableSessionRecording property: Enable/Disable Session Recording feature of the Bastion Host resource. + * + * @return the enableSessionRecording value. + */ + public Boolean enableSessionRecording() { + return this.innerProperties() == null ? null : this.innerProperties().enableSessionRecording(); + } + + /** + * Set the enableSessionRecording property: Enable/Disable Session Recording feature of the Bastion Host resource. + * + * @param enableSessionRecording the enableSessionRecording value to set. + * @return the BastionHostInner object itself. + */ + public BastionHostInner withEnableSessionRecording(Boolean enableSessionRecording) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostPropertiesFormat(); + } + this.innerProperties().withEnableSessionRecording(enableSessionRecording); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionHostInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionHostInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BastionHostInner. + */ + public static BastionHostInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionHostInner deserializedBastionHostInner = new BastionHostInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedBastionHostInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBastionHostInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBastionHostInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBastionHostInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedBastionHostInner.innerProperties = BastionHostPropertiesFormat.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedBastionHostInner.zones = zones; + } else if ("etag".equals(fieldName)) { + deserializedBastionHostInner.etag = reader.getString(); + } else if ("sku".equals(fieldName)) { + deserializedBastionHostInner.sku = Sku.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedBastionHostInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionHostInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..dc62b2c39bcf3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostIpConfigurationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of IP configuration of an Bastion Host. + */ +@Fluent +public final class BastionHostIpConfigurationPropertiesFormat + implements JsonSerializable { + /* + * Reference of the subnet resource. + */ + private SubResource subnet; + + /* + * Reference of the PublicIP resource. + */ + private SubResource publicIpAddress; + + /* + * The provisioning state of the bastion host IP configuration resource. + */ + private ProvisioningState provisioningState; + + /* + * Private IP allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /** + * Creates an instance of BastionHostIpConfigurationPropertiesFormat class. + */ + public BastionHostIpConfigurationPropertiesFormat() { + } + + /** + * 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 BastionHostIpConfigurationPropertiesFormat object itself. + */ + public BastionHostIpConfigurationPropertiesFormat 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 BastionHostIpConfigurationPropertiesFormat object itself. + */ + public BastionHostIpConfigurationPropertiesFormat 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 BastionHostIpConfigurationPropertiesFormat object itself. + */ + public BastionHostIpConfigurationPropertiesFormat + withPrivateIpAllocationMethod(IpAllocationMethod privateIpAllocationMethod) { + this.privateIpAllocationMethod = privateIpAllocationMethod; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subnet in model BastionHostIpConfigurationPropertiesFormat")); + } + if (publicIpAddress() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publicIpAddress in model BastionHostIpConfigurationPropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BastionHostIpConfigurationPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionHostIpConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionHostIpConfigurationPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BastionHostIpConfigurationPropertiesFormat. + */ + public static BastionHostIpConfigurationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionHostIpConfigurationPropertiesFormat deserializedBastionHostIpConfigurationPropertiesFormat + = new BastionHostIpConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnet".equals(fieldName)) { + deserializedBastionHostIpConfigurationPropertiesFormat.subnet = SubResource.fromJson(reader); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedBastionHostIpConfigurationPropertiesFormat.publicIpAddress + = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedBastionHostIpConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedBastionHostIpConfigurationPropertiesFormat.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionHostIpConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostPropertiesFormat.java new file mode 100644 index 0000000000000..5b1cdb35e17e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionHostPropertiesFormat.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.BastionHostPropertiesFormatNetworkAcls; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the Bastion Host. + */ +@Fluent +public final class BastionHostPropertiesFormat implements JsonSerializable { + /* + * IP configuration of the Bastion Host resource. + */ + private List ipConfigurations; + + /* + * FQDN for the endpoint on which bastion host is accessible. + */ + private String dnsName; + + /* + * Reference to an existing virtual network required for Developer Bastion Host only. + */ + private SubResource virtualNetwork; + + /* + * The networkAcls property. + */ + private BastionHostPropertiesFormatNetworkAcls networkAcls; + + /* + * The provisioning state of the bastion host resource. + */ + private ProvisioningState provisioningState; + + /* + * The scale units for the Bastion Host resource. + */ + private Integer scaleUnits; + + /* + * Enable/Disable Copy/Paste feature of the Bastion Host resource. + */ + private Boolean disableCopyPaste; + + /* + * Enable/Disable File Copy feature of the Bastion Host resource. + */ + private Boolean enableFileCopy; + + /* + * Enable/Disable IP Connect feature of the Bastion Host resource. + */ + private Boolean enableIpConnect; + + /* + * Enable/Disable Shareable Link of the Bastion Host resource. + */ + private Boolean enableShareableLink; + + /* + * Enable/Disable Tunneling feature of the Bastion Host resource. + */ + private Boolean enableTunneling; + + /* + * Enable/Disable Kerberos feature of the Bastion Host resource. + */ + private Boolean enableKerberos; + + /* + * Enable/Disable Session Recording feature of the Bastion Host resource. + */ + private Boolean enableSessionRecording; + + /** + * Creates an instance of BastionHostPropertiesFormat class. + */ + public BastionHostPropertiesFormat() { + } + + /** + * 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 BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat 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 BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the virtualNetwork property: Reference to an existing virtual network required for Developer Bastion Host + * only. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.virtualNetwork; + } + + /** + * Set the virtualNetwork property: Reference to an existing virtual network required for Developer Bastion Host + * only. + * + * @param virtualNetwork the virtualNetwork value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withVirtualNetwork(SubResource virtualNetwork) { + this.virtualNetwork = virtualNetwork; + return this; + } + + /** + * Get the networkAcls property: The networkAcls property. + * + * @return the networkAcls value. + */ + public BastionHostPropertiesFormatNetworkAcls networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: The networkAcls property. + * + * @param networkAcls the networkAcls value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withNetworkAcls(BastionHostPropertiesFormatNetworkAcls networkAcls) { + this.networkAcls = networkAcls; + 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 scaleUnits property: The scale units for the Bastion Host resource. + * + * @return the scaleUnits value. + */ + public Integer scaleUnits() { + return this.scaleUnits; + } + + /** + * Set the scaleUnits property: The scale units for the Bastion Host resource. + * + * @param scaleUnits the scaleUnits value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withScaleUnits(Integer scaleUnits) { + this.scaleUnits = scaleUnits; + return this; + } + + /** + * Get the disableCopyPaste property: Enable/Disable Copy/Paste feature of the Bastion Host resource. + * + * @return the disableCopyPaste value. + */ + public Boolean disableCopyPaste() { + return this.disableCopyPaste; + } + + /** + * Set the disableCopyPaste property: Enable/Disable Copy/Paste feature of the Bastion Host resource. + * + * @param disableCopyPaste the disableCopyPaste value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withDisableCopyPaste(Boolean disableCopyPaste) { + this.disableCopyPaste = disableCopyPaste; + return this; + } + + /** + * Get the enableFileCopy property: Enable/Disable File Copy feature of the Bastion Host resource. + * + * @return the enableFileCopy value. + */ + public Boolean enableFileCopy() { + return this.enableFileCopy; + } + + /** + * Set the enableFileCopy property: Enable/Disable File Copy feature of the Bastion Host resource. + * + * @param enableFileCopy the enableFileCopy value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withEnableFileCopy(Boolean enableFileCopy) { + this.enableFileCopy = enableFileCopy; + return this; + } + + /** + * Get the enableIpConnect property: Enable/Disable IP Connect feature of the Bastion Host resource. + * + * @return the enableIpConnect value. + */ + public Boolean enableIpConnect() { + return this.enableIpConnect; + } + + /** + * Set the enableIpConnect property: Enable/Disable IP Connect feature of the Bastion Host resource. + * + * @param enableIpConnect the enableIpConnect value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withEnableIpConnect(Boolean enableIpConnect) { + this.enableIpConnect = enableIpConnect; + return this; + } + + /** + * Get the enableShareableLink property: Enable/Disable Shareable Link of the Bastion Host resource. + * + * @return the enableShareableLink value. + */ + public Boolean enableShareableLink() { + return this.enableShareableLink; + } + + /** + * Set the enableShareableLink property: Enable/Disable Shareable Link of the Bastion Host resource. + * + * @param enableShareableLink the enableShareableLink value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withEnableShareableLink(Boolean enableShareableLink) { + this.enableShareableLink = enableShareableLink; + return this; + } + + /** + * Get the enableTunneling property: Enable/Disable Tunneling feature of the Bastion Host resource. + * + * @return the enableTunneling value. + */ + public Boolean enableTunneling() { + return this.enableTunneling; + } + + /** + * Set the enableTunneling property: Enable/Disable Tunneling feature of the Bastion Host resource. + * + * @param enableTunneling the enableTunneling value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withEnableTunneling(Boolean enableTunneling) { + this.enableTunneling = enableTunneling; + return this; + } + + /** + * Get the enableKerberos property: Enable/Disable Kerberos feature of the Bastion Host resource. + * + * @return the enableKerberos value. + */ + public Boolean enableKerberos() { + return this.enableKerberos; + } + + /** + * Set the enableKerberos property: Enable/Disable Kerberos feature of the Bastion Host resource. + * + * @param enableKerberos the enableKerberos value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withEnableKerberos(Boolean enableKerberos) { + this.enableKerberos = enableKerberos; + return this; + } + + /** + * Get the enableSessionRecording property: Enable/Disable Session Recording feature of the Bastion Host resource. + * + * @return the enableSessionRecording value. + */ + public Boolean enableSessionRecording() { + return this.enableSessionRecording; + } + + /** + * Set the enableSessionRecording property: Enable/Disable Session Recording feature of the Bastion Host resource. + * + * @param enableSessionRecording the enableSessionRecording value to set. + * @return the BastionHostPropertiesFormat object itself. + */ + public BastionHostPropertiesFormat withEnableSessionRecording(Boolean enableSessionRecording) { + this.enableSessionRecording = enableSessionRecording; + 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()); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("dnsName", this.dnsName); + jsonWriter.writeJsonField("virtualNetwork", this.virtualNetwork); + jsonWriter.writeJsonField("networkAcls", this.networkAcls); + jsonWriter.writeNumberField("scaleUnits", this.scaleUnits); + jsonWriter.writeBooleanField("disableCopyPaste", this.disableCopyPaste); + jsonWriter.writeBooleanField("enableFileCopy", this.enableFileCopy); + jsonWriter.writeBooleanField("enableIpConnect", this.enableIpConnect); + jsonWriter.writeBooleanField("enableShareableLink", this.enableShareableLink); + jsonWriter.writeBooleanField("enableTunneling", this.enableTunneling); + jsonWriter.writeBooleanField("enableKerberos", this.enableKerberos); + jsonWriter.writeBooleanField("enableSessionRecording", this.enableSessionRecording); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionHostPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionHostPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionHostPropertiesFormat. + */ + public static BastionHostPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionHostPropertiesFormat deserializedBastionHostPropertiesFormat = new BastionHostPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> BastionHostIpConfiguration.fromJson(reader1)); + deserializedBastionHostPropertiesFormat.ipConfigurations = ipConfigurations; + } else if ("dnsName".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.dnsName = reader.getString(); + } else if ("virtualNetwork".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.virtualNetwork = SubResource.fromJson(reader); + } else if ("networkAcls".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.networkAcls + = BastionHostPropertiesFormatNetworkAcls.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("scaleUnits".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.scaleUnits = reader.getNullable(JsonReader::getInt); + } else if ("disableCopyPaste".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.disableCopyPaste + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableFileCopy".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.enableFileCopy = reader.getNullable(JsonReader::getBoolean); + } else if ("enableIpConnect".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.enableIpConnect + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableShareableLink".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.enableShareableLink + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableTunneling".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.enableTunneling + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableKerberos".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.enableKerberos = reader.getNullable(JsonReader::getBoolean); + } else if ("enableSessionRecording".equals(fieldName)) { + deserializedBastionHostPropertiesFormat.enableSessionRecording + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionHostPropertiesFormat; + }); + } +} 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..a8da85c2840a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionSessionStateInner.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The session state detail for a target. + */ +@Immutable +public final class BastionSessionStateInner implements JsonSerializable { + /* + * A unique id for the session. + */ + private String sessionId; + + /* + * Used for extra information. + */ + private String message; + + /* + * The state of the session. Disconnected/Failed/NotFound. + */ + private String state; + + /** + * Creates an instance of BastionSessionStateInner class. + */ + public BastionSessionStateInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionSessionStateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionSessionStateInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionSessionStateInner. + */ + public static BastionSessionStateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionSessionStateInner deserializedBastionSessionStateInner = new BastionSessionStateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sessionId".equals(fieldName)) { + deserializedBastionSessionStateInner.sessionId = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedBastionSessionStateInner.message = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedBastionSessionStateInner.state = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionSessionStateInner; + }); + } +} 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..7ec78ff651f56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BastionShareableLinkInner.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.VM; +import java.io.IOException; + +/** + * Bastion Shareable Link. + */ +@Fluent +public final class BastionShareableLinkInner implements JsonSerializable { + /* + * Reference of the virtual machine resource. + */ + private VM vm; + + /* + * The unique Bastion Shareable Link to the virtual machine. + */ + private String bsl; + + /* + * The time when the link was created. + */ + private String createdAt; + + /* + * Optional field indicating the warning or error message related to the vm in case of partial failure. + */ + private String message; + + /** + * Creates an instance of BastionShareableLinkInner class. + */ + public BastionShareableLinkInner() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property vm in model BastionShareableLinkInner")); + } else { + vm().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BastionShareableLinkInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vm", this.vm); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionShareableLinkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionShareableLinkInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BastionShareableLinkInner. + */ + public static BastionShareableLinkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionShareableLinkInner deserializedBastionShareableLinkInner = new BastionShareableLinkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vm".equals(fieldName)) { + deserializedBastionShareableLinkInner.vm = VM.fromJson(reader); + } else if ("bsl".equals(fieldName)) { + deserializedBastionShareableLinkInner.bsl = reader.getString(); + } else if ("createdAt".equals(fieldName)) { + deserializedBastionShareableLinkInner.createdAt = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedBastionShareableLinkInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionShareableLinkInner; + }); + } +} 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..db5688c16e8fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Virtual Appliance Site resource. + */ +@Fluent +public final class BgpConnectionInner extends SubResource { + /* + * The properties of the Bgp connections. + */ + private BgpConnectionProperties innerProperties; + + /* + * Name of the connection. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Connection type. + */ + private String type; + + /** + * Creates an instance of BgpConnectionInner class. + */ + public BgpConnectionInner() { + } + + /** + * Get the innerProperties property: The properties of the Bgp connections. + * + * @return the innerProperties value. + */ + private BgpConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public BgpConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the peerAsn property: Peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.innerProperties() == null ? null : this.innerProperties().peerAsn(); + } + + /** + * Set the peerAsn property: Peer ASN. + * + * @param peerAsn the peerAsn value to set. + * @return the BgpConnectionInner object itself. + */ + public BgpConnectionInner withPeerAsn(Long peerAsn) { + if (this.innerProperties() == null) { + this.innerProperties = new BgpConnectionProperties(); + } + this.innerProperties().withPeerAsn(peerAsn); + return this; + } + + /** + * Get the peerIp property: Peer IP. + * + * @return the peerIp value. + */ + public String peerIp() { + return this.innerProperties() == null ? null : this.innerProperties().peerIp(); + } + + /** + * Set the peerIp property: Peer IP. + * + * @param peerIp the peerIp value to set. + * @return the BgpConnectionInner object itself. + */ + public BgpConnectionInner withPeerIp(String peerIp) { + if (this.innerProperties() == null) { + this.innerProperties = new BgpConnectionProperties(); + } + this.innerProperties().withPeerIp(peerIp); + return this; + } + + /** + * Get the hubVirtualNetworkConnection property: The reference to the HubVirtualNetworkConnection resource. + * + * @return the hubVirtualNetworkConnection value. + */ + public SubResource hubVirtualNetworkConnection() { + return this.innerProperties() == null ? null : this.innerProperties().hubVirtualNetworkConnection(); + } + + /** + * Set the hubVirtualNetworkConnection property: The reference to the HubVirtualNetworkConnection resource. + * + * @param hubVirtualNetworkConnection the hubVirtualNetworkConnection value to set. + * @return the BgpConnectionInner object itself. + */ + public BgpConnectionInner withHubVirtualNetworkConnection(SubResource hubVirtualNetworkConnection) { + if (this.innerProperties() == null) { + this.innerProperties = new BgpConnectionProperties(); + } + this.innerProperties().withHubVirtualNetworkConnection(hubVirtualNetworkConnection); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the connectionState property: The current state of the VirtualHub to Peer. + * + * @return the connectionState value. + */ + public HubBgpConnectionStatus connectionState() { + return this.innerProperties() == null ? null : this.innerProperties().connectionState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpConnectionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpConnectionInner. + */ + public static BgpConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpConnectionInner deserializedBgpConnectionInner = new BgpConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBgpConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedBgpConnectionInner.innerProperties = BgpConnectionProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedBgpConnectionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedBgpConnectionInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBgpConnectionInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBgpConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionProperties.java new file mode 100644 index 0000000000000..828eedbeae95a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpConnectionProperties.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.HubBgpConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the bgp connection. + */ +@Fluent +public final class BgpConnectionProperties implements JsonSerializable { + /* + * Peer ASN. + */ + private Long peerAsn; + + /* + * Peer IP. + */ + private String peerIp; + + /* + * The reference to the HubVirtualNetworkConnection resource. + */ + private SubResource hubVirtualNetworkConnection; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * The current state of the VirtualHub to Peer. + */ + private HubBgpConnectionStatus connectionState; + + /** + * Creates an instance of BgpConnectionProperties class. + */ + public BgpConnectionProperties() { + } + + /** + * 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 BgpConnectionProperties object itself. + */ + public BgpConnectionProperties 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 BgpConnectionProperties object itself. + */ + public BgpConnectionProperties withPeerIp(String peerIp) { + this.peerIp = peerIp; + return this; + } + + /** + * Get the hubVirtualNetworkConnection property: The reference to the HubVirtualNetworkConnection resource. + * + * @return the hubVirtualNetworkConnection value. + */ + public SubResource hubVirtualNetworkConnection() { + return this.hubVirtualNetworkConnection; + } + + /** + * Set the hubVirtualNetworkConnection property: The reference to the HubVirtualNetworkConnection resource. + * + * @param hubVirtualNetworkConnection the hubVirtualNetworkConnection value to set. + * @return the BgpConnectionProperties object itself. + */ + public BgpConnectionProperties withHubVirtualNetworkConnection(SubResource hubVirtualNetworkConnection) { + this.hubVirtualNetworkConnection = hubVirtualNetworkConnection; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("peerAsn", this.peerAsn); + jsonWriter.writeStringField("peerIp", this.peerIp); + jsonWriter.writeJsonField("hubVirtualNetworkConnection", this.hubVirtualNetworkConnection); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpConnectionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpConnectionProperties. + */ + public static BgpConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpConnectionProperties deserializedBgpConnectionProperties = new BgpConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("peerAsn".equals(fieldName)) { + deserializedBgpConnectionProperties.peerAsn = reader.getNullable(JsonReader::getLong); + } else if ("peerIp".equals(fieldName)) { + deserializedBgpConnectionProperties.peerIp = reader.getString(); + } else if ("hubVirtualNetworkConnection".equals(fieldName)) { + deserializedBgpConnectionProperties.hubVirtualNetworkConnection = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedBgpConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("connectionState".equals(fieldName)) { + deserializedBgpConnectionProperties.connectionState + = HubBgpConnectionStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBgpConnectionProperties; + }); + } +} 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..18d1e8655c26f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpPeerStatusListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.BgpPeerStatus; +import java.io.IOException; +import java.util.List; + +/** + * Response for list BGP peer status API service call. + */ +@Fluent +public final class BgpPeerStatusListResultInner implements JsonSerializable { + /* + * List of BGP peers. + */ + private List value; + + /** + * Creates an instance of BgpPeerStatusListResultInner class. + */ + public BgpPeerStatusListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpPeerStatusListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpPeerStatusListResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpPeerStatusListResultInner. + */ + public static BgpPeerStatusListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpPeerStatusListResultInner deserializedBgpPeerStatusListResultInner = new BgpPeerStatusListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BgpPeerStatus.fromJson(reader1)); + deserializedBgpPeerStatusListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBgpPeerStatusListResultInner; + }); + } +} 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..d921a8cd9a316 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Service Community Properties. + */ +@Fluent +public final class BgpServiceCommunityInner extends Resource { + /* + * Properties of the BGP service community. + */ + private BgpServiceCommunityPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of BgpServiceCommunityInner class. + */ + public BgpServiceCommunityInner() { + } + + /** + * Get the innerProperties property: Properties of the BGP service community. + * + * @return the innerProperties value. + */ + private BgpServiceCommunityPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public BgpServiceCommunityInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public BgpServiceCommunityInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the serviceName property: The name of the bgp community. e.g. Skype. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BgpServiceCommunityPropertiesFormat(); + } + this.innerProperties().withServiceName(serviceName); + return this; + } + + /** + * Get the bgpCommunities property: A list of bgp communities. + * + * @return the bgpCommunities value. + */ + public List bgpCommunities() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BgpServiceCommunityPropertiesFormat(); + } + this.innerProperties().withBgpCommunities(bgpCommunities); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpServiceCommunityInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpServiceCommunityInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BgpServiceCommunityInner. + */ + public static BgpServiceCommunityInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpServiceCommunityInner deserializedBgpServiceCommunityInner = new BgpServiceCommunityInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedBgpServiceCommunityInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBgpServiceCommunityInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedBgpServiceCommunityInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedBgpServiceCommunityInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedBgpServiceCommunityInner.innerProperties + = BgpServiceCommunityPropertiesFormat.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedBgpServiceCommunityInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBgpServiceCommunityInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityPropertiesFormat.java new file mode 100644 index 0000000000000..3f31d6d33d2fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/BgpServiceCommunityPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.BgpCommunity; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Service Community. + */ +@Fluent +public final class BgpServiceCommunityPropertiesFormat + implements JsonSerializable { + /* + * The name of the bgp community. e.g. Skype. + */ + private String serviceName; + + /* + * A list of bgp communities. + */ + private List bgpCommunities; + + /** + * Creates an instance of BgpServiceCommunityPropertiesFormat class. + */ + public BgpServiceCommunityPropertiesFormat() { + } + + /** + * 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 BgpServiceCommunityPropertiesFormat object itself. + */ + public BgpServiceCommunityPropertiesFormat 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 BgpServiceCommunityPropertiesFormat object itself. + */ + public BgpServiceCommunityPropertiesFormat withBgpCommunities(List bgpCommunities) { + this.bgpCommunities = bgpCommunities; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceName", this.serviceName); + jsonWriter.writeArrayField("bgpCommunities", this.bgpCommunities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpServiceCommunityPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpServiceCommunityPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpServiceCommunityPropertiesFormat. + */ + public static BgpServiceCommunityPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpServiceCommunityPropertiesFormat deserializedBgpServiceCommunityPropertiesFormat + = new BgpServiceCommunityPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedBgpServiceCommunityPropertiesFormat.serviceName = reader.getString(); + } else if ("bgpCommunities".equals(fieldName)) { + List bgpCommunities = reader.readArray(reader1 -> BgpCommunity.fromJson(reader1)); + deserializedBgpServiceCommunityPropertiesFormat.bgpCommunities = bgpCommunities; + } else { + reader.skipChildren(); + } + } + + return deserializedBgpServiceCommunityPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorParameters.java new file mode 100644 index 0000000000000..4f51210c9ebc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorParameters.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters that define the operation to create a connection monitor. + */ +@Fluent +public class ConnectionMonitorParameters implements JsonSerializable { + /* + * Describes the source of connection monitor. + */ + private ConnectionMonitorSource source; + + /* + * Describes the destination of connection monitor. + */ + private ConnectionMonitorDestination destination; + + /* + * Determines if the connection monitor will start automatically once created. + */ + private Boolean autoStart; + + /* + * Monitoring interval in seconds. + */ + private Integer monitoringIntervalInSeconds; + + /* + * List of connection monitor endpoints. + */ + private List endpoints; + + /* + * List of connection monitor test configurations. + */ + private List testConfigurations; + + /* + * List of connection monitor test groups. + */ + private List testGroups; + + /* + * List of connection monitor outputs. + */ + private List outputs; + + /* + * Optional notes to be associated with the connection monitor. + */ + private String notes; + + /** + * Creates an instance of ConnectionMonitorParameters class. + */ + public ConnectionMonitorParameters() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeBooleanField("autoStart", this.autoStart); + jsonWriter.writeNumberField("monitoringIntervalInSeconds", this.monitoringIntervalInSeconds); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("testConfigurations", this.testConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("testGroups", this.testGroups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("notes", this.notes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorParameters. + */ + public static ConnectionMonitorParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorParameters deserializedConnectionMonitorParameters = new ConnectionMonitorParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedConnectionMonitorParameters.source = ConnectionMonitorSource.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedConnectionMonitorParameters.destination = ConnectionMonitorDestination.fromJson(reader); + } else if ("autoStart".equals(fieldName)) { + deserializedConnectionMonitorParameters.autoStart = reader.getNullable(JsonReader::getBoolean); + } else if ("monitoringIntervalInSeconds".equals(fieldName)) { + deserializedConnectionMonitorParameters.monitoringIntervalInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("endpoints".equals(fieldName)) { + List endpoints + = reader.readArray(reader1 -> ConnectionMonitorEndpoint.fromJson(reader1)); + deserializedConnectionMonitorParameters.endpoints = endpoints; + } else if ("testConfigurations".equals(fieldName)) { + List testConfigurations + = reader.readArray(reader1 -> ConnectionMonitorTestConfiguration.fromJson(reader1)); + deserializedConnectionMonitorParameters.testConfigurations = testConfigurations; + } else if ("testGroups".equals(fieldName)) { + List testGroups + = reader.readArray(reader1 -> ConnectionMonitorTestGroup.fromJson(reader1)); + deserializedConnectionMonitorParameters.testGroups = testGroups; + } else if ("outputs".equals(fieldName)) { + List outputs + = reader.readArray(reader1 -> ConnectionMonitorOutput.fromJson(reader1)); + deserializedConnectionMonitorParameters.outputs = outputs; + } else if ("notes".equals(fieldName)) { + deserializedConnectionMonitorParameters.notes = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorParameters; + }); + } +} 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..1b8723c17877f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorQueryResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorSourceStatus; +import com.azure.resourcemanager.network.generated.models.ConnectionStateSnapshot; +import java.io.IOException; +import java.util.List; + +/** + * List of connection states snapshots. + */ +@Fluent +public final class ConnectionMonitorQueryResultInner implements JsonSerializable { + /* + * Status of connection monitor source. + */ + private ConnectionMonitorSourceStatus sourceStatus; + + /* + * Information about connection states. + */ + private List states; + + /** + * Creates an instance of ConnectionMonitorQueryResultInner class. + */ + public ConnectionMonitorQueryResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceStatus", this.sourceStatus == null ? null : this.sourceStatus.toString()); + jsonWriter.writeArrayField("states", this.states, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorQueryResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorQueryResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorQueryResultInner. + */ + public static ConnectionMonitorQueryResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorQueryResultInner deserializedConnectionMonitorQueryResultInner + = new ConnectionMonitorQueryResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceStatus".equals(fieldName)) { + deserializedConnectionMonitorQueryResultInner.sourceStatus + = ConnectionMonitorSourceStatus.fromString(reader.getString()); + } else if ("states".equals(fieldName)) { + List states + = reader.readArray(reader1 -> ConnectionStateSnapshot.fromJson(reader1)); + deserializedConnectionMonitorQueryResultInner.states = states; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorQueryResultInner; + }); + } +} 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..a565c65c7e7cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultInner.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Information about the connection monitor. + */ +@Fluent +public final class ConnectionMonitorResultInner extends Resource { + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Properties of the connection monitor result. + */ + private ConnectionMonitorResultProperties innerProperties; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConnectionMonitorResultInner class. + */ + public ConnectionMonitorResultInner() { + } + + /** + * 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 innerProperties property: Properties of the connection monitor result. + * + * @return the innerProperties value. + */ + private ConnectionMonitorResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectionMonitorResultInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectionMonitorResultInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the connection monitor. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the startTime property: The date and time when the connection monitor was started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.innerProperties() == null ? null : this.innerProperties().startTime(); + } + + /** + * Get the monitoringStatus property: The monitoring status of the connection monitor. + * + * @return the monitoringStatus value. + */ + public String monitoringStatus() { + return this.innerProperties() == null ? null : this.innerProperties().monitoringStatus(); + } + + /** + * Get the connectionMonitorType property: Type of connection monitor. + * + * @return the connectionMonitorType value. + */ + public ConnectionMonitorType connectionMonitorType() { + return this.innerProperties() == null ? null : this.innerProperties().connectionMonitorType(); + } + + /** + * Get the source property: Describes the source of connection monitor. + * + * @return the source value. + */ + public ConnectionMonitorSource source() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the destination property: Describes the destination of connection monitor. + * + * @return the destination value. + */ + public ConnectionMonitorDestination destination() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withDestination(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withAutoStart(autoStart); + return this; + } + + /** + * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value. + */ + public Integer monitoringIntervalInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + /** + * Get the endpoints property: List of connection monitor endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withEndpoints(endpoints); + return this; + } + + /** + * Get the testConfigurations property: List of connection monitor test configurations. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withTestConfigurations(testConfigurations); + return this; + } + + /** + * Get the testGroups property: List of connection monitor test groups. + * + * @return the testGroups value. + */ + public List testGroups() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withTestGroups(testGroups); + return this; + } + + /** + * Get the outputs property: List of connection monitor outputs. + * + * @return the outputs value. + */ + public List outputs() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withOutputs(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorResultProperties(); + } + this.innerProperties().withNotes(notes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionMonitorResultInner. + */ + public static ConnectionMonitorResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorResultInner deserializedConnectionMonitorResultInner = new ConnectionMonitorResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectionMonitorResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConnectionMonitorResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectionMonitorResultInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConnectionMonitorResultInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectionMonitorResultInner.withTags(tags); + } else if ("etag".equals(fieldName)) { + deserializedConnectionMonitorResultInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedConnectionMonitorResultInner.innerProperties + = ConnectionMonitorResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultProperties.java new file mode 100644 index 0000000000000..87df8ec819261 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionMonitorResultProperties.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.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Describes the properties of a connection monitor. + */ +@Fluent +public final class ConnectionMonitorResultProperties extends ConnectionMonitorParameters { + /* + * The provisioning state of the connection monitor. + */ + private ProvisioningState provisioningState; + + /* + * The date and time when the connection monitor was started. + */ + private OffsetDateTime startTime; + + /* + * The monitoring status of the connection monitor. + */ + private String monitoringStatus; + + /* + * Type of connection monitor. + */ + private ConnectionMonitorType connectionMonitorType; + + /** + * Creates an instance of ConnectionMonitorResultProperties class. + */ + public ConnectionMonitorResultProperties() { + } + + /** + * 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() { + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", source()); + jsonWriter.writeJsonField("destination", destination()); + jsonWriter.writeBooleanField("autoStart", autoStart()); + jsonWriter.writeNumberField("monitoringIntervalInSeconds", monitoringIntervalInSeconds()); + jsonWriter.writeArrayField("endpoints", endpoints(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("testConfigurations", testConfigurations(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("testGroups", testGroups(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("outputs", outputs(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("notes", notes()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorResultProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorResultProperties. + */ + public static ConnectionMonitorResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorResultProperties deserializedConnectionMonitorResultProperties + = new ConnectionMonitorResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedConnectionMonitorResultProperties.withSource(ConnectionMonitorSource.fromJson(reader)); + } else if ("destination".equals(fieldName)) { + deserializedConnectionMonitorResultProperties + .withDestination(ConnectionMonitorDestination.fromJson(reader)); + } else if ("autoStart".equals(fieldName)) { + deserializedConnectionMonitorResultProperties + .withAutoStart(reader.getNullable(JsonReader::getBoolean)); + } else if ("monitoringIntervalInSeconds".equals(fieldName)) { + deserializedConnectionMonitorResultProperties + .withMonitoringIntervalInSeconds(reader.getNullable(JsonReader::getInt)); + } else if ("endpoints".equals(fieldName)) { + List endpoints + = reader.readArray(reader1 -> ConnectionMonitorEndpoint.fromJson(reader1)); + deserializedConnectionMonitorResultProperties.withEndpoints(endpoints); + } else if ("testConfigurations".equals(fieldName)) { + List testConfigurations + = reader.readArray(reader1 -> ConnectionMonitorTestConfiguration.fromJson(reader1)); + deserializedConnectionMonitorResultProperties.withTestConfigurations(testConfigurations); + } else if ("testGroups".equals(fieldName)) { + List testGroups + = reader.readArray(reader1 -> ConnectionMonitorTestGroup.fromJson(reader1)); + deserializedConnectionMonitorResultProperties.withTestGroups(testGroups); + } else if ("outputs".equals(fieldName)) { + List outputs + = reader.readArray(reader1 -> ConnectionMonitorOutput.fromJson(reader1)); + deserializedConnectionMonitorResultProperties.withOutputs(outputs); + } else if ("notes".equals(fieldName)) { + deserializedConnectionMonitorResultProperties.withNotes(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedConnectionMonitorResultProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedConnectionMonitorResultProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("monitoringStatus".equals(fieldName)) { + deserializedConnectionMonitorResultProperties.monitoringStatus = reader.getString(); + } else if ("connectionMonitorType".equals(fieldName)) { + deserializedConnectionMonitorResultProperties.connectionMonitorType + = ConnectionMonitorType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorResultProperties; + }); + } +} 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..c57aced856347 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionResetSharedKeyInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The virtual network connection reset shared key. + */ +@Fluent +public final class ConnectionResetSharedKeyInner implements JsonSerializable { + /* + * The virtual network connection reset shared key length, should between 1 and 128. + */ + private int keyLength; + + /** + * Creates an instance of ConnectionResetSharedKeyInner class. + */ + public ConnectionResetSharedKeyInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("keyLength", this.keyLength); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionResetSharedKeyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionResetSharedKeyInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionResetSharedKeyInner. + */ + public static ConnectionResetSharedKeyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionResetSharedKeyInner deserializedConnectionResetSharedKeyInner + = new ConnectionResetSharedKeyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyLength".equals(fieldName)) { + deserializedConnectionResetSharedKeyInner.keyLength = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionResetSharedKeyInner; + }); + } +} 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..091e787315ad0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyInner.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response for GetConnectionSharedKey API service call. + */ +@Fluent +public final class ConnectionSharedKeyInner extends SubResource { + /* + * The virtual network connection shared key value. + */ + private String value; + + /** + * Creates an instance of ConnectionSharedKeyInner class. + */ + public ConnectionSharedKeyInner() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property value in model ConnectionSharedKeyInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionSharedKeyInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionSharedKeyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionSharedKeyInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionSharedKeyInner. + */ + public static ConnectionSharedKeyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionSharedKeyInner deserializedConnectionSharedKeyInner = new ConnectionSharedKeyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectionSharedKeyInner.withId(reader.getString()); + } else if ("value".equals(fieldName)) { + deserializedConnectionSharedKeyInner.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionSharedKeyInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyResultInner.java new file mode 100644 index 0000000000000..cafe3cf408ef0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectionSharedKeyResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.SharedKeyProperties; +import java.io.IOException; + +/** + * SharedKey Resource . + */ +@Fluent +public final class ConnectionSharedKeyResultInner extends SubResource { + /* + * Properties of the shared key. + */ + private SharedKeyProperties properties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of ConnectionSharedKeyResultInner class. + */ + public ConnectionSharedKeyResultInner() { + } + + /** + * Get the properties property: Properties of the shared key. + * + * @return the properties value. + */ + public SharedKeyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the shared key. + * + * @param properties the properties value to set. + * @return the ConnectionSharedKeyResultInner object itself. + */ + public ConnectionSharedKeyResultInner withProperties(SharedKeyProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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 ConnectionSharedKeyResultInner object itself. + */ + public ConnectionSharedKeyResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectionSharedKeyResultInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionSharedKeyResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionSharedKeyResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionSharedKeyResultInner. + */ + public static ConnectionSharedKeyResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionSharedKeyResultInner deserializedConnectionSharedKeyResultInner + = new ConnectionSharedKeyResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectionSharedKeyResultInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedConnectionSharedKeyResultInner.properties = SharedKeyProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedConnectionSharedKeyResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectionSharedKeyResultInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionSharedKeyResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationInner.java new file mode 100644 index 0000000000000..5aea9d97ea9d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ConnectivityGroupItem; +import com.azure.resourcemanager.network.generated.models.ConnectivityTopology; +import com.azure.resourcemanager.network.generated.models.DeleteExistingPeering; +import com.azure.resourcemanager.network.generated.models.Hub; +import com.azure.resourcemanager.network.generated.models.IsGlobal; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * The network manager connectivity configuration resource. + */ +@Fluent +public final class ConnectivityConfigurationInner extends ChildResource { + /* + * Properties of a network manager connectivity configuration + */ + private ConnectivityConfigurationProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConnectivityConfigurationInner class. + */ + public ConnectivityConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of a network manager connectivity configuration. + * + * @return the innerProperties value. + */ + private ConnectivityConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the connectivity configuration. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the connectivity configuration. + * + * @param description the description value to set. + * @return the ConnectivityConfigurationInner object itself. + */ + public ConnectivityConfigurationInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the connectivityTopology property: Connectivity topology type. + * + * @return the connectivityTopology value. + */ + public ConnectivityTopology connectivityTopology() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityTopology(); + } + + /** + * Set the connectivityTopology property: Connectivity topology type. + * + * @param connectivityTopology the connectivityTopology value to set. + * @return the ConnectivityConfigurationInner object itself. + */ + public ConnectivityConfigurationInner withConnectivityTopology(ConnectivityTopology connectivityTopology) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withConnectivityTopology(connectivityTopology); + return this; + } + + /** + * Get the hubs property: List of hubItems. + * + * @return the hubs value. + */ + public List hubs() { + return this.innerProperties() == null ? null : this.innerProperties().hubs(); + } + + /** + * Set the hubs property: List of hubItems. + * + * @param hubs the hubs value to set. + * @return the ConnectivityConfigurationInner object itself. + */ + public ConnectivityConfigurationInner withHubs(List hubs) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withHubs(hubs); + return this; + } + + /** + * Get the isGlobal property: Flag if global mesh is supported. + * + * @return the isGlobal value. + */ + public IsGlobal isGlobal() { + return this.innerProperties() == null ? null : this.innerProperties().isGlobal(); + } + + /** + * Set the isGlobal property: Flag if global mesh is supported. + * + * @param isGlobal the isGlobal value to set. + * @return the ConnectivityConfigurationInner object itself. + */ + public ConnectivityConfigurationInner withIsGlobal(IsGlobal isGlobal) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withIsGlobal(isGlobal); + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.innerProperties() == null ? null : this.innerProperties().appliesToGroups(); + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the ConnectivityConfigurationInner object itself. + */ + public ConnectivityConfigurationInner withAppliesToGroups(List appliesToGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withAppliesToGroups(appliesToGroups); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the connectivity configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @return the deleteExistingPeering value. + */ + public DeleteExistingPeering deleteExistingPeering() { + return this.innerProperties() == null ? null : this.innerProperties().deleteExistingPeering(); + } + + /** + * Set the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @param deleteExistingPeering the deleteExistingPeering value to set. + * @return the ConnectivityConfigurationInner object itself. + */ + public ConnectivityConfigurationInner withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withDeleteExistingPeering(deleteExistingPeering); + return this; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityConfigurationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivityConfigurationInner. + */ + public static ConnectivityConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityConfigurationInner deserializedConnectivityConfigurationInner + = new ConnectivityConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectivityConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConnectivityConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectivityConfigurationInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedConnectivityConfigurationInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedConnectivityConfigurationInner.innerProperties + = ConnectivityConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConnectivityConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationProperties.java new file mode 100644 index 0000000000000..f462486a6f100 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ConnectivityGroupItem; +import com.azure.resourcemanager.network.generated.models.ConnectivityTopology; +import com.azure.resourcemanager.network.generated.models.DeleteExistingPeering; +import com.azure.resourcemanager.network.generated.models.Hub; +import com.azure.resourcemanager.network.generated.models.IsGlobal; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of network manager connectivity configuration. + */ +@Fluent +public final class ConnectivityConfigurationProperties + implements JsonSerializable { + /* + * A description of the connectivity configuration. + */ + private String description; + + /* + * Connectivity topology type. + */ + private ConnectivityTopology connectivityTopology; + + /* + * List of hubItems + */ + private List hubs; + + /* + * Flag if global mesh is supported. + */ + private IsGlobal isGlobal; + + /* + * Groups for configuration + */ + private List appliesToGroups; + + /* + * The provisioning state of the connectivity configuration resource. + */ + private ProvisioningState provisioningState; + + /* + * Flag if need to remove current existing peerings. + */ + private DeleteExistingPeering deleteExistingPeering; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of ConnectivityConfigurationProperties class. + */ + public ConnectivityConfigurationProperties() { + } + + /** + * Get the description property: A description of the connectivity configuration. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the connectivity configuration. + * + * @param description the description value to set. + * @return the ConnectivityConfigurationProperties object itself. + */ + public ConnectivityConfigurationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the connectivityTopology property: Connectivity topology type. + * + * @return the connectivityTopology value. + */ + public ConnectivityTopology connectivityTopology() { + return this.connectivityTopology; + } + + /** + * Set the connectivityTopology property: Connectivity topology type. + * + * @param connectivityTopology the connectivityTopology value to set. + * @return the ConnectivityConfigurationProperties object itself. + */ + public ConnectivityConfigurationProperties withConnectivityTopology(ConnectivityTopology connectivityTopology) { + this.connectivityTopology = connectivityTopology; + return this; + } + + /** + * Get the hubs property: List of hubItems. + * + * @return the hubs value. + */ + public List hubs() { + return this.hubs; + } + + /** + * Set the hubs property: List of hubItems. + * + * @param hubs the hubs value to set. + * @return the ConnectivityConfigurationProperties object itself. + */ + public ConnectivityConfigurationProperties withHubs(List hubs) { + this.hubs = hubs; + return this; + } + + /** + * Get the isGlobal property: Flag if global mesh is supported. + * + * @return the isGlobal value. + */ + public IsGlobal isGlobal() { + return this.isGlobal; + } + + /** + * Set the isGlobal property: Flag if global mesh is supported. + * + * @param isGlobal the isGlobal value to set. + * @return the ConnectivityConfigurationProperties object itself. + */ + public ConnectivityConfigurationProperties withIsGlobal(IsGlobal isGlobal) { + this.isGlobal = isGlobal; + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.appliesToGroups; + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the ConnectivityConfigurationProperties object itself. + */ + public ConnectivityConfigurationProperties withAppliesToGroups(List appliesToGroups) { + this.appliesToGroups = appliesToGroups; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the connectivity configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @return the deleteExistingPeering value. + */ + public DeleteExistingPeering deleteExistingPeering() { + return this.deleteExistingPeering; + } + + /** + * Set the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @param deleteExistingPeering the deleteExistingPeering value to set. + * @return the ConnectivityConfigurationProperties object itself. + */ + public ConnectivityConfigurationProperties withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering) { + this.deleteExistingPeering = deleteExistingPeering; + return this; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectivityTopology() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectivityTopology in model ConnectivityConfigurationProperties")); + } + if (hubs() != null) { + hubs().forEach(e -> e.validate()); + } + if (appliesToGroups() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appliesToGroups in model ConnectivityConfigurationProperties")); + } else { + appliesToGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityConfigurationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectivityTopology", + this.connectivityTopology == null ? null : this.connectivityTopology.toString()); + jsonWriter.writeArrayField("appliesToGroups", this.appliesToGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("hubs", this.hubs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("isGlobal", this.isGlobal == null ? null : this.isGlobal.toString()); + jsonWriter.writeStringField("deleteExistingPeering", + this.deleteExistingPeering == null ? null : this.deleteExistingPeering.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityConfigurationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivityConfigurationProperties. + */ + public static ConnectivityConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityConfigurationProperties deserializedConnectivityConfigurationProperties + = new ConnectivityConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectivityTopology".equals(fieldName)) { + deserializedConnectivityConfigurationProperties.connectivityTopology + = ConnectivityTopology.fromString(reader.getString()); + } else if ("appliesToGroups".equals(fieldName)) { + List appliesToGroups + = reader.readArray(reader1 -> ConnectivityGroupItem.fromJson(reader1)); + deserializedConnectivityConfigurationProperties.appliesToGroups = appliesToGroups; + } else if ("description".equals(fieldName)) { + deserializedConnectivityConfigurationProperties.description = reader.getString(); + } else if ("hubs".equals(fieldName)) { + List hubs = reader.readArray(reader1 -> Hub.fromJson(reader1)); + deserializedConnectivityConfigurationProperties.hubs = hubs; + } else if ("isGlobal".equals(fieldName)) { + deserializedConnectivityConfigurationProperties.isGlobal = IsGlobal.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedConnectivityConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("deleteExistingPeering".equals(fieldName)) { + deserializedConnectivityConfigurationProperties.deleteExistingPeering + = DeleteExistingPeering.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedConnectivityConfigurationProperties.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityConfigurationProperties; + }); + } +} 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..498cdf0f3ac5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ConnectivityInformationInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ConnectivityHop; +import java.io.IOException; +import java.util.List; + +/** + * Information on the connectivity status. + */ +@Immutable +public final class ConnectivityInformationInner implements JsonSerializable { + /* + * List of hops between the source and the destination. + */ + private List hops; + + /* + * The connection status. + */ + private ConnectionStatus connectionStatus; + + /* + * Average latency in milliseconds. + */ + private Integer avgLatencyInMs; + + /* + * Minimum latency in milliseconds. + */ + private Integer minLatencyInMs; + + /* + * Maximum latency in milliseconds. + */ + private Integer maxLatencyInMs; + + /* + * Total number of probes sent. + */ + private Integer probesSent; + + /* + * Number of failed probes. + */ + private Integer probesFailed; + + /** + * Creates an instance of ConnectivityInformationInner class. + */ + public ConnectivityInformationInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityInformationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityInformationInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectivityInformationInner. + */ + public static ConnectivityInformationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityInformationInner deserializedConnectivityInformationInner = new ConnectivityInformationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hops".equals(fieldName)) { + List hops = reader.readArray(reader1 -> ConnectivityHop.fromJson(reader1)); + deserializedConnectivityInformationInner.hops = hops; + } else if ("connectionStatus".equals(fieldName)) { + deserializedConnectivityInformationInner.connectionStatus + = ConnectionStatus.fromString(reader.getString()); + } else if ("avgLatencyInMs".equals(fieldName)) { + deserializedConnectivityInformationInner.avgLatencyInMs = reader.getNullable(JsonReader::getInt); + } else if ("minLatencyInMs".equals(fieldName)) { + deserializedConnectivityInformationInner.minLatencyInMs = reader.getNullable(JsonReader::getInt); + } else if ("maxLatencyInMs".equals(fieldName)) { + deserializedConnectivityInformationInner.maxLatencyInMs = reader.getNullable(JsonReader::getInt); + } else if ("probesSent".equals(fieldName)) { + deserializedConnectivityInformationInner.probesSent = reader.getNullable(JsonReader::getInt); + } else if ("probesFailed".equals(fieldName)) { + deserializedConnectivityInformationInner.probesFailed = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityInformationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..5f28379f02fef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceConfigurationPropertiesFormat.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Container network interface configuration properties. + */ +@Fluent +public final class ContainerNetworkInterfaceConfigurationPropertiesFormat + implements JsonSerializable { + /* + * A list of ip configurations of the container network interface configuration. + */ + private List ipConfigurations; + + /* + * A list of container network interfaces created from this container network interface configuration. + */ + private List containerNetworkInterfaces; + + /* + * The provisioning state of the container network interface configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ContainerNetworkInterfaceConfigurationPropertiesFormat class. + */ + public ContainerNetworkInterfaceConfigurationPropertiesFormat() { + } + + /** + * 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 ContainerNetworkInterfaceConfigurationPropertiesFormat object itself. + */ + public ContainerNetworkInterfaceConfigurationPropertiesFormat + 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 ContainerNetworkInterfaceConfigurationPropertiesFormat object itself. + */ + public ContainerNetworkInterfaceConfigurationPropertiesFormat + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("containerNetworkInterfaces", this.containerNetworkInterfaces, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerNetworkInterfaceConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerNetworkInterfaceConfigurationPropertiesFormat if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerNetworkInterfaceConfigurationPropertiesFormat. + */ + public static ContainerNetworkInterfaceConfigurationPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ContainerNetworkInterfaceConfigurationPropertiesFormat deserializedContainerNetworkInterfaceConfigurationPropertiesFormat + = new ContainerNetworkInterfaceConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> IpConfigurationProfileInner.fromJson(reader1)); + deserializedContainerNetworkInterfaceConfigurationPropertiesFormat.ipConfigurations + = ipConfigurations; + } else if ("containerNetworkInterfaces".equals(fieldName)) { + List containerNetworkInterfaces + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedContainerNetworkInterfaceConfigurationPropertiesFormat.containerNetworkInterfaces + = containerNetworkInterfaces; + } else if ("provisioningState".equals(fieldName)) { + deserializedContainerNetworkInterfaceConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerNetworkInterfaceConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..2ca108261ba59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfaceIpConfigurationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the container network interface IP configuration. + */ +@Immutable +public final class ContainerNetworkInterfaceIpConfigurationPropertiesFormat + implements JsonSerializable { + /* + * The provisioning state of the container network interface IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ContainerNetworkInterfaceIpConfigurationPropertiesFormat class. + */ + public ContainerNetworkInterfaceIpConfigurationPropertiesFormat() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerNetworkInterfaceIpConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerNetworkInterfaceIpConfigurationPropertiesFormat if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ContainerNetworkInterfaceIpConfigurationPropertiesFormat. + */ + public static ContainerNetworkInterfaceIpConfigurationPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ContainerNetworkInterfaceIpConfigurationPropertiesFormat deserializedContainerNetworkInterfaceIpConfigurationPropertiesFormat + = new ContainerNetworkInterfaceIpConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedContainerNetworkInterfaceIpConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerNetworkInterfaceIpConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfacePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfacePropertiesFormat.java new file mode 100644 index 0000000000000..1063b188f9a99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ContainerNetworkInterfacePropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.Container; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.ContainerNetworkInterfaceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of container network interface. + */ +@Fluent +public final class ContainerNetworkInterfacePropertiesFormat + implements JsonSerializable { + /* + * Container network interface configuration from which this container network interface is created. + */ + private ContainerNetworkInterfaceConfiguration containerNetworkInterfaceConfiguration; + + /* + * Reference to the container to which this container network interface is attached. + */ + private Container container; + + /* + * Reference to the ip configuration on this container nic. + */ + private List ipConfigurations; + + /* + * The provisioning state of the container network interface resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ContainerNetworkInterfacePropertiesFormat class. + */ + public ContainerNetworkInterfacePropertiesFormat() { + } + + /** + * 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 ContainerNetworkInterfacePropertiesFormat object itself. + */ + public ContainerNetworkInterfacePropertiesFormat 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("container", this.container); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerNetworkInterfacePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerNetworkInterfacePropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerNetworkInterfacePropertiesFormat. + */ + public static ContainerNetworkInterfacePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerNetworkInterfacePropertiesFormat deserializedContainerNetworkInterfacePropertiesFormat + = new ContainerNetworkInterfacePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerNetworkInterfaceConfiguration".equals(fieldName)) { + deserializedContainerNetworkInterfacePropertiesFormat.containerNetworkInterfaceConfiguration + = ContainerNetworkInterfaceConfiguration.fromJson(reader); + } else if ("container".equals(fieldName)) { + deserializedContainerNetworkInterfacePropertiesFormat.container = Container.fromJson(reader); + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> ContainerNetworkInterfaceIpConfiguration.fromJson(reader1)); + deserializedContainerNetworkInterfacePropertiesFormat.ipConfigurations = ipConfigurations; + } else if ("provisioningState".equals(fieldName)) { + deserializedContainerNetworkInterfacePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerNetworkInterfacePropertiesFormat; + }); + } +} 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..cc6bfaa18a893 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixInner.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.CommissionedState; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixType; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.Geo; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Custom IP prefix resource. + */ +@Fluent +public final class CustomIpPrefixInner extends Resource { + /* + * The extended location of the custom IP prefix. + */ + private ExtendedLocation extendedLocation; + + /* + * Custom IP prefix properties. + */ + private CustomIpPrefixPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + private List zones; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of CustomIpPrefixInner class. + */ + public CustomIpPrefixInner() { + } + + /** + * 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 innerProperties property: Custom IP prefix properties. + * + * @return the innerProperties value. + */ + private CustomIpPrefixPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomIpPrefixInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CustomIpPrefixInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the asn property: The ASN for CIDR advertising. Should be an integer as string. + * + * @return the asn value. + */ + public String asn() { + return this.innerProperties() == null ? null : this.innerProperties().asn(); + } + + /** + * Set the asn property: The ASN for CIDR advertising. Should be an integer as string. + * + * @param asn the asn value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withAsn(String asn) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withAsn(asn); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withCidr(cidr); + return this; + } + + /** + * Get the signedMessage property: Signed message for WAN validation. + * + * @return the signedMessage value. + */ + public String signedMessage() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withSignedMessage(signedMessage); + return this; + } + + /** + * Get the authorizationMessage property: Authorization message for WAN validation. + * + * @return the authorizationMessage value. + */ + public String authorizationMessage() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withAuthorizationMessage(authorizationMessage); + return this; + } + + /** + * Get the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * + * @return the customIpPrefixParent value. + */ + public SubResource customIpPrefixParent() { + return this.innerProperties() == null ? null : this.innerProperties().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(SubResource customIpPrefixParent) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withCustomIpPrefixParent(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.innerProperties() == null ? null : this.innerProperties().childCustomIpPrefixes(); + } + + /** + * Get the commissionedState property: The commissioned state of the Custom IP Prefix. + * + * @return the commissionedState value. + */ + public CommissionedState commissionedState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withCommissionedState(commissionedState); + return this; + } + + /** + * Get the expressRouteAdvertise property: Whether to do express route advertise. + * + * @return the expressRouteAdvertise value. + */ + public Boolean expressRouteAdvertise() { + return this.innerProperties() == null ? null : this.innerProperties().expressRouteAdvertise(); + } + + /** + * Set the expressRouteAdvertise property: Whether to do express route advertise. + * + * @param expressRouteAdvertise the expressRouteAdvertise value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withExpressRouteAdvertise(Boolean expressRouteAdvertise) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withExpressRouteAdvertise(expressRouteAdvertise); + return this; + } + + /** + * Get the geo property: The Geo for CIDR advertising. Should be an Geo code. + * + * @return the geo value. + */ + public Geo geo() { + return this.innerProperties() == null ? null : this.innerProperties().geo(); + } + + /** + * Set the geo property: The Geo for CIDR advertising. Should be an Geo code. + * + * @param geo the geo value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withGeo(Geo geo) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withGeo(geo); + return this; + } + + /** + * Get the noInternetAdvertise property: Whether to Advertise the range to Internet. + * + * @return the noInternetAdvertise value. + */ + public Boolean noInternetAdvertise() { + return this.innerProperties() == null ? null : this.innerProperties().noInternetAdvertise(); + } + + /** + * Set the noInternetAdvertise property: Whether to Advertise the range to Internet. + * + * @param noInternetAdvertise the noInternetAdvertise value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withNoInternetAdvertise(Boolean noInternetAdvertise) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withNoInternetAdvertise(noInternetAdvertise); + return this; + } + + /** + * Get the prefixType property: Type of custom IP prefix. Should be Singular, Parent, or Child. + * + * @return the prefixType value. + */ + public CustomIpPrefixType prefixType() { + return this.innerProperties() == null ? null : this.innerProperties().prefixType(); + } + + /** + * Set the prefixType property: Type of custom IP prefix. Should be Singular, Parent, or Child. + * + * @param prefixType the prefixType value to set. + * @return the CustomIpPrefixInner object itself. + */ + public CustomIpPrefixInner withPrefixType(CustomIpPrefixType prefixType) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomIpPrefixPropertiesFormat(); + } + this.innerProperties().withPrefixType(prefixType); + return this; + } + + /** + * Get the publicIpPrefixes property: The list of all referenced PublicIpPrefixes. + * + * @return the publicIpPrefixes value. + */ + public List publicIpPrefixes() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpPrefixes(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the custom IP prefix resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the failedReason property: The reason why resource is in failed state. + * + * @return the failedReason value. + */ + public String failedReason() { + return this.innerProperties() == null ? null : this.innerProperties().failedReason(); + } + + /** + * Get the provisioningState property: The provisioning state of the custom IP prefix resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomIpPrefixInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomIpPrefixInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomIpPrefixInner. + */ + public static CustomIpPrefixInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomIpPrefixInner deserializedCustomIpPrefixInner = new CustomIpPrefixInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomIpPrefixInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCustomIpPrefixInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCustomIpPrefixInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCustomIpPrefixInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedCustomIpPrefixInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedCustomIpPrefixInner.innerProperties = CustomIpPrefixPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedCustomIpPrefixInner.etag = reader.getString(); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomIpPrefixInner.zones = zones; + } else if ("id".equals(fieldName)) { + deserializedCustomIpPrefixInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomIpPrefixInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixPropertiesFormat.java new file mode 100644 index 0000000000000..d8430959a7cf1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/CustomIpPrefixPropertiesFormat.java @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.CommissionedState; +import com.azure.resourcemanager.network.generated.models.CustomIpPrefixType; +import com.azure.resourcemanager.network.generated.models.Geo; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Custom IP prefix properties. + */ +@Fluent +public final class CustomIpPrefixPropertiesFormat implements JsonSerializable { + /* + * The ASN for CIDR advertising. Should be an integer as string. + */ + private String asn; + + /* + * The prefix range in CIDR notation. Should include the start address and the prefix length. + */ + private String cidr; + + /* + * Signed message for WAN validation. + */ + private String signedMessage; + + /* + * Authorization message for WAN validation. + */ + private String authorizationMessage; + + /* + * The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + */ + private SubResource customIpPrefixParent; + + /* + * The list of all Children for IPv6 /48 CustomIpPrefix. + */ + private List childCustomIpPrefixes; + + /* + * The commissioned state of the Custom IP Prefix. + */ + private CommissionedState commissionedState; + + /* + * Whether to do express route advertise. + */ + private Boolean expressRouteAdvertise; + + /* + * The Geo for CIDR advertising. Should be an Geo code. + */ + private Geo geo; + + /* + * Whether to Advertise the range to Internet. + */ + private Boolean noInternetAdvertise; + + /* + * Type of custom IP prefix. Should be Singular, Parent, or Child. + */ + private CustomIpPrefixType prefixType; + + /* + * The list of all referenced PublicIpPrefixes. + */ + private List publicIpPrefixes; + + /* + * The resource GUID property of the custom IP prefix resource. + */ + private String resourceGuid; + + /* + * The reason why resource is in failed state. + */ + private String failedReason; + + /* + * The provisioning state of the custom IP prefix resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of CustomIpPrefixPropertiesFormat class. + */ + public CustomIpPrefixPropertiesFormat() { + } + + /** + * Get the asn property: The ASN for CIDR advertising. Should be an integer as string. + * + * @return the asn value. + */ + public String asn() { + return this.asn; + } + + /** + * Set the asn property: The ASN for CIDR advertising. Should be an integer as string. + * + * @param asn the asn value to set. + * @return the CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withAsn(String asn) { + this.asn = asn; + 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 CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat 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 CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat 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 CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withAuthorizationMessage(String authorizationMessage) { + this.authorizationMessage = authorizationMessage; + return this; + } + + /** + * Get the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * + * @return the customIpPrefixParent value. + */ + public SubResource customIpPrefixParent() { + return this.customIpPrefixParent; + } + + /** + * Set the customIpPrefixParent property: The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + * + * @param customIpPrefixParent the customIpPrefixParent value to set. + * @return the CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withCustomIpPrefixParent(SubResource 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 CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withCommissionedState(CommissionedState commissionedState) { + this.commissionedState = commissionedState; + return this; + } + + /** + * Get the expressRouteAdvertise property: Whether to do express route advertise. + * + * @return the expressRouteAdvertise value. + */ + public Boolean expressRouteAdvertise() { + return this.expressRouteAdvertise; + } + + /** + * Set the expressRouteAdvertise property: Whether to do express route advertise. + * + * @param expressRouteAdvertise the expressRouteAdvertise value to set. + * @return the CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withExpressRouteAdvertise(Boolean expressRouteAdvertise) { + this.expressRouteAdvertise = expressRouteAdvertise; + return this; + } + + /** + * Get the geo property: The Geo for CIDR advertising. Should be an Geo code. + * + * @return the geo value. + */ + public Geo geo() { + return this.geo; + } + + /** + * Set the geo property: The Geo for CIDR advertising. Should be an Geo code. + * + * @param geo the geo value to set. + * @return the CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withGeo(Geo geo) { + this.geo = geo; + return this; + } + + /** + * Get the noInternetAdvertise property: Whether to Advertise the range to Internet. + * + * @return the noInternetAdvertise value. + */ + public Boolean noInternetAdvertise() { + return this.noInternetAdvertise; + } + + /** + * Set the noInternetAdvertise property: Whether to Advertise the range to Internet. + * + * @param noInternetAdvertise the noInternetAdvertise value to set. + * @return the CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withNoInternetAdvertise(Boolean noInternetAdvertise) { + this.noInternetAdvertise = noInternetAdvertise; + return this; + } + + /** + * Get the prefixType property: Type of custom IP prefix. Should be Singular, Parent, or Child. + * + * @return the prefixType value. + */ + public CustomIpPrefixType prefixType() { + return this.prefixType; + } + + /** + * Set the prefixType property: Type of custom IP prefix. Should be Singular, Parent, or Child. + * + * @param prefixType the prefixType value to set. + * @return the CustomIpPrefixPropertiesFormat object itself. + */ + public CustomIpPrefixPropertiesFormat withPrefixType(CustomIpPrefixType prefixType) { + this.prefixType = prefixType; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("asn", this.asn); + jsonWriter.writeStringField("cidr", this.cidr); + jsonWriter.writeStringField("signedMessage", this.signedMessage); + jsonWriter.writeStringField("authorizationMessage", this.authorizationMessage); + jsonWriter.writeJsonField("customIpPrefixParent", this.customIpPrefixParent); + jsonWriter.writeStringField("commissionedState", + this.commissionedState == null ? null : this.commissionedState.toString()); + jsonWriter.writeBooleanField("expressRouteAdvertise", this.expressRouteAdvertise); + jsonWriter.writeStringField("geo", this.geo == null ? null : this.geo.toString()); + jsonWriter.writeBooleanField("noInternetAdvertise", this.noInternetAdvertise); + jsonWriter.writeStringField("prefixType", this.prefixType == null ? null : this.prefixType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomIpPrefixPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomIpPrefixPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomIpPrefixPropertiesFormat. + */ + public static CustomIpPrefixPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomIpPrefixPropertiesFormat deserializedCustomIpPrefixPropertiesFormat + = new CustomIpPrefixPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("asn".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.asn = reader.getString(); + } else if ("cidr".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.cidr = reader.getString(); + } else if ("signedMessage".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.signedMessage = reader.getString(); + } else if ("authorizationMessage".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.authorizationMessage = reader.getString(); + } else if ("customIpPrefixParent".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.customIpPrefixParent = SubResource.fromJson(reader); + } else if ("childCustomIpPrefixes".equals(fieldName)) { + List childCustomIpPrefixes + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedCustomIpPrefixPropertiesFormat.childCustomIpPrefixes = childCustomIpPrefixes; + } else if ("commissionedState".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.commissionedState + = CommissionedState.fromString(reader.getString()); + } else if ("expressRouteAdvertise".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.expressRouteAdvertise + = reader.getNullable(JsonReader::getBoolean); + } else if ("geo".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.geo = Geo.fromString(reader.getString()); + } else if ("noInternetAdvertise".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.noInternetAdvertise + = reader.getNullable(JsonReader::getBoolean); + } else if ("prefixType".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.prefixType + = CustomIpPrefixType.fromString(reader.getString()); + } else if ("publicIpPrefixes".equals(fieldName)) { + List publicIpPrefixes = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedCustomIpPrefixPropertiesFormat.publicIpPrefixes = publicIpPrefixes; + } else if ("resourceGuid".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.resourceGuid = reader.getString(); + } else if ("failedReason".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.failedReason = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCustomIpPrefixPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomIpPrefixPropertiesFormat; + }); + } +} 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..96749d6c1e69d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.Map; + +/** + * A DDoS custom policy in a resource group. + */ +@Fluent +public final class DdosCustomPolicyInner extends Resource { + /* + * Properties of the DDoS custom policy. + */ + private DdosCustomPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of DdosCustomPolicyInner class. + */ + public DdosCustomPolicyInner() { + } + + /** + * Get the innerProperties property: Properties of the DDoS custom policy. + * + * @return the innerProperties value. + */ + private DdosCustomPolicyPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 DdosCustomPolicyInner object itself. + */ + public DdosCustomPolicyInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public DdosCustomPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DdosCustomPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the DDoS custom policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DdosCustomPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DdosCustomPolicyInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DdosCustomPolicyInner. + */ + public static DdosCustomPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DdosCustomPolicyInner deserializedDdosCustomPolicyInner = new DdosCustomPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDdosCustomPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDdosCustomPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDdosCustomPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDdosCustomPolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDdosCustomPolicyInner.innerProperties + = DdosCustomPolicyPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedDdosCustomPolicyInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedDdosCustomPolicyInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDdosCustomPolicyInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyPropertiesFormat.java new file mode 100644 index 0000000000000..b5cea9de9d3ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosCustomPolicyPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * DDoS custom policy properties. + */ +@Immutable +public final class DdosCustomPolicyPropertiesFormat implements JsonSerializable { + /* + * 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. + */ + private String resourceGuid; + + /* + * The provisioning state of the DDoS custom policy resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DdosCustomPolicyPropertiesFormat class. + */ + public DdosCustomPolicyPropertiesFormat() { + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DdosCustomPolicyPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DdosCustomPolicyPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DdosCustomPolicyPropertiesFormat. + */ + public static DdosCustomPolicyPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DdosCustomPolicyPropertiesFormat deserializedDdosCustomPolicyPropertiesFormat + = new DdosCustomPolicyPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceGuid".equals(fieldName)) { + deserializedDdosCustomPolicyPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedDdosCustomPolicyPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDdosCustomPolicyPropertiesFormat; + }); + } +} 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..cc6158f7f92c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A DDoS protection plan in a resource group. + */ +@Fluent +public final class DdosProtectionPlanInner extends Resource { + /* + * Properties of the DDoS protection plan. + */ + private DdosProtectionPlanPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DdosProtectionPlanInner class. + */ + public DdosProtectionPlanInner() { + } + + /** + * Get the innerProperties property: Properties of the DDoS protection plan. + * + * @return the innerProperties value. + */ + private DdosProtectionPlanPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public DdosProtectionPlanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DdosProtectionPlanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the DDoS protection plan resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the publicIpAddresses property: The list of public IPs associated with the DDoS protection plan resource. + * This list is read-only. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().publicIpAddresses(); + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().virtualNetworks(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DdosProtectionPlanInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DdosProtectionPlanInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DdosProtectionPlanInner. + */ + public static DdosProtectionPlanInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DdosProtectionPlanInner deserializedDdosProtectionPlanInner = new DdosProtectionPlanInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDdosProtectionPlanInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDdosProtectionPlanInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDdosProtectionPlanInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDdosProtectionPlanInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDdosProtectionPlanInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDdosProtectionPlanInner.innerProperties + = DdosProtectionPlanPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedDdosProtectionPlanInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDdosProtectionPlanInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanPropertiesFormat.java new file mode 100644 index 0000000000000..8d5d063de042f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DdosProtectionPlanPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * DDoS protection plan properties. + */ +@Immutable +public final class DdosProtectionPlanPropertiesFormat implements JsonSerializable { + /* + * 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. + */ + private String resourceGuid; + + /* + * The provisioning state of the DDoS protection plan resource. + */ + private ProvisioningState provisioningState; + + /* + * The list of public IPs associated with the DDoS protection plan resource. This list is read-only. + */ + private List publicIpAddresses; + + /* + * The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. + */ + private List virtualNetworks; + + /** + * Creates an instance of DdosProtectionPlanPropertiesFormat class. + */ + public DdosProtectionPlanPropertiesFormat() { + } + + /** + * 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 publicIpAddresses property: The list of public IPs associated with the DDoS protection plan resource. + * This list is read-only. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.publicIpAddresses; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DdosProtectionPlanPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DdosProtectionPlanPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DdosProtectionPlanPropertiesFormat. + */ + public static DdosProtectionPlanPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DdosProtectionPlanPropertiesFormat deserializedDdosProtectionPlanPropertiesFormat + = new DdosProtectionPlanPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceGuid".equals(fieldName)) { + deserializedDdosProtectionPlanPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedDdosProtectionPlanPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("publicIPAddresses".equals(fieldName)) { + List publicIpAddresses = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedDdosProtectionPlanPropertiesFormat.publicIpAddresses = publicIpAddresses; + } else if ("virtualNetworks".equals(fieldName)) { + List virtualNetworks = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedDdosProtectionPlanPropertiesFormat.virtualNetworks = virtualNetworks; + } else { + reader.skipChildren(); + } + } + + return deserializedDdosProtectionPlanPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultAdminPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultAdminPropertiesFormat.java new file mode 100644 index 0000000000000..f7422048a0ce3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultAdminPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.io.IOException; +import java.util.List; + +/** + * Security default admin rule resource. + */ +@Fluent +public final class DefaultAdminPropertiesFormat implements JsonSerializable { + /* + * A description for this rule. Restricted to 140 chars. + */ + private String description; + + /* + * Default rule flag. + */ + private String flag; + + /* + * Network protocol this rule applies to. + */ + private SecurityConfigurationRuleProtocol protocol; + + /* + * The CIDR or source IP ranges. + */ + private List sources; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + private List destinations; + + /* + * The source port ranges. + */ + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + private List destinationPortRanges; + + /* + * Indicates the access allowed for this particular rule + */ + private SecurityConfigurationRuleAccess access; + + /* + * The priority of the rule. The value can be between 1 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. + */ + private Integer priority; + + /* + * Indicates if the traffic matched against the rule in inbound or outbound. + */ + private SecurityConfigurationRuleDirection direction; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of DefaultAdminPropertiesFormat class. + */ + public DefaultAdminPropertiesFormat() { + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the flag property: Default rule flag. + * + * @return the flag value. + */ + public String flag() { + return this.flag; + } + + /** + * Set the flag property: Default rule flag. + * + * @param flag the flag value to set. + * @return the DefaultAdminPropertiesFormat object itself. + */ + public DefaultAdminPropertiesFormat withFlag(String flag) { + this.flag = flag; + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.protocol; + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.sourcePortRanges; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.access; + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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; + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.direction; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sources() != null) { + sources().forEach(e -> e.validate()); + } + if (destinations() != null) { + destinations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("flag", this.flag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultAdminPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultAdminPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultAdminPropertiesFormat. + */ + public static DefaultAdminPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultAdminPropertiesFormat deserializedDefaultAdminPropertiesFormat = new DefaultAdminPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.description = reader.getString(); + } else if ("flag".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.flag = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.protocol + = SecurityConfigurationRuleProtocol.fromString(reader.getString()); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> AddressPrefixItem.fromJson(reader1)); + deserializedDefaultAdminPropertiesFormat.sources = sources; + } else if ("destinations".equals(fieldName)) { + List destinations + = reader.readArray(reader1 -> AddressPrefixItem.fromJson(reader1)); + deserializedDefaultAdminPropertiesFormat.destinations = destinations; + } else if ("sourcePortRanges".equals(fieldName)) { + List sourcePortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedDefaultAdminPropertiesFormat.sourcePortRanges = sourcePortRanges; + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedDefaultAdminPropertiesFormat.destinationPortRanges = destinationPortRanges; + } else if ("access".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.access + = SecurityConfigurationRuleAccess.fromString(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.priority = reader.getNullable(JsonReader::getInt); + } else if ("direction".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.direction + = SecurityConfigurationRuleDirection.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedDefaultAdminPropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultAdminPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultRuleSetPropertyFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultRuleSetPropertyFormat.java new file mode 100644 index 0000000000000..847d644350cb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DefaultRuleSetPropertyFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * the default web application firewall rule set. + */ +@Fluent +public final class DefaultRuleSetPropertyFormat implements JsonSerializable { + /* + * The type of the web application firewall rule set. + */ + private String ruleSetType; + + /* + * The version of the web application firewall rule set type. + */ + private String ruleSetVersion; + + /** + * Creates an instance of DefaultRuleSetPropertyFormat class. + */ + public DefaultRuleSetPropertyFormat() { + } + + /** + * 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 DefaultRuleSetPropertyFormat object itself. + */ + public DefaultRuleSetPropertyFormat 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 DefaultRuleSetPropertyFormat object itself. + */ + public DefaultRuleSetPropertyFormat withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleSetType", this.ruleSetType); + jsonWriter.writeStringField("ruleSetVersion", this.ruleSetVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultRuleSetPropertyFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultRuleSetPropertyFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DefaultRuleSetPropertyFormat. + */ + public static DefaultRuleSetPropertyFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultRuleSetPropertyFormat deserializedDefaultRuleSetPropertyFormat = new DefaultRuleSetPropertyFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetType".equals(fieldName)) { + deserializedDefaultRuleSetPropertyFormat.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedDefaultRuleSetPropertyFormat.ruleSetVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultRuleSetPropertyFormat; + }); + } +} 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..0030e616a360a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DnsNameAvailabilityResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response for the CheckDnsNameAvailability API service call. + */ +@Fluent +public final class DnsNameAvailabilityResultInner implements JsonSerializable { + /* + * Domain availability (True/False). + */ + private Boolean available; + + /** + * Creates an instance of DnsNameAvailabilityResultInner class. + */ + public DnsNameAvailabilityResultInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("available", this.available); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DnsNameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DnsNameAvailabilityResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DnsNameAvailabilityResultInner. + */ + public static DnsNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DnsNameAvailabilityResultInner deserializedDnsNameAvailabilityResultInner + = new DnsNameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("available".equals(fieldName)) { + deserializedDnsNameAvailabilityResultInner.available = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDnsNameAvailabilityResultInner; + }); + } +} 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..d40b979f56945 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationInner.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QosDefinition; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Differentiated Services Code Point configuration for any given network interface. + */ +@Fluent +public final class DscpConfigurationInner extends Resource { + /* + * Properties of the network interface. + */ + private DscpConfigurationPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of DscpConfigurationInner class. + */ + public DscpConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of the network interface. + * + * @return the innerProperties value. + */ + private DscpConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public DscpConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public DscpConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the markings property: List of markings to be used in the configuration. + * + * @return the markings value. + */ + public List markings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DscpConfigurationPropertiesFormat(); + } + this.innerProperties().withMarkings(markings); + return this; + } + + /** + * Get the sourceIpRanges property: Source IP ranges. + * + * @return the sourceIpRanges value. + */ + public List sourceIpRanges() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DscpConfigurationPropertiesFormat(); + } + this.innerProperties().withSourceIpRanges(sourceIpRanges); + return this; + } + + /** + * Get the destinationIpRanges property: Destination IP ranges. + * + * @return the destinationIpRanges value. + */ + public List destinationIpRanges() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DscpConfigurationPropertiesFormat(); + } + this.innerProperties().withDestinationIpRanges(destinationIpRanges); + return this; + } + + /** + * Get the sourcePortRanges property: Sources port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DscpConfigurationPropertiesFormat(); + } + this.innerProperties().withSourcePortRanges(sourcePortRanges); + return this; + } + + /** + * Get the destinationPortRanges property: Destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DscpConfigurationPropertiesFormat(); + } + this.innerProperties().withDestinationPortRanges(destinationPortRanges); + return this; + } + + /** + * Get the protocol property: RNM supported protocol types. + * + * @return the protocol value. + */ + public ProtocolType protocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new DscpConfigurationPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the qosDefinitionCollection property: QoS object definitions. + * + * @return the qosDefinitionCollection value. + */ + public List qosDefinitionCollection() { + return this.innerProperties() == null ? null : this.innerProperties().qosDefinitionCollection(); + } + + /** + * Set the qosDefinitionCollection property: QoS object definitions. + * + * @param qosDefinitionCollection the qosDefinitionCollection value to set. + * @return the DscpConfigurationInner object itself. + */ + public DscpConfigurationInner withQosDefinitionCollection(List qosDefinitionCollection) { + if (this.innerProperties() == null) { + this.innerProperties = new DscpConfigurationPropertiesFormat(); + } + this.innerProperties().withQosDefinitionCollection(qosDefinitionCollection); + return this; + } + + /** + * Get the qosCollectionId property: Qos Collection ID generated by RNM. + * + * @return the qosCollectionId value. + */ + public String qosCollectionId() { + return this.innerProperties() == null ? null : this.innerProperties().qosCollectionId(); + } + + /** + * Get the associatedNetworkInterfaces property: Associated Network Interfaces to the DSCP Configuration. + * + * @return the associatedNetworkInterfaces value. + */ + public List associatedNetworkInterfaces() { + return this.innerProperties() == null ? null : this.innerProperties().associatedNetworkInterfaces(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the DSCP Configuration resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the DSCP Configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DscpConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DscpConfigurationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DscpConfigurationInner. + */ + public static DscpConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DscpConfigurationInner deserializedDscpConfigurationInner = new DscpConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDscpConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDscpConfigurationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDscpConfigurationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDscpConfigurationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedDscpConfigurationInner.innerProperties + = DscpConfigurationPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedDscpConfigurationInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedDscpConfigurationInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDscpConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..b4f1db3e2322a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/DscpConfigurationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.QosDefinition; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import java.io.IOException; +import java.util.List; + +/** + * Differentiated Services Code Point configuration properties. + */ +@Fluent +public final class DscpConfigurationPropertiesFormat implements JsonSerializable { + /* + * List of markings to be used in the configuration. + */ + private List markings; + + /* + * Source IP ranges. + */ + private List sourceIpRanges; + + /* + * Destination IP ranges. + */ + private List destinationIpRanges; + + /* + * Sources port ranges. + */ + private List sourcePortRanges; + + /* + * Destination port ranges. + */ + private List destinationPortRanges; + + /* + * RNM supported protocol types. + */ + private ProtocolType protocol; + + /* + * QoS object definitions + */ + private List qosDefinitionCollection; + + /* + * Qos Collection ID generated by RNM. + */ + private String qosCollectionId; + + /* + * Associated Network Interfaces to the DSCP Configuration. + */ + private List associatedNetworkInterfaces; + + /* + * The resource GUID property of the DSCP Configuration resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the DSCP Configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DscpConfigurationPropertiesFormat class. + */ + public DscpConfigurationPropertiesFormat() { + } + + /** + * 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 DscpConfigurationPropertiesFormat object itself. + */ + public DscpConfigurationPropertiesFormat 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 DscpConfigurationPropertiesFormat object itself. + */ + public DscpConfigurationPropertiesFormat 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 DscpConfigurationPropertiesFormat object itself. + */ + public DscpConfigurationPropertiesFormat 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 DscpConfigurationPropertiesFormat object itself. + */ + public DscpConfigurationPropertiesFormat 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 DscpConfigurationPropertiesFormat object itself. + */ + public DscpConfigurationPropertiesFormat 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 DscpConfigurationPropertiesFormat object itself. + */ + public DscpConfigurationPropertiesFormat withProtocol(ProtocolType protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the qosDefinitionCollection property: QoS object definitions. + * + * @return the qosDefinitionCollection value. + */ + public List qosDefinitionCollection() { + return this.qosDefinitionCollection; + } + + /** + * Set the qosDefinitionCollection property: QoS object definitions. + * + * @param qosDefinitionCollection the qosDefinitionCollection value to set. + * @return the DscpConfigurationPropertiesFormat object itself. + */ + public DscpConfigurationPropertiesFormat withQosDefinitionCollection(List qosDefinitionCollection) { + this.qosDefinitionCollection = qosDefinitionCollection; + 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; + } + + /** + * 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 (qosDefinitionCollection() != null) { + qosDefinitionCollection().forEach(e -> e.validate()); + } + if (associatedNetworkInterfaces() != null) { + associatedNetworkInterfaces().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("markings", this.markings, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("sourceIpRanges", this.sourceIpRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("destinationIpRanges", this.destinationIpRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sourcePortRanges", this.sourcePortRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("destinationPortRanges", this.destinationPortRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeArrayField("qosDefinitionCollection", this.qosDefinitionCollection, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DscpConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DscpConfigurationPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DscpConfigurationPropertiesFormat. + */ + public static DscpConfigurationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DscpConfigurationPropertiesFormat deserializedDscpConfigurationPropertiesFormat + = new DscpConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("markings".equals(fieldName)) { + List markings = reader.readArray(reader1 -> reader1.getInt()); + deserializedDscpConfigurationPropertiesFormat.markings = markings; + } else if ("sourceIpRanges".equals(fieldName)) { + List sourceIpRanges = reader.readArray(reader1 -> QosIpRange.fromJson(reader1)); + deserializedDscpConfigurationPropertiesFormat.sourceIpRanges = sourceIpRanges; + } else if ("destinationIpRanges".equals(fieldName)) { + List destinationIpRanges = reader.readArray(reader1 -> QosIpRange.fromJson(reader1)); + deserializedDscpConfigurationPropertiesFormat.destinationIpRanges = destinationIpRanges; + } else if ("sourcePortRanges".equals(fieldName)) { + List sourcePortRanges = reader.readArray(reader1 -> QosPortRange.fromJson(reader1)); + deserializedDscpConfigurationPropertiesFormat.sourcePortRanges = sourcePortRanges; + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges + = reader.readArray(reader1 -> QosPortRange.fromJson(reader1)); + deserializedDscpConfigurationPropertiesFormat.destinationPortRanges = destinationPortRanges; + } else if ("protocol".equals(fieldName)) { + deserializedDscpConfigurationPropertiesFormat.protocol + = ProtocolType.fromString(reader.getString()); + } else if ("qosDefinitionCollection".equals(fieldName)) { + List qosDefinitionCollection + = reader.readArray(reader1 -> QosDefinition.fromJson(reader1)); + deserializedDscpConfigurationPropertiesFormat.qosDefinitionCollection = qosDefinitionCollection; + } else if ("qosCollectionId".equals(fieldName)) { + deserializedDscpConfigurationPropertiesFormat.qosCollectionId = reader.getString(); + } else if ("associatedNetworkInterfaces".equals(fieldName)) { + List associatedNetworkInterfaces + = reader.readArray(reader1 -> NetworkInterfaceInner.fromJson(reader1)); + deserializedDscpConfigurationPropertiesFormat.associatedNetworkInterfaces + = associatedNetworkInterfaces; + } else if ("resourceGuid".equals(fieldName)) { + deserializedDscpConfigurationPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedDscpConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDscpConfigurationPropertiesFormat; + }); + } +} 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..8f5bc3326dce9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveNetworkSecurityGroupListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.EffectiveNetworkSecurityGroup; +import java.io.IOException; +import java.util.List; + +/** + * Response for list effective network security groups API service call. + */ +@Fluent +public final class EffectiveNetworkSecurityGroupListResultInner + implements JsonSerializable { + /* + * A list of effective network security groups. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of EffectiveNetworkSecurityGroupListResultInner class. + */ + public EffectiveNetworkSecurityGroupListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveNetworkSecurityGroupListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveNetworkSecurityGroupListResultInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveNetworkSecurityGroupListResultInner. + */ + public static EffectiveNetworkSecurityGroupListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveNetworkSecurityGroupListResultInner deserializedEffectiveNetworkSecurityGroupListResultInner + = new EffectiveNetworkSecurityGroupListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EffectiveNetworkSecurityGroup.fromJson(reader1)); + deserializedEffectiveNetworkSecurityGroupListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEffectiveNetworkSecurityGroupListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveNetworkSecurityGroupListResultInner; + }); + } +} 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..28fe201309c6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.EffectiveRoute; +import java.io.IOException; +import java.util.List; + +/** + * Response for list effective route API service call. + */ +@Fluent +public final class EffectiveRouteListResultInner implements JsonSerializable { + /* + * A list of effective routes. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of EffectiveRouteListResultInner class. + */ + public EffectiveRouteListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveRouteListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveRouteListResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveRouteListResultInner. + */ + public static EffectiveRouteListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveRouteListResultInner deserializedEffectiveRouteListResultInner + = new EffectiveRouteListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EffectiveRoute.fromJson(reader1)); + deserializedEffectiveRouteListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEffectiveRouteListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveRouteListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteMapRouteListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteMapRouteListInner.java new file mode 100644 index 0000000000000..9f3a4fc109cce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EffectiveRouteMapRouteListInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteMapRoute; +import java.io.IOException; +import java.util.List; + +/** + * EffectiveRouteMapRoute List. + */ +@Fluent +public final class EffectiveRouteMapRouteListInner implements JsonSerializable { + /* + * The list of Effective RouteMap Routes configured on the connection resource. + */ + private List value; + + /** + * Creates an instance of EffectiveRouteMapRouteListInner class. + */ + public EffectiveRouteMapRouteListInner() { + } + + /** + * Get the value property: The list of Effective RouteMap Routes configured on the connection resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Effective RouteMap Routes configured on the connection resource. + * + * @param value the value value to set. + * @return the EffectiveRouteMapRouteListInner object itself. + */ + public EffectiveRouteMapRouteListInner 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveRouteMapRouteListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveRouteMapRouteListInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveRouteMapRouteListInner. + */ + public static EffectiveRouteMapRouteListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveRouteMapRouteListInner deserializedEffectiveRouteMapRouteListInner + = new EffectiveRouteMapRouteListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EffectiveRouteMapRoute.fromJson(reader1)); + deserializedEffectiveRouteMapRouteListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveRouteMapRouteListInner; + }); + } +} 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..13acb6cffe52f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/EndpointServiceResultInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Endpoint service. + */ +@Fluent +public final class EndpointServiceResultInner extends SubResource { + /* + * Name of the endpoint service. + */ + private String name; + + /* + * Type of the endpoint service. + */ + private String type; + + /** + * Creates an instance of EndpointServiceResultInner class. + */ + public EndpointServiceResultInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointServiceResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointServiceResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointServiceResultInner. + */ + public static EndpointServiceResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointServiceResultInner deserializedEndpointServiceResultInner = new EndpointServiceResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEndpointServiceResultInner.withId(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedEndpointServiceResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEndpointServiceResultInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointServiceResultInner; + }); + } +} 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..edd94e171e75b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitAuthorizationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Authorization in an ExpressRouteCircuit resource. + */ +@Fluent +public final class ExpressRouteCircuitAuthorizationInner extends SubResource { + /* + * Properties of the express route circuit authorization. + */ + private AuthorizationPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ExpressRouteCircuitAuthorizationInner class. + */ + public ExpressRouteCircuitAuthorizationInner() { + } + + /** + * Get the innerProperties property: Properties of the express route circuit authorization. + * + * @return the innerProperties value. + */ + private AuthorizationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCircuitAuthorizationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthorizationPropertiesFormat(); + } + this.innerProperties().withAuthorizationKey(authorizationKey); + return this; + } + + /** + * Get the authorizationUseStatus property: The authorization use status. + * + * @return the authorizationUseStatus value. + */ + public AuthorizationUseStatus authorizationUseStatus() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthorizationPropertiesFormat(); + } + this.innerProperties().withAuthorizationUseStatus(authorizationUseStatus); + return this; + } + + /** + * Get the connectionResourceUri property: The reference to the ExpressRoute connection resource using the + * authorization. + * + * @return the connectionResourceUri value. + */ + public String connectionResourceUri() { + return this.innerProperties() == null ? null : this.innerProperties().connectionResourceUri(); + } + + /** + * Get the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitAuthorizationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitAuthorizationInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitAuthorizationInner. + */ + public static ExpressRouteCircuitAuthorizationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitAuthorizationInner deserializedExpressRouteCircuitAuthorizationInner + = new ExpressRouteCircuitAuthorizationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteCircuitAuthorizationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteCircuitAuthorizationInner.innerProperties + = AuthorizationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedExpressRouteCircuitAuthorizationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteCircuitAuthorizationInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteCircuitAuthorizationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitAuthorizationInner; + }); + } +} 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..a624ce3ff5e14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ +@Fluent +public final class ExpressRouteCircuitConnectionInner extends SubResource { + /* + * Properties of the express route circuit connection. + */ + private ExpressRouteCircuitConnectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ExpressRouteCircuitConnectionInner class. + */ + public ExpressRouteCircuitConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the express route circuit connection. + * + * @return the innerProperties value. + */ + private ExpressRouteCircuitConnectionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCircuitConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withExpressRouteCircuitPeering(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withPeerExpressRouteCircuitPeering(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withAuthorizationKey(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withIpv6CircuitConnectionConfig(ipv6CircuitConnectionConfig); + return this; + } + + /** + * Get the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().circuitConnectionStatus(); + } + + /** + * Get the provisioningState property: The provisioning state of the express route circuit connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitConnectionInner. + */ + public static ExpressRouteCircuitConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitConnectionInner deserializedExpressRouteCircuitConnectionInner + = new ExpressRouteCircuitConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionInner.innerProperties + = ExpressRouteCircuitConnectionPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.java new file mode 100644 index 0000000000000..acb038eaac6cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitConnectionPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Properties of the express route circuit connection. + */ +@Fluent +public final class ExpressRouteCircuitConnectionPropertiesFormat + implements JsonSerializable { + /* + * Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. + */ + private SubResource expressRouteCircuitPeering; + + /* + * Reference to Express Route Circuit Private Peering Resource of the peered circuit. + */ + private SubResource peerExpressRouteCircuitPeering; + + /* + * /29 IP address space to carve out Customer addresses for tunnels. + */ + private String addressPrefix; + + /* + * The authorization key. + */ + private String authorizationKey; + + /* + * IPv6 Address PrefixProperties of the express route circuit connection. + */ + private Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig; + + /* + * Express Route Circuit connection state. + */ + private CircuitConnectionStatus circuitConnectionStatus; + + /* + * The provisioning state of the express route circuit connection resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ExpressRouteCircuitConnectionPropertiesFormat class. + */ + public ExpressRouteCircuitConnectionPropertiesFormat() { + } + + /** + * 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 ExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public ExpressRouteCircuitConnectionPropertiesFormat + 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 ExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public ExpressRouteCircuitConnectionPropertiesFormat + 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 ExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public ExpressRouteCircuitConnectionPropertiesFormat 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 ExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public ExpressRouteCircuitConnectionPropertiesFormat 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 ExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public ExpressRouteCircuitConnectionPropertiesFormat + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipv6CircuitConnectionConfig() != null) { + ipv6CircuitConnectionConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("expressRouteCircuitPeering", this.expressRouteCircuitPeering); + jsonWriter.writeJsonField("peerExpressRouteCircuitPeering", this.peerExpressRouteCircuitPeering); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeStringField("authorizationKey", this.authorizationKey); + jsonWriter.writeJsonField("ipv6CircuitConnectionConfig", this.ipv6CircuitConnectionConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitConnectionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitConnectionPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitConnectionPropertiesFormat. + */ + public static ExpressRouteCircuitConnectionPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitConnectionPropertiesFormat deserializedExpressRouteCircuitConnectionPropertiesFormat + = new ExpressRouteCircuitConnectionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expressRouteCircuitPeering".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionPropertiesFormat.expressRouteCircuitPeering + = SubResource.fromJson(reader); + } else if ("peerExpressRouteCircuitPeering".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionPropertiesFormat.peerExpressRouteCircuitPeering + = SubResource.fromJson(reader); + } else if ("addressPrefix".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionPropertiesFormat.addressPrefix = reader.getString(); + } else if ("authorizationKey".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionPropertiesFormat.authorizationKey = reader.getString(); + } else if ("ipv6CircuitConnectionConfig".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionPropertiesFormat.ipv6CircuitConnectionConfig + = Ipv6CircuitConnectionConfig.fromJson(reader); + } else if ("circuitConnectionStatus".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionPropertiesFormat.circuitConnectionStatus + = CircuitConnectionStatus.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitConnectionPropertiesFormat; + }); + } +} 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..d5adb86001186 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitInner.java @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * ExpressRouteCircuit resource. + */ +@Fluent +public final class ExpressRouteCircuitInner extends Resource { + /* + * The SKU. + */ + private ExpressRouteCircuitSku sku; + + /* + * Properties of the express route circuit. + */ + private ExpressRouteCircuitPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRouteCircuitInner class. + */ + public ExpressRouteCircuitInner() { + } + + /** + * 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 innerProperties property: Properties of the express route circuit. + * + * @return the innerProperties value. + */ + private ExpressRouteCircuitPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCircuitInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCircuitInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the allowClassicOperations property: Allow classic operations. + * + * @return the allowClassicOperations value. + */ + public Boolean allowClassicOperations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withAllowClassicOperations(allowClassicOperations); + return this; + } + + /** + * Get the circuitProvisioningState property: The CircuitProvisioningState state of the resource. + * + * @return the circuitProvisioningState value. + */ + public String circuitProvisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withCircuitProvisioningState(circuitProvisioningState); + return this; + } + + /** + * Get the serviceProviderProvisioningState property: The ServiceProviderProvisioningState state of the resource. + * + * @return the serviceProviderProvisioningState value. + */ + public ServiceProviderProvisioningState serviceProviderProvisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withServiceProviderProvisioningState(serviceProviderProvisioningState); + return this; + } + + /** + * Get the authorizations property: The list of authorizations. + * + * @return the authorizations value. + */ + public List authorizations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withAuthorizations(authorizations); + return this; + } + + /** + * Get the peerings property: The list of peerings. + * + * @return the peerings value. + */ + public List peerings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withPeerings(peerings); + return this; + } + + /** + * Get the serviceKey property: The ServiceKey. + * + * @return the serviceKey value. + */ + public String serviceKey() { + return this.innerProperties() == null ? null : this.innerProperties().serviceKey(); + } + + /** + * Set the serviceKey property: The ServiceKey. + * + * @param serviceKey the serviceKey value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceKey(String serviceKey) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withServiceKey(serviceKey); + return this; + } + + /** + * Get the serviceProviderNotes property: The ServiceProviderNotes. + * + * @return the serviceProviderNotes value. + */ + public String serviceProviderNotes() { + return this.innerProperties() == null ? null : this.innerProperties().serviceProviderNotes(); + } + + /** + * Set the serviceProviderNotes property: The ServiceProviderNotes. + * + * @param serviceProviderNotes the serviceProviderNotes value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withServiceProviderNotes(String serviceProviderNotes) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withServiceProviderNotes(serviceProviderNotes); + return this; + } + + /** + * Get the serviceProviderProperties property: The ServiceProviderProperties. + * + * @return the serviceProviderProperties value. + */ + public ExpressRouteCircuitServiceProviderProperties serviceProviderProperties() { + return this.innerProperties() == null ? null : this.innerProperties().serviceProviderProperties(); + } + + /** + * Set the serviceProviderProperties property: The ServiceProviderProperties. + * + * @param serviceProviderProperties the serviceProviderProperties value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner + withServiceProviderProperties(ExpressRouteCircuitServiceProviderProperties serviceProviderProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withServiceProviderProperties(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withExpressRoutePort(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withBandwidthInGbps(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.innerProperties() == null ? null : this.innerProperties().stag(); + } + + /** + * Get the provisioningState property: The provisioning state of the express route circuit resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + public String gatewayManagerEtag() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + /** + * Get the globalReachEnabled property: Flag denoting global reach status. + * + * @return the globalReachEnabled value. + */ + public Boolean globalReachEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withGlobalReachEnabled(globalReachEnabled); + return this; + } + + /** + * Get the authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); + } + + /** + * Set the authorizationKey property: The authorizationKey. + * + * @param authorizationKey the authorizationKey value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withAuthorizationKey(String authorizationKey) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withAuthorizationKey(authorizationKey); + return this; + } + + /** + * Get the authorizationStatus property: The authorization status of the Circuit. + * + * @return the authorizationStatus value. + */ + public String authorizationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationStatus(); + } + + /** + * Get the enableDirectPortRateLimit property: Flag denoting rate-limiting status of the ExpressRoute direct-port + * circuit. + * + * @return the enableDirectPortRateLimit value. + */ + public Boolean enableDirectPortRateLimit() { + return this.innerProperties() == null ? null : this.innerProperties().enableDirectPortRateLimit(); + } + + /** + * Set the enableDirectPortRateLimit property: Flag denoting rate-limiting status of the ExpressRoute direct-port + * circuit. + * + * @param enableDirectPortRateLimit the enableDirectPortRateLimit value to set. + * @return the ExpressRouteCircuitInner object itself. + */ + public ExpressRouteCircuitInner withEnableDirectPortRateLimit(Boolean enableDirectPortRateLimit) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPropertiesFormat(); + } + this.innerProperties().withEnableDirectPortRateLimit(enableDirectPortRateLimit); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitInner. + */ + public static ExpressRouteCircuitInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitInner deserializedExpressRouteCircuitInner = new ExpressRouteCircuitInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRouteCircuitInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteCircuitInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedExpressRouteCircuitInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedExpressRouteCircuitInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedExpressRouteCircuitInner.sku = ExpressRouteCircuitSku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteCircuitInner.innerProperties + = ExpressRouteCircuitPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteCircuitInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedExpressRouteCircuitInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitInner; + }); + } +} 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..ef95a2470588b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringInner.java @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Peering in an ExpressRouteCircuit resource. + */ +@Fluent +public final class ExpressRouteCircuitPeeringInner extends SubResource { + /* + * Properties of the express route circuit peering. + */ + private ExpressRouteCircuitPeeringPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ExpressRouteCircuitPeeringInner class. + */ + public ExpressRouteCircuitPeeringInner() { + } + + /** + * Get the innerProperties property: Properties of the express route circuit peering. + * + * @return the innerProperties value. + */ + private ExpressRouteCircuitPeeringPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCircuitPeeringInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the peeringType property: The peering type. + * + * @return the peeringType value. + */ + public ExpressRoutePeeringType peeringType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withPeeringType(peeringType); + return this; + } + + /** + * Get the state property: The peering state. + * + * @return the state value. + */ + public ExpressRoutePeeringState state() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + public Integer azureAsn() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withAzureAsn(azureAsn); + return this; + } + + /** + * Get the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withPeerAsn(peerAsn); + return this; + } + + /** + * Get the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + public String primaryPeerAddressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + /** + * Get the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + public String secondaryPeerAddressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + /** + * Get the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + public String primaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withPrimaryAzurePort(primaryAzurePort); + return this; + } + + /** + * Get the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + public String secondaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withSecondaryAzurePort(secondaryAzurePort); + return this; + } + + /** + * Get the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withSharedKey(sharedKey); + return this; + } + + /** + * Get the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withVlanId(vlanId); + return this; + } + + /** + * Get the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withMicrosoftPeeringConfig(microsoftPeeringConfig); + return this; + } + + /** + * Get the stats property: The peering stats of express route circuit. + * + * @return the stats value. + */ + public ExpressRouteCircuitStatsInner stats() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withStats(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + public String gatewayManagerEtag() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + /** + * Get the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the routeFilter property: The reference to the RouteFilter resource. + * + * @return the routeFilter value. + */ + public SubResource routeFilter() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withRouteFilter(routeFilter); + return this; + } + + /** + * Get the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + /** + * Get the expressRouteConnection property: The ExpressRoute connection. + * + * @return the expressRouteConnection value. + */ + public ExpressRouteConnectionId expressRouteConnection() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withExpressRouteConnection(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + } + this.innerProperties().withConnections(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.innerProperties() == null ? null : this.innerProperties().peeredConnections(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitPeeringInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitPeeringInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitPeeringInner. + */ + public static ExpressRouteCircuitPeeringInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitPeeringInner deserializedExpressRouteCircuitPeeringInner + = new ExpressRouteCircuitPeeringInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringInner.innerProperties + = ExpressRouteCircuitPeeringPropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitPeeringInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.java new file mode 100644 index 0000000000000..aad20b63d7ea9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPeeringPropertiesFormatInner.java @@ -0,0 +1,643 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Properties of the express route circuit peering. + */ +@Fluent +public final class ExpressRouteCircuitPeeringPropertiesFormatInner + implements JsonSerializable { + /* + * The peering type. + */ + private ExpressRoutePeeringType peeringType; + + /* + * The peering state. + */ + private ExpressRoutePeeringState state; + + /* + * The Azure ASN. + */ + private Integer azureAsn; + + /* + * The peer ASN. + */ + private Long peerAsn; + + /* + * The primary address prefix. + */ + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + private String secondaryPeerAddressPrefix; + + /* + * The primary port. + */ + private String primaryAzurePort; + + /* + * The secondary port. + */ + private String secondaryAzurePort; + + /* + * The shared key. + */ + private String sharedKey; + + /* + * The VLAN ID. + */ + private Integer vlanId; + + /* + * The Microsoft peering configuration. + */ + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The peering stats of express route circuit. + */ + private ExpressRouteCircuitStatsInner stats; + + /* + * The provisioning state of the express route circuit peering resource. + */ + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + private String gatewayManagerEtag; + + /* + * Who was the last to modify the peering. + */ + private String lastModifiedBy; + + /* + * The reference to the RouteFilter resource. + */ + private SubResource routeFilter; + + /* + * The IPv6 peering configuration. + */ + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /* + * The ExpressRoute connection. + */ + private ExpressRouteConnectionId expressRouteConnection; + + /* + * The list of circuit connections associated with Azure Private Peering for this circuit. + */ + private List connections; + + /* + * The list of peered circuit connections associated with Azure Private Peering for this circuit. + */ + private List peeredConnections; + + /** + * Creates an instance of ExpressRouteCircuitPeeringPropertiesFormatInner class. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner() { + } + + /** + * 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner + 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner + 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner + 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner + 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner + 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 ExpressRouteCircuitPeeringPropertiesFormatInner object itself. + */ + public ExpressRouteCircuitPeeringPropertiesFormatInner + 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("peeringType", this.peeringType == null ? null : this.peeringType.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeNumberField("azureASN", this.azureAsn); + jsonWriter.writeNumberField("peerASN", this.peerAsn); + jsonWriter.writeStringField("primaryPeerAddressPrefix", this.primaryPeerAddressPrefix); + jsonWriter.writeStringField("secondaryPeerAddressPrefix", this.secondaryPeerAddressPrefix); + jsonWriter.writeStringField("primaryAzurePort", this.primaryAzurePort); + jsonWriter.writeStringField("secondaryAzurePort", this.secondaryAzurePort); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeNumberField("vlanId", this.vlanId); + jsonWriter.writeJsonField("microsoftPeeringConfig", this.microsoftPeeringConfig); + jsonWriter.writeJsonField("stats", this.stats); + jsonWriter.writeStringField("gatewayManagerEtag", this.gatewayManagerEtag); + jsonWriter.writeJsonField("routeFilter", this.routeFilter); + jsonWriter.writeJsonField("ipv6PeeringConfig", this.ipv6PeeringConfig); + jsonWriter.writeJsonField("expressRouteConnection", this.expressRouteConnection); + jsonWriter.writeArrayField("connections", this.connections, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitPeeringPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitPeeringPropertiesFormatInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitPeeringPropertiesFormatInner. + */ + public static ExpressRouteCircuitPeeringPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitPeeringPropertiesFormatInner deserializedExpressRouteCircuitPeeringPropertiesFormatInner + = new ExpressRouteCircuitPeeringPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("peeringType".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.peeringType + = ExpressRoutePeeringType.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.state + = ExpressRoutePeeringState.fromString(reader.getString()); + } else if ("azureASN".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.azureAsn + = reader.getNullable(JsonReader::getInt); + } else if ("peerASN".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.peerAsn + = reader.getNullable(JsonReader::getLong); + } else if ("primaryPeerAddressPrefix".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.primaryPeerAddressPrefix + = reader.getString(); + } else if ("secondaryPeerAddressPrefix".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.secondaryPeerAddressPrefix + = reader.getString(); + } else if ("primaryAzurePort".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.primaryAzurePort = reader.getString(); + } else if ("secondaryAzurePort".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.secondaryAzurePort = reader.getString(); + } else if ("sharedKey".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.sharedKey = reader.getString(); + } else if ("vlanId".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.vlanId + = reader.getNullable(JsonReader::getInt); + } else if ("microsoftPeeringConfig".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.microsoftPeeringConfig + = ExpressRouteCircuitPeeringConfig.fromJson(reader); + } else if ("stats".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.stats + = ExpressRouteCircuitStatsInner.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("gatewayManagerEtag".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.gatewayManagerEtag = reader.getString(); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.lastModifiedBy = reader.getString(); + } else if ("routeFilter".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.routeFilter + = SubResource.fromJson(reader); + } else if ("ipv6PeeringConfig".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.ipv6PeeringConfig + = Ipv6ExpressRouteCircuitPeeringConfig.fromJson(reader); + } else if ("expressRouteConnection".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.expressRouteConnection + = ExpressRouteConnectionId.fromJson(reader); + } else if ("connections".equals(fieldName)) { + List connections + = reader.readArray(reader1 -> ExpressRouteCircuitConnectionInner.fromJson(reader1)); + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.connections = connections; + } else if ("peeredConnections".equals(fieldName)) { + List peeredConnections + = reader.readArray(reader1 -> PeerExpressRouteCircuitConnectionInner.fromJson(reader1)); + deserializedExpressRouteCircuitPeeringPropertiesFormatInner.peeredConnections = peeredConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitPeeringPropertiesFormatInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPropertiesFormat.java new file mode 100644 index 0000000000000..615c76d74113f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitPropertiesFormat.java @@ -0,0 +1,543 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitPropertiesFormat + implements JsonSerializable { + /* + * Allow classic operations. + */ + private Boolean allowClassicOperations; + + /* + * The CircuitProvisioningState state of the resource. + */ + private String circuitProvisioningState; + + /* + * The ServiceProviderProvisioningState state of the resource. + */ + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /* + * The list of authorizations. + */ + private List authorizations; + + /* + * The list of peerings. + */ + private List peerings; + + /* + * The ServiceKey. + */ + private String serviceKey; + + /* + * The ServiceProviderNotes. + */ + private String serviceProviderNotes; + + /* + * The ServiceProviderProperties. + */ + private ExpressRouteCircuitServiceProviderProperties serviceProviderProperties; + + /* + * The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. + */ + private SubResource expressRoutePort; + + /* + * The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. + */ + private Float bandwidthInGbps; + + /* + * The identifier of the circuit traffic. Outer tag for QinQ encapsulation. + */ + private Integer stag; + + /* + * The provisioning state of the express route circuit resource. + */ + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + private String gatewayManagerEtag; + + /* + * Flag denoting global reach status. + */ + private Boolean globalReachEnabled; + + /* + * The authorizationKey. + */ + private String authorizationKey; + + /* + * The authorization status of the Circuit. + */ + private String authorizationStatus; + + /* + * Flag denoting rate-limiting status of the ExpressRoute direct-port circuit. + */ + private Boolean enableDirectPortRateLimit; + + /** + * Creates an instance of ExpressRouteCircuitPropertiesFormat class. + */ + public ExpressRouteCircuitPropertiesFormat() { + } + + /** + * 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat + 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat + 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat + 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat withGlobalReachEnabled(Boolean globalReachEnabled) { + this.globalReachEnabled = globalReachEnabled; + return this; + } + + /** + * 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 ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat withAuthorizationKey(String authorizationKey) { + this.authorizationKey = authorizationKey; + return this; + } + + /** + * Get the authorizationStatus property: The authorization status of the Circuit. + * + * @return the authorizationStatus value. + */ + public String authorizationStatus() { + return this.authorizationStatus; + } + + /** + * Get the enableDirectPortRateLimit property: Flag denoting rate-limiting status of the ExpressRoute direct-port + * circuit. + * + * @return the enableDirectPortRateLimit value. + */ + public Boolean enableDirectPortRateLimit() { + return this.enableDirectPortRateLimit; + } + + /** + * Set the enableDirectPortRateLimit property: Flag denoting rate-limiting status of the ExpressRoute direct-port + * circuit. + * + * @param enableDirectPortRateLimit the enableDirectPortRateLimit value to set. + * @return the ExpressRouteCircuitPropertiesFormat object itself. + */ + public ExpressRouteCircuitPropertiesFormat withEnableDirectPortRateLimit(Boolean enableDirectPortRateLimit) { + this.enableDirectPortRateLimit = enableDirectPortRateLimit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authorizations() != null) { + authorizations().forEach(e -> e.validate()); + } + if (peerings() != null) { + peerings().forEach(e -> e.validate()); + } + if (serviceProviderProperties() != null) { + serviceProviderProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowClassicOperations", this.allowClassicOperations); + jsonWriter.writeStringField("circuitProvisioningState", this.circuitProvisioningState); + jsonWriter.writeStringField("serviceProviderProvisioningState", + this.serviceProviderProvisioningState == null ? null : this.serviceProviderProvisioningState.toString()); + jsonWriter.writeArrayField("authorizations", this.authorizations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("peerings", this.peerings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("serviceKey", this.serviceKey); + jsonWriter.writeStringField("serviceProviderNotes", this.serviceProviderNotes); + jsonWriter.writeJsonField("serviceProviderProperties", this.serviceProviderProperties); + jsonWriter.writeJsonField("expressRoutePort", this.expressRoutePort); + jsonWriter.writeNumberField("bandwidthInGbps", this.bandwidthInGbps); + jsonWriter.writeStringField("gatewayManagerEtag", this.gatewayManagerEtag); + jsonWriter.writeBooleanField("globalReachEnabled", this.globalReachEnabled); + jsonWriter.writeStringField("authorizationKey", this.authorizationKey); + jsonWriter.writeBooleanField("enableDirectPortRateLimit", this.enableDirectPortRateLimit); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitPropertiesFormat. + */ + public static ExpressRouteCircuitPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitPropertiesFormat deserializedExpressRouteCircuitPropertiesFormat + = new ExpressRouteCircuitPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowClassicOperations".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.allowClassicOperations + = reader.getNullable(JsonReader::getBoolean); + } else if ("circuitProvisioningState".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.circuitProvisioningState = reader.getString(); + } else if ("serviceProviderProvisioningState".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.serviceProviderProvisioningState + = ServiceProviderProvisioningState.fromString(reader.getString()); + } else if ("authorizations".equals(fieldName)) { + List authorizations + = reader.readArray(reader1 -> ExpressRouteCircuitAuthorizationInner.fromJson(reader1)); + deserializedExpressRouteCircuitPropertiesFormat.authorizations = authorizations; + } else if ("peerings".equals(fieldName)) { + List peerings + = reader.readArray(reader1 -> ExpressRouteCircuitPeeringInner.fromJson(reader1)); + deserializedExpressRouteCircuitPropertiesFormat.peerings = peerings; + } else if ("serviceKey".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.serviceKey = reader.getString(); + } else if ("serviceProviderNotes".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.serviceProviderNotes = reader.getString(); + } else if ("serviceProviderProperties".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.serviceProviderProperties + = ExpressRouteCircuitServiceProviderProperties.fromJson(reader); + } else if ("expressRoutePort".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.expressRoutePort = SubResource.fromJson(reader); + } else if ("bandwidthInGbps".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.bandwidthInGbps + = reader.getNullable(JsonReader::getFloat); + } else if ("stag".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.stag = reader.getNullable(JsonReader::getInt); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("gatewayManagerEtag".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.gatewayManagerEtag = reader.getString(); + } else if ("globalReachEnabled".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.globalReachEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("authorizationKey".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.authorizationKey = reader.getString(); + } else if ("authorizationStatus".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.authorizationStatus = reader.getString(); + } else if ("enableDirectPortRateLimit".equals(fieldName)) { + deserializedExpressRouteCircuitPropertiesFormat.enableDirectPortRateLimit + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitPropertiesFormat; + }); + } +} 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..b8550d03e4c0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitStatsInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains stats associated with the peering. + */ +@Fluent +public final class ExpressRouteCircuitStatsInner implements JsonSerializable { + /* + * The Primary BytesIn of the peering. + */ + private Long primarybytesIn; + + /* + * The primary BytesOut of the peering. + */ + private Long primarybytesOut; + + /* + * The secondary BytesIn of the peering. + */ + private Long secondarybytesIn; + + /* + * The secondary BytesOut of the peering. + */ + private Long secondarybytesOut; + + /** + * Creates an instance of ExpressRouteCircuitStatsInner class. + */ + public ExpressRouteCircuitStatsInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("primarybytesIn", this.primarybytesIn); + jsonWriter.writeNumberField("primarybytesOut", this.primarybytesOut); + jsonWriter.writeNumberField("secondarybytesIn", this.secondarybytesIn); + jsonWriter.writeNumberField("secondarybytesOut", this.secondarybytesOut); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitStatsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitStatsInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitStatsInner. + */ + public static ExpressRouteCircuitStatsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitStatsInner deserializedExpressRouteCircuitStatsInner + = new ExpressRouteCircuitStatsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primarybytesIn".equals(fieldName)) { + deserializedExpressRouteCircuitStatsInner.primarybytesIn = reader.getNullable(JsonReader::getLong); + } else if ("primarybytesOut".equals(fieldName)) { + deserializedExpressRouteCircuitStatsInner.primarybytesOut = reader.getNullable(JsonReader::getLong); + } else if ("secondarybytesIn".equals(fieldName)) { + deserializedExpressRouteCircuitStatsInner.secondarybytesIn + = reader.getNullable(JsonReader::getLong); + } else if ("secondarybytesOut".equals(fieldName)) { + deserializedExpressRouteCircuitStatsInner.secondarybytesOut + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitStatsInner; + }); + } +} 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..b991787ee456d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsArpTableListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitArpTable; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListArpTable associated with the Express Route Circuits API. + */ +@Fluent +public final class ExpressRouteCircuitsArpTableListResultInner + implements JsonSerializable { + /* + * A list of the ARP tables. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCircuitsArpTableListResultInner class. + */ + public ExpressRouteCircuitsArpTableListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitsArpTableListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitsArpTableListResultInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitsArpTableListResultInner. + */ + public static ExpressRouteCircuitsArpTableListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitsArpTableListResultInner deserializedExpressRouteCircuitsArpTableListResultInner + = new ExpressRouteCircuitsArpTableListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCircuitArpTable.fromJson(reader1)); + deserializedExpressRouteCircuitsArpTableListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCircuitsArpTableListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitsArpTableListResultInner; + }); + } +} 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..8f831e6def60f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTable; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableListResultInner + implements JsonSerializable { + /* + * The list of routes table. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCircuitsRoutesTableListResultInner class. + */ + public ExpressRouteCircuitsRoutesTableListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitsRoutesTableListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitsRoutesTableListResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitsRoutesTableListResultInner. + */ + public static ExpressRouteCircuitsRoutesTableListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitsRoutesTableListResultInner deserializedExpressRouteCircuitsRoutesTableListResultInner + = new ExpressRouteCircuitsRoutesTableListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCircuitRoutesTable.fromJson(reader1)); + deserializedExpressRouteCircuitsRoutesTableListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCircuitsRoutesTableListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitsRoutesTableListResultInner; + }); + } +} 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..9acf993759fa5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCircuitsRoutesTableSummaryListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitRoutesTableSummary; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListRoutesTable associated with the Express Route Circuits API. + */ +@Fluent +public final class ExpressRouteCircuitsRoutesTableSummaryListResultInner + implements JsonSerializable { + /* + * A list of the routes table. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCircuitsRoutesTableSummaryListResultInner class. + */ + public ExpressRouteCircuitsRoutesTableSummaryListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitsRoutesTableSummaryListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitsRoutesTableSummaryListResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitsRoutesTableSummaryListResultInner. + */ + public static ExpressRouteCircuitsRoutesTableSummaryListResultInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitsRoutesTableSummaryListResultInner deserializedExpressRouteCircuitsRoutesTableSummaryListResultInner + = new ExpressRouteCircuitsRoutesTableSummaryListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCircuitRoutesTableSummary.fromJson(reader1)); + deserializedExpressRouteCircuitsRoutesTableSummaryListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCircuitsRoutesTableSummaryListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitsRoutesTableSummaryListResultInner; + }); + } +} 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..d16a5199ad9ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionInner.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft 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.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * ExpressRouteConnection resource. + */ +@Fluent +public final class ExpressRouteConnectionInner extends SubResource { + /* + * Properties of the express route connection. + */ + private ExpressRouteConnectionProperties innerProperties; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRouteConnectionInner class. + */ + public ExpressRouteConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the express route connection. + * + * @return the innerProperties value. + */ + private ExpressRouteConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the expressRouteCircuitPeering property: The ExpressRoute circuit peering. + * + * @return the expressRouteCircuitPeering value. + */ + public ExpressRouteCircuitPeeringId expressRouteCircuitPeering() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteConnectionProperties(); + } + this.innerProperties().withExpressRouteCircuitPeering(expressRouteCircuitPeering); + return this; + } + + /** + * Get the authorizationKey property: Authorization key to establish the connection. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteConnectionProperties(); + } + this.innerProperties().withAuthorizationKey(authorizationKey); + return this; + } + + /** + * Get the routingWeight property: The routing weight associated to the connection. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteConnectionProperties(); + } + this.innerProperties().withRoutingWeight(routingWeight); + return this; + } + + /** + * Get the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteConnectionProperties(); + } + this.innerProperties().withEnableInternetSecurity(enableInternetSecurity); + return this; + } + + /** + * Get the expressRouteGatewayBypass property: Enable FastPath to vWan Firewall hub. + * + * @return the expressRouteGatewayBypass value. + */ + public Boolean expressRouteGatewayBypass() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteConnectionProperties(); + } + this.innerProperties().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + /** + * Get the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + public Boolean enablePrivateLinkFastPath() { + return this.innerProperties() == null ? null : this.innerProperties().enablePrivateLinkFastPath(); + } + + /** + * Set the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @param enablePrivateLinkFastPath the enablePrivateLinkFastPath value to set. + * @return the ExpressRouteConnectionInner object itself. + */ + public ExpressRouteConnectionInner withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteConnectionProperties(); + } + this.innerProperties().withEnablePrivateLinkFastPath(enablePrivateLinkFastPath); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteConnectionProperties(); + } + this.innerProperties().withRoutingConfiguration(routingConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ExpressRouteConnectionInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteConnectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteConnectionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteConnectionInner. + */ + public static ExpressRouteConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteConnectionInner deserializedExpressRouteConnectionInner = new ExpressRouteConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteConnectionInner.withId(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedExpressRouteConnectionInner.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteConnectionInner.innerProperties + = ExpressRouteConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteConnectionInner; + }); + } +} 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..f9bb052c25817 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionListInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRouteConnection list. + */ +@Fluent +public final class ExpressRouteConnectionListInner implements JsonSerializable { + /* + * The list of ExpressRoute connections. + */ + private List value; + + /** + * Creates an instance of ExpressRouteConnectionListInner class. + */ + public ExpressRouteConnectionListInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteConnectionListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteConnectionListInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteConnectionListInner. + */ + public static ExpressRouteConnectionListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteConnectionListInner deserializedExpressRouteConnectionListInner + = new ExpressRouteConnectionListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteConnectionInner.fromJson(reader1)); + deserializedExpressRouteConnectionListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteConnectionListInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionProperties.java new file mode 100644 index 0000000000000..18d3d4a60fb04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteConnectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Properties of the ExpressRouteConnection subresource. + */ +@Fluent +public final class ExpressRouteConnectionProperties implements JsonSerializable { + /* + * The provisioning state of the express route connection resource. + */ + private ProvisioningState provisioningState; + + /* + * The ExpressRoute circuit peering. + */ + private ExpressRouteCircuitPeeringId expressRouteCircuitPeering; + + /* + * Authorization key to establish the connection. + */ + private String authorizationKey; + + /* + * The routing weight associated to the connection. + */ + private Integer routingWeight; + + /* + * Enable internet security. + */ + private Boolean enableInternetSecurity; + + /* + * Enable FastPath to vWan Firewall hub. + */ + private Boolean expressRouteGatewayBypass; + + /* + * Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) + * must be enabled. + */ + private Boolean enablePrivateLinkFastPath; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + private RoutingConfiguration routingConfiguration; + + /** + * Creates an instance of ExpressRouteConnectionProperties class. + */ + public ExpressRouteConnectionProperties() { + } + + /** + * 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 ExpressRouteConnectionProperties object itself. + */ + public ExpressRouteConnectionProperties + 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 ExpressRouteConnectionProperties object itself. + */ + public ExpressRouteConnectionProperties 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 ExpressRouteConnectionProperties object itself. + */ + public ExpressRouteConnectionProperties 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 ExpressRouteConnectionProperties object itself. + */ + public ExpressRouteConnectionProperties 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 ExpressRouteConnectionProperties object itself. + */ + public ExpressRouteConnectionProperties withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + public Boolean enablePrivateLinkFastPath() { + return this.enablePrivateLinkFastPath; + } + + /** + * Set the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @param enablePrivateLinkFastPath the enablePrivateLinkFastPath value to set. + * @return the ExpressRouteConnectionProperties object itself. + */ + public ExpressRouteConnectionProperties withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath) { + this.enablePrivateLinkFastPath = enablePrivateLinkFastPath; + 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 ExpressRouteConnectionProperties object itself. + */ + public ExpressRouteConnectionProperties withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + this.routingConfiguration = routingConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (expressRouteCircuitPeering() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property expressRouteCircuitPeering in model ExpressRouteConnectionProperties")); + } else { + expressRouteCircuitPeering().validate(); + } + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("expressRouteCircuitPeering", this.expressRouteCircuitPeering); + jsonWriter.writeStringField("authorizationKey", this.authorizationKey); + jsonWriter.writeNumberField("routingWeight", this.routingWeight); + jsonWriter.writeBooleanField("enableInternetSecurity", this.enableInternetSecurity); + jsonWriter.writeBooleanField("expressRouteGatewayBypass", this.expressRouteGatewayBypass); + jsonWriter.writeBooleanField("enablePrivateLinkFastPath", this.enablePrivateLinkFastPath); + jsonWriter.writeJsonField("routingConfiguration", this.routingConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteConnectionProperties. + */ + public static ExpressRouteConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteConnectionProperties deserializedExpressRouteConnectionProperties + = new ExpressRouteConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expressRouteCircuitPeering".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.expressRouteCircuitPeering + = ExpressRouteCircuitPeeringId.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("authorizationKey".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.authorizationKey = reader.getString(); + } else if ("routingWeight".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.routingWeight = reader.getNullable(JsonReader::getInt); + } else if ("enableInternetSecurity".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.enableInternetSecurity + = reader.getNullable(JsonReader::getBoolean); + } else if ("expressRouteGatewayBypass".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.expressRouteGatewayBypass + = reader.getNullable(JsonReader::getBoolean); + } else if ("enablePrivateLinkFastPath".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.enablePrivateLinkFastPath + = reader.getNullable(JsonReader::getBoolean); + } else if ("routingConfiguration".equals(fieldName)) { + deserializedExpressRouteConnectionProperties.routingConfiguration + = RoutingConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteConnectionProperties; + }); + } +} 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..ff19f9ffe7dff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionInner.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * ExpressRouteCrossConnection resource. + */ +@Fluent +public final class ExpressRouteCrossConnectionInner extends Resource { + /* + * Properties of the express route cross connection. + */ + private ExpressRouteCrossConnectionProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRouteCrossConnectionInner class. + */ + public ExpressRouteCrossConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the express route cross connection. + * + * @return the innerProperties value. + */ + private ExpressRouteCrossConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCrossConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCrossConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the primaryAzurePort property: The name of the primary port. + * + * @return the primaryAzurePort value. + */ + public String primaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().primaryAzurePort(); + } + + /** + * Get the secondaryAzurePort property: The name of the secondary port. + * + * @return the secondaryAzurePort value. + */ + public String secondaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryAzurePort(); + } + + /** + * Get the stag property: The identifier of the circuit traffic. + * + * @return the stag value. + */ + public Integer stag() { + return this.innerProperties() == null ? null : this.innerProperties().stag(); + } + + /** + * Get the peeringLocation property: The peering location of the ExpressRoute circuit. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.innerProperties() == null ? null : this.innerProperties().peeringLocation(); + } + + /** + * Get the bandwidthInMbps property: The circuit bandwidth In Mbps. + * + * @return the bandwidthInMbps value. + */ + public Integer bandwidthInMbps() { + return this.innerProperties() == null ? null : this.innerProperties().bandwidthInMbps(); + } + + /** + * Get the expressRouteCircuit property: The ExpressRouteCircuit. + * + * @return the expressRouteCircuit value. + */ + public ExpressRouteCircuitReference expressRouteCircuit() { + return this.innerProperties() == null ? null : this.innerProperties().expressRouteCircuit(); + } + + /** + * Set the expressRouteCircuit property: The ExpressRouteCircuit. + * + * @param expressRouteCircuit the expressRouteCircuit value to set. + * @return the ExpressRouteCrossConnectionInner object itself. + */ + public ExpressRouteCrossConnectionInner withExpressRouteCircuit(ExpressRouteCircuitReference expressRouteCircuit) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionProperties(); + } + this.innerProperties().withExpressRouteCircuit(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionProperties(); + } + this.innerProperties().withServiceProviderProvisioningState(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionProperties(); + } + this.innerProperties().withServiceProviderNotes(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the peerings property: The list of peerings. + * + * @return the peerings value. + */ + public List peerings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionProperties(); + } + this.innerProperties().withPeerings(peerings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteCrossConnectionInner. + */ + public static ExpressRouteCrossConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionInner deserializedExpressRouteCrossConnectionInner + = new ExpressRouteCrossConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRouteCrossConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteCrossConnectionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedExpressRouteCrossConnectionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedExpressRouteCrossConnectionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteCrossConnectionInner.innerProperties + = ExpressRouteCrossConnectionProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteCrossConnectionInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedExpressRouteCrossConnectionInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionInner; + }); + } +} 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..29f81dda2ad60 --- /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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Peering in an ExpressRoute Cross Connection resource. + */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringInner extends SubResource { + /* + * Properties of the express route cross connection peering. + */ + private ExpressRouteCrossConnectionPeeringProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of ExpressRouteCrossConnectionPeeringInner class. + */ + public ExpressRouteCrossConnectionPeeringInner() { + } + + /** + * Get the innerProperties property: Properties of the express route cross connection peering. + * + * @return the innerProperties value. + */ + private ExpressRouteCrossConnectionPeeringProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteCrossConnectionPeeringInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the peeringType property: The peering type. + * + * @return the peeringType value. + */ + public ExpressRoutePeeringType peeringType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withPeeringType(peeringType); + return this; + } + + /** + * Get the state property: The peering state. + * + * @return the state value. + */ + public ExpressRoutePeeringState state() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the azureAsn property: The Azure ASN. + * + * @return the azureAsn value. + */ + public Integer azureAsn() { + return this.innerProperties() == null ? null : this.innerProperties().azureAsn(); + } + + /** + * Get the peerAsn property: The peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withPeerAsn(peerAsn); + return this; + } + + /** + * Get the primaryPeerAddressPrefix property: The primary address prefix. + * + * @return the primaryPeerAddressPrefix value. + */ + public String primaryPeerAddressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withPrimaryPeerAddressPrefix(primaryPeerAddressPrefix); + return this; + } + + /** + * Get the secondaryPeerAddressPrefix property: The secondary address prefix. + * + * @return the secondaryPeerAddressPrefix value. + */ + public String secondaryPeerAddressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withSecondaryPeerAddressPrefix(secondaryPeerAddressPrefix); + return this; + } + + /** + * Get the primaryAzurePort property: The primary port. + * + * @return the primaryAzurePort value. + */ + public String primaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().primaryAzurePort(); + } + + /** + * Get the secondaryAzurePort property: The secondary port. + * + * @return the secondaryAzurePort value. + */ + public String secondaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryAzurePort(); + } + + /** + * Get the sharedKey property: The shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withSharedKey(sharedKey); + return this; + } + + /** + * Get the vlanId property: The VLAN ID. + * + * @return the vlanId value. + */ + public Integer vlanId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withVlanId(vlanId); + return this; + } + + /** + * Get the microsoftPeeringConfig property: The Microsoft peering configuration. + * + * @return the microsoftPeeringConfig value. + */ + public ExpressRouteCircuitPeeringConfig microsoftPeeringConfig() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withMicrosoftPeeringConfig(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the gatewayManagerEtag property: The GatewayManager Etag. + * + * @return the gatewayManagerEtag value. + */ + public String gatewayManagerEtag() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withGatewayManagerEtag(gatewayManagerEtag); + return this; + } + + /** + * Get the lastModifiedBy property: Who was the last to modify the peering. + * + * @return the lastModifiedBy value. + */ + public String lastModifiedBy() { + return this.innerProperties() == null ? null : this.innerProperties().lastModifiedBy(); + } + + /** + * Get the ipv6PeeringConfig property: The IPv6 peering configuration. + * + * @return the ipv6PeeringConfig value. + */ + public Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteCrossConnectionPeeringProperties(); + } + this.innerProperties().withIpv6PeeringConfig(ipv6PeeringConfig); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionPeeringInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionPeeringInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCrossConnectionPeeringInner. + */ + public static ExpressRouteCrossConnectionPeeringInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionPeeringInner deserializedExpressRouteCrossConnectionPeeringInner + = new ExpressRouteCrossConnectionPeeringInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringInner.innerProperties + = ExpressRouteCrossConnectionPeeringProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionPeeringInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringProperties.java new file mode 100644 index 0000000000000..737d01095f569 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionPeeringProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import 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 java.io.IOException; + +/** + * Properties of express route cross connection peering. + */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringProperties + implements JsonSerializable { + /* + * The peering type. + */ + private ExpressRoutePeeringType peeringType; + + /* + * The peering state. + */ + private ExpressRoutePeeringState state; + + /* + * The Azure ASN. + */ + private Integer azureAsn; + + /* + * The peer ASN. + */ + private Long peerAsn; + + /* + * The primary address prefix. + */ + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + private String secondaryPeerAddressPrefix; + + /* + * The primary port. + */ + private String primaryAzurePort; + + /* + * The secondary port. + */ + private String secondaryAzurePort; + + /* + * The shared key. + */ + private String sharedKey; + + /* + * The VLAN ID. + */ + private Integer vlanId; + + /* + * The Microsoft peering configuration. + */ + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The provisioning state of the express route cross connection peering resource. + */ + private ProvisioningState provisioningState; + + /* + * The GatewayManager Etag. + */ + private String gatewayManagerEtag; + + /* + * Who was the last to modify the peering. + */ + private String lastModifiedBy; + + /* + * The IPv6 peering configuration. + */ + private Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig; + + /** + * Creates an instance of ExpressRouteCrossConnectionPeeringProperties class. + */ + public ExpressRouteCrossConnectionPeeringProperties() { + } + + /** + * 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties + 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties + 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties 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 ExpressRouteCrossConnectionPeeringProperties object itself. + */ + public ExpressRouteCrossConnectionPeeringProperties + withIpv6PeeringConfig(Ipv6ExpressRouteCircuitPeeringConfig ipv6PeeringConfig) { + this.ipv6PeeringConfig = ipv6PeeringConfig; + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("peeringType", this.peeringType == null ? null : this.peeringType.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeNumberField("peerASN", this.peerAsn); + jsonWriter.writeStringField("primaryPeerAddressPrefix", this.primaryPeerAddressPrefix); + jsonWriter.writeStringField("secondaryPeerAddressPrefix", this.secondaryPeerAddressPrefix); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeNumberField("vlanId", this.vlanId); + jsonWriter.writeJsonField("microsoftPeeringConfig", this.microsoftPeeringConfig); + jsonWriter.writeStringField("gatewayManagerEtag", this.gatewayManagerEtag); + jsonWriter.writeJsonField("ipv6PeeringConfig", this.ipv6PeeringConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionPeeringProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionPeeringProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCrossConnectionPeeringProperties. + */ + public static ExpressRouteCrossConnectionPeeringProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionPeeringProperties deserializedExpressRouteCrossConnectionPeeringProperties + = new ExpressRouteCrossConnectionPeeringProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("peeringType".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.peeringType + = ExpressRoutePeeringType.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.state + = ExpressRoutePeeringState.fromString(reader.getString()); + } else if ("azureASN".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.azureAsn + = reader.getNullable(JsonReader::getInt); + } else if ("peerASN".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.peerAsn + = reader.getNullable(JsonReader::getLong); + } else if ("primaryPeerAddressPrefix".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.primaryPeerAddressPrefix + = reader.getString(); + } else if ("secondaryPeerAddressPrefix".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.secondaryPeerAddressPrefix + = reader.getString(); + } else if ("primaryAzurePort".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.primaryAzurePort = reader.getString(); + } else if ("secondaryAzurePort".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.secondaryAzurePort = reader.getString(); + } else if ("sharedKey".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.sharedKey = reader.getString(); + } else if ("vlanId".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.vlanId + = reader.getNullable(JsonReader::getInt); + } else if ("microsoftPeeringConfig".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.microsoftPeeringConfig + = ExpressRouteCircuitPeeringConfig.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("gatewayManagerEtag".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.gatewayManagerEtag = reader.getString(); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.lastModifiedBy = reader.getString(); + } else if ("ipv6PeeringConfig".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringProperties.ipv6PeeringConfig + = Ipv6ExpressRouteCircuitPeeringConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionPeeringProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionProperties.java new file mode 100644 index 0000000000000..cc00e1250e73c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitReference; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of ExpressRouteCrossConnection. + */ +@Fluent +public final class ExpressRouteCrossConnectionProperties + implements JsonSerializable { + /* + * The name of the primary port. + */ + private String primaryAzurePort; + + /* + * The name of the secondary port. + */ + private String secondaryAzurePort; + + /* + * The identifier of the circuit traffic. + */ + private Integer stag; + + /* + * The peering location of the ExpressRoute circuit. + */ + private String peeringLocation; + + /* + * The circuit bandwidth In Mbps. + */ + private Integer bandwidthInMbps; + + /* + * The ExpressRouteCircuit. + */ + private ExpressRouteCircuitReference expressRouteCircuit; + + /* + * The provisioning state of the circuit in the connectivity provider system. + */ + private ServiceProviderProvisioningState serviceProviderProvisioningState; + + /* + * Additional read only notes set by the connectivity provider. + */ + private String serviceProviderNotes; + + /* + * The provisioning state of the express route cross connection resource. + */ + private ProvisioningState provisioningState; + + /* + * The list of peerings. + */ + private List peerings; + + /** + * Creates an instance of ExpressRouteCrossConnectionProperties class. + */ + public ExpressRouteCrossConnectionProperties() { + } + + /** + * 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 ExpressRouteCrossConnectionProperties object itself. + */ + public ExpressRouteCrossConnectionProperties + 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 ExpressRouteCrossConnectionProperties object itself. + */ + public ExpressRouteCrossConnectionProperties + 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 ExpressRouteCrossConnectionProperties object itself. + */ + public ExpressRouteCrossConnectionProperties 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 ExpressRouteCrossConnectionProperties object itself. + */ + public ExpressRouteCrossConnectionProperties withPeerings(List peerings) { + this.peerings = peerings; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("expressRouteCircuit", this.expressRouteCircuit); + jsonWriter.writeStringField("serviceProviderProvisioningState", + this.serviceProviderProvisioningState == null ? null : this.serviceProviderProvisioningState.toString()); + jsonWriter.writeStringField("serviceProviderNotes", this.serviceProviderNotes); + jsonWriter.writeArrayField("peerings", this.peerings, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCrossConnectionProperties. + */ + public static ExpressRouteCrossConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionProperties deserializedExpressRouteCrossConnectionProperties + = new ExpressRouteCrossConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primaryAzurePort".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.primaryAzurePort = reader.getString(); + } else if ("secondaryAzurePort".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.secondaryAzurePort = reader.getString(); + } else if ("sTag".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.stag = reader.getNullable(JsonReader::getInt); + } else if ("peeringLocation".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.peeringLocation = reader.getString(); + } else if ("bandwidthInMbps".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.bandwidthInMbps + = reader.getNullable(JsonReader::getInt); + } else if ("expressRouteCircuit".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.expressRouteCircuit + = ExpressRouteCircuitReference.fromJson(reader); + } else if ("serviceProviderProvisioningState".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.serviceProviderProvisioningState + = ServiceProviderProvisioningState.fromString(reader.getString()); + } else if ("serviceProviderNotes".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.serviceProviderNotes = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteCrossConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("peerings".equals(fieldName)) { + List peerings + = reader.readArray(reader1 -> ExpressRouteCrossConnectionPeeringInner.fromJson(reader1)); + deserializedExpressRouteCrossConnectionProperties.peerings = peerings; + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionProperties; + }); + } +} 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..1a95b9ea19dcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnectionRoutesTableSummary; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListRoutesTable associated with the Express Route Cross Connections. + */ +@Fluent +public final class ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner + implements JsonSerializable { + /* + * A list of the routes table. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner class. + */ + public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner. + */ + public static ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner deserializedExpressRouteCrossConnectionsRoutesTableSummaryListResultInner + = new ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCrossConnectionRoutesTableSummary.fromJson(reader1)); + deserializedExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCrossConnectionsRoutesTableSummaryListResultInner.nextLink + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionsRoutesTableSummaryListResultInner; + }); + } +} 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..56901d63f1889 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * ExpressRoute gateway resource. + */ +@Fluent +public final class ExpressRouteGatewayInner extends Resource { + /* + * Properties of the express route gateway. + */ + private ExpressRouteGatewayProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRouteGatewayInner class. + */ + public ExpressRouteGatewayInner() { + } + + /** + * Get the innerProperties property: Properties of the express route gateway. + * + * @return the innerProperties value. + */ + private ExpressRouteGatewayProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the autoScaleConfiguration property: Configuration for auto scaling. + * + * @return the autoScaleConfiguration value. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteGatewayProperties(); + } + this.innerProperties().withAutoScaleConfiguration(autoScaleConfiguration); + return this; + } + + /** + * Get the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute gateway. + * + * @return the expressRouteConnections value. + */ + public List expressRouteConnections() { + return this.innerProperties() == null ? null : this.innerProperties().expressRouteConnections(); + } + + /** + * Set the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute gateway. + * + * @param expressRouteConnections the expressRouteConnections value to set. + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner + withExpressRouteConnections(List expressRouteConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteGatewayProperties(); + } + this.innerProperties().withExpressRouteConnections(expressRouteConnections); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the express route gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteGatewayProperties(); + } + this.innerProperties().withVirtualHub(virtualHub); + return this; + } + + /** + * Get the allowNonVirtualWanTraffic property: Configures this gateway to accept traffic from non Virtual WAN + * networks. + * + * @return the allowNonVirtualWanTraffic value. + */ + public Boolean allowNonVirtualWanTraffic() { + return this.innerProperties() == null ? null : this.innerProperties().allowNonVirtualWanTraffic(); + } + + /** + * Set the allowNonVirtualWanTraffic property: Configures this gateway to accept traffic from non Virtual WAN + * networks. + * + * @param allowNonVirtualWanTraffic the allowNonVirtualWanTraffic value to set. + * @return the ExpressRouteGatewayInner object itself. + */ + public ExpressRouteGatewayInner withAllowNonVirtualWanTraffic(Boolean allowNonVirtualWanTraffic) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteGatewayProperties(); + } + this.innerProperties().withAllowNonVirtualWanTraffic(allowNonVirtualWanTraffic); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteGatewayInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteGatewayInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteGatewayInner. + */ + public static ExpressRouteGatewayInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteGatewayInner deserializedExpressRouteGatewayInner = new ExpressRouteGatewayInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRouteGatewayInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteGatewayInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedExpressRouteGatewayInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedExpressRouteGatewayInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteGatewayInner.innerProperties + = ExpressRouteGatewayProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteGatewayInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedExpressRouteGatewayInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteGatewayInner; + }); + } +} 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..d9fa753d87cf0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayListInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of ExpressRoute gateways. + */ +@Fluent +public final class ExpressRouteGatewayListInner implements JsonSerializable { + /* + * List of ExpressRoute gateways. + */ + private List value; + + /** + * Creates an instance of ExpressRouteGatewayListInner class. + */ + public ExpressRouteGatewayListInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteGatewayListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteGatewayListInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteGatewayListInner. + */ + public static ExpressRouteGatewayListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteGatewayListInner deserializedExpressRouteGatewayListInner = new ExpressRouteGatewayListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteGatewayInner.fromJson(reader1)); + deserializedExpressRouteGatewayListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteGatewayListInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayProperties.java new file mode 100644 index 0000000000000..66f8e579b52c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteGatewayProperties.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRoute gateway resource properties. + */ +@Fluent +public final class ExpressRouteGatewayProperties implements JsonSerializable { + /* + * Configuration for auto scaling. + */ + private ExpressRouteGatewayPropertiesAutoScaleConfiguration autoScaleConfiguration; + + /* + * List of ExpressRoute connections to the ExpressRoute gateway. + */ + private List expressRouteConnections; + + /* + * The provisioning state of the express route gateway resource. + */ + private ProvisioningState provisioningState; + + /* + * The Virtual Hub where the ExpressRoute gateway is or will be deployed. + */ + private VirtualHubId virtualHub; + + /* + * Configures this gateway to accept traffic from non Virtual WAN networks. + */ + private Boolean allowNonVirtualWanTraffic; + + /** + * Creates an instance of ExpressRouteGatewayProperties class. + */ + public ExpressRouteGatewayProperties() { + } + + /** + * 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 ExpressRouteGatewayProperties object itself. + */ + public ExpressRouteGatewayProperties + 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; + } + + /** + * Set the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute gateway. + * + * @param expressRouteConnections the expressRouteConnections value to set. + * @return the ExpressRouteGatewayProperties object itself. + */ + public ExpressRouteGatewayProperties + withExpressRouteConnections(List expressRouteConnections) { + this.expressRouteConnections = expressRouteConnections; + return this; + } + + /** + * 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 ExpressRouteGatewayProperties object itself. + */ + public ExpressRouteGatewayProperties withVirtualHub(VirtualHubId virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Get the allowNonVirtualWanTraffic property: Configures this gateway to accept traffic from non Virtual WAN + * networks. + * + * @return the allowNonVirtualWanTraffic value. + */ + public Boolean allowNonVirtualWanTraffic() { + return this.allowNonVirtualWanTraffic; + } + + /** + * Set the allowNonVirtualWanTraffic property: Configures this gateway to accept traffic from non Virtual WAN + * networks. + * + * @param allowNonVirtualWanTraffic the allowNonVirtualWanTraffic value to set. + * @return the ExpressRouteGatewayProperties object itself. + */ + public ExpressRouteGatewayProperties withAllowNonVirtualWanTraffic(Boolean allowNonVirtualWanTraffic) { + this.allowNonVirtualWanTraffic = allowNonVirtualWanTraffic; + 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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualHub in model ExpressRouteGatewayProperties")); + } else { + virtualHub().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteGatewayProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualHub", this.virtualHub); + jsonWriter.writeJsonField("autoScaleConfiguration", this.autoScaleConfiguration); + jsonWriter.writeArrayField("expressRouteConnections", this.expressRouteConnections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("allowNonVirtualWanTraffic", this.allowNonVirtualWanTraffic); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteGatewayProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteGatewayProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteGatewayProperties. + */ + public static ExpressRouteGatewayProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteGatewayProperties deserializedExpressRouteGatewayProperties + = new ExpressRouteGatewayProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualHub".equals(fieldName)) { + deserializedExpressRouteGatewayProperties.virtualHub = VirtualHubId.fromJson(reader); + } else if ("autoScaleConfiguration".equals(fieldName)) { + deserializedExpressRouteGatewayProperties.autoScaleConfiguration + = ExpressRouteGatewayPropertiesAutoScaleConfiguration.fromJson(reader); + } else if ("expressRouteConnections".equals(fieldName)) { + List expressRouteConnections + = reader.readArray(reader1 -> ExpressRouteConnectionInner.fromJson(reader1)); + deserializedExpressRouteGatewayProperties.expressRouteConnections = expressRouteConnections; + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteGatewayProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("allowNonVirtualWanTraffic".equals(fieldName)) { + deserializedExpressRouteGatewayProperties.allowNonVirtualWanTraffic + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteGatewayProperties; + }); + } +} 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..931cd28736a02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkInner.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * ExpressRouteLink + * + * ExpressRouteLink child resource definition. + */ +@Fluent +public final class ExpressRouteLinkInner extends SubResource { + /* + * ExpressRouteLink properties. + */ + private ExpressRouteLinkPropertiesFormat innerProperties; + + /* + * Name of child port resource that is unique among child port resources of the parent. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of ExpressRouteLinkInner class. + */ + public ExpressRouteLinkInner() { + } + + /** + * Get the innerProperties property: ExpressRouteLink properties. + * + * @return the innerProperties value. + */ + private ExpressRouteLinkPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteLinkInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the routerName property: Name of Azure router associated with physical port. + * + * @return the routerName value. + */ + public String routerName() { + return this.innerProperties() == null ? null : this.innerProperties().routerName(); + } + + /** + * Get the interfaceName property: Name of Azure router interface. + * + * @return the interfaceName value. + */ + public String interfaceName() { + return this.innerProperties() == null ? null : this.innerProperties().interfaceName(); + } + + /** + * Get the patchPanelId property: Mapping between physical port to patch panel port. + * + * @return the patchPanelId value. + */ + public String patchPanelId() { + return this.innerProperties() == null ? null : this.innerProperties().patchPanelId(); + } + + /** + * Get the rackId property: Mapping of physical patch panel to rack. + * + * @return the rackId value. + */ + public String rackId() { + return this.innerProperties() == null ? null : this.innerProperties().rackId(); + } + + /** + * Get the coloLocation property: Cololocation for ExpressRoute Hybrid Direct. + * + * @return the coloLocation value. + */ + public String coloLocation() { + return this.innerProperties() == null ? null : this.innerProperties().coloLocation(); + } + + /** + * Get the connectorType property: Physical fiber port type. + * + * @return the connectorType value. + */ + public ExpressRouteLinkConnectorType connectorType() { + return this.innerProperties() == null ? null : this.innerProperties().connectorType(); + } + + /** + * Get the adminState property: Administrative state of the physical port. + * + * @return the adminState value. + */ + public ExpressRouteLinkAdminState adminState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteLinkPropertiesFormat(); + } + this.innerProperties().withAdminState(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the macSecConfig property: MacSec configuration. + * + * @return the macSecConfig value. + */ + public ExpressRouteLinkMacSecConfig macSecConfig() { + return this.innerProperties() == null ? null : this.innerProperties().macSecConfig(); + } + + /** + * Set the macSecConfig property: MacSec configuration. + * + * @param macSecConfig the macSecConfig value to set. + * @return the ExpressRouteLinkInner object itself. + */ + public ExpressRouteLinkInner withMacSecConfig(ExpressRouteLinkMacSecConfig macSecConfig) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteLinkPropertiesFormat(); + } + this.innerProperties().withMacSecConfig(macSecConfig); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteLinkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteLinkInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteLinkInner. + */ + public static ExpressRouteLinkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteLinkInner deserializedExpressRouteLinkInner = new ExpressRouteLinkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteLinkInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteLinkInner.innerProperties + = ExpressRouteLinkPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedExpressRouteLinkInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteLinkInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteLinkInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkPropertiesFormat.java new file mode 100644 index 0000000000000..b72bd231d9ab4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteLinkPropertiesFormat.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * ExpressRouteLink Resource Properties + * + * Properties specific to ExpressRouteLink resources. + */ +@Fluent +public final class ExpressRouteLinkPropertiesFormat implements JsonSerializable { + /* + * Name of Azure router associated with physical port. + */ + private String routerName; + + /* + * Name of Azure router interface. + */ + private String interfaceName; + + /* + * Mapping between physical port to patch panel port. + */ + private String patchPanelId; + + /* + * Mapping of physical patch panel to rack. + */ + private String rackId; + + /* + * Cololocation for ExpressRoute Hybrid Direct. + */ + private String coloLocation; + + /* + * Physical fiber port type. + */ + private ExpressRouteLinkConnectorType connectorType; + + /* + * Administrative state of the physical port. + */ + private ExpressRouteLinkAdminState adminState; + + /* + * The provisioning state of the express route link resource. + */ + private ProvisioningState provisioningState; + + /* + * MacSec configuration. + */ + private ExpressRouteLinkMacSecConfig macSecConfig; + + /** + * Creates an instance of ExpressRouteLinkPropertiesFormat class. + */ + public ExpressRouteLinkPropertiesFormat() { + } + + /** + * 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 coloLocation property: Cololocation for ExpressRoute Hybrid Direct. + * + * @return the coloLocation value. + */ + public String coloLocation() { + return this.coloLocation; + } + + /** + * 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 ExpressRouteLinkPropertiesFormat object itself. + */ + public ExpressRouteLinkPropertiesFormat 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 ExpressRouteLinkPropertiesFormat object itself. + */ + public ExpressRouteLinkPropertiesFormat withMacSecConfig(ExpressRouteLinkMacSecConfig macSecConfig) { + this.macSecConfig = macSecConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (macSecConfig() != null) { + macSecConfig().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminState", this.adminState == null ? null : this.adminState.toString()); + jsonWriter.writeJsonField("macSecConfig", this.macSecConfig); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteLinkPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteLinkPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteLinkPropertiesFormat. + */ + public static ExpressRouteLinkPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteLinkPropertiesFormat deserializedExpressRouteLinkPropertiesFormat + = new ExpressRouteLinkPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routerName".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.routerName = reader.getString(); + } else if ("interfaceName".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.interfaceName = reader.getString(); + } else if ("patchPanelId".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.patchPanelId = reader.getString(); + } else if ("rackId".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.rackId = reader.getString(); + } else if ("coloLocation".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.coloLocation = reader.getString(); + } else if ("connectorType".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.connectorType + = ExpressRouteLinkConnectorType.fromString(reader.getString()); + } else if ("adminState".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.adminState + = ExpressRouteLinkAdminState.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("macSecConfig".equals(fieldName)) { + deserializedExpressRouteLinkPropertiesFormat.macSecConfig + = ExpressRouteLinkMacSecConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteLinkPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationInner.java new file mode 100644 index 0000000000000..2677f89ed2f5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * ExpressRoute Port Authorization + * + * ExpressRoutePort Authorization resource definition. + */ +@Fluent +public final class ExpressRoutePortAuthorizationInner extends SubResource { + /* + * ExpressRoutePort properties. + */ + private ExpressRoutePortAuthorizationPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ExpressRoutePortAuthorizationInner class. + */ + public ExpressRoutePortAuthorizationInner() { + } + + /** + * Get the innerProperties property: ExpressRoutePort properties. + * + * @return the innerProperties value. + */ + private ExpressRoutePortAuthorizationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 ExpressRoutePortAuthorizationInner object itself. + */ + public ExpressRoutePortAuthorizationInner 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRoutePortAuthorizationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); + } + + /** + * Get the authorizationUseStatus property: The authorization use status. + * + * @return the authorizationUseStatus value. + */ + public ExpressRoutePortAuthorizationUseStatus authorizationUseStatus() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationUseStatus(); + } + + /** + * Get the circuitResourceUri property: The reference to the ExpressRoute circuit resource using the authorization. + * + * @return the circuitResourceUri value. + */ + public String circuitResourceUri() { + return this.innerProperties() == null ? null : this.innerProperties().circuitResourceUri(); + } + + /** + * Get the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortAuthorizationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortAuthorizationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortAuthorizationInner. + */ + public static ExpressRoutePortAuthorizationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortAuthorizationInner deserializedExpressRoutePortAuthorizationInner + = new ExpressRoutePortAuthorizationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationInner.innerProperties + = ExpressRoutePortAuthorizationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortAuthorizationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationPropertiesFormat.java new file mode 100644 index 0000000000000..e9ecb81b07698 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortAuthorizationPropertiesFormat.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * ExpressRoute Port Authorization Properties + * + * Properties of ExpressRoutePort Authorization. + */ +@Immutable +public final class ExpressRoutePortAuthorizationPropertiesFormat + implements JsonSerializable { + /* + * The authorization key. + */ + private String authorizationKey; + + /* + * The authorization use status. + */ + private ExpressRoutePortAuthorizationUseStatus authorizationUseStatus; + + /* + * The reference to the ExpressRoute circuit resource using the authorization. + */ + private String circuitResourceUri; + + /* + * The provisioning state of the authorization resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ExpressRoutePortAuthorizationPropertiesFormat class. + */ + public ExpressRoutePortAuthorizationPropertiesFormat() { + } + + /** + * Get the authorizationKey property: The authorization key. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.authorizationKey; + } + + /** + * Get the authorizationUseStatus property: The authorization use status. + * + * @return the authorizationUseStatus value. + */ + public ExpressRoutePortAuthorizationUseStatus authorizationUseStatus() { + return this.authorizationUseStatus; + } + + /** + * Get the circuitResourceUri property: The reference to the ExpressRoute circuit resource using the authorization. + * + * @return the circuitResourceUri value. + */ + public String circuitResourceUri() { + return this.circuitResourceUri; + } + + /** + * Get the provisioningState property: The provisioning state of the authorization 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortAuthorizationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortAuthorizationPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortAuthorizationPropertiesFormat. + */ + public static ExpressRoutePortAuthorizationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortAuthorizationPropertiesFormat deserializedExpressRoutePortAuthorizationPropertiesFormat + = new ExpressRoutePortAuthorizationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authorizationKey".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationPropertiesFormat.authorizationKey = reader.getString(); + } else if ("authorizationUseStatus".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationPropertiesFormat.authorizationUseStatus + = ExpressRoutePortAuthorizationUseStatus.fromString(reader.getString()); + } else if ("circuitResourceUri".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationPropertiesFormat.circuitResourceUri = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortAuthorizationPropertiesFormat; + }); + } +} 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..7a1fb6098ef3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortInner.java @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsBillingType; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * ExpressRoute Port + * + * ExpressRoutePort resource definition. + */ +@Fluent +public final class ExpressRoutePortInner extends Resource { + /* + * ExpressRoutePort properties. + */ + private ExpressRoutePortPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The identity of ExpressRoutePort, if configured. + */ + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRoutePortInner class. + */ + public ExpressRoutePortInner() { + } + + /** + * Get the innerProperties property: ExpressRoutePort properties. + * + * @return the innerProperties value. + */ + private ExpressRoutePortPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRoutePortInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRoutePortInner withTags(Map tags) { + super.withTags(tags); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRoutePortPropertiesFormat(); + } + this.innerProperties().withPeeringLocation(peeringLocation); + return this; + } + + /** + * Get the bandwidthInGbps property: Bandwidth of procured ports in Gbps. + * + * @return the bandwidthInGbps value. + */ + public Integer bandwidthInGbps() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRoutePortPropertiesFormat(); + } + this.innerProperties().withBandwidthInGbps(bandwidthInGbps); + return this; + } + + /** + * Get the provisionedBandwidthInGbps property: Aggregate Gbps of associated circuit bandwidths. + * + * @return the provisionedBandwidthInGbps value. + */ + public Float provisionedBandwidthInGbps() { + return this.innerProperties() == null ? null : this.innerProperties().provisionedBandwidthInGbps(); + } + + /** + * Get the mtu property: Maximum transmission unit of the physical port pair(s). + * + * @return the mtu value. + */ + public String mtu() { + return this.innerProperties() == null ? null : this.innerProperties().mtu(); + } + + /** + * Get the encapsulation property: Encapsulation method on physical ports. + * + * @return the encapsulation value. + */ + public ExpressRoutePortsEncapsulation encapsulation() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRoutePortPropertiesFormat(); + } + this.innerProperties().withEncapsulation(encapsulation); + return this; + } + + /** + * Get the etherType property: Ether type of the physical port. + * + * @return the etherType value. + */ + public String etherType() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().allocationDate(); + } + + /** + * Get the links property: The set of physical links of the ExpressRoutePort resource. + * + * @return the links value. + */ + public List links() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRoutePortPropertiesFormat(); + } + this.innerProperties().withLinks(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.innerProperties() == null ? null : this.innerProperties().circuits(); + } + + /** + * Get the provisioningState property: The provisioning state of the express route port resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the express route port resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the billingType property: The billing type of the ExpressRoutePort resource. + * + * @return the billingType value. + */ + public ExpressRoutePortsBillingType billingType() { + return this.innerProperties() == null ? null : this.innerProperties().billingType(); + } + + /** + * Set the billingType property: The billing type of the ExpressRoutePort resource. + * + * @param billingType the billingType value to set. + * @return the ExpressRoutePortInner object itself. + */ + public ExpressRoutePortInner withBillingType(ExpressRoutePortsBillingType billingType) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRoutePortPropertiesFormat(); + } + this.innerProperties().withBillingType(billingType); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRoutePortInner. + */ + public static ExpressRoutePortInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortInner deserializedExpressRoutePortInner = new ExpressRoutePortInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRoutePortInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRoutePortInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedExpressRoutePortInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedExpressRoutePortInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedExpressRoutePortInner.innerProperties + = ExpressRoutePortPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedExpressRoutePortInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedExpressRoutePortInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedExpressRoutePortInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortPropertiesFormat.java new file mode 100644 index 0000000000000..78dd1d53ffbb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsBillingType; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRoutePort Properties + * + * Properties specific to ExpressRoutePort resources. + */ +@Fluent +public final class ExpressRoutePortPropertiesFormat implements JsonSerializable { + /* + * The name of the peering location that the ExpressRoutePort is mapped to physically. + */ + private String peeringLocation; + + /* + * Bandwidth of procured ports in Gbps. + */ + private Integer bandwidthInGbps; + + /* + * Aggregate Gbps of associated circuit bandwidths. + */ + private Float provisionedBandwidthInGbps; + + /* + * Maximum transmission unit of the physical port pair(s). + */ + private String mtu; + + /* + * Encapsulation method on physical ports. + */ + private ExpressRoutePortsEncapsulation encapsulation; + + /* + * Ether type of the physical port. + */ + private String etherType; + + /* + * Date of the physical port allocation to be used in Letter of Authorization. + */ + private String allocationDate; + + /* + * The set of physical links of the ExpressRoutePort resource. + */ + private List links; + + /* + * Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. + */ + private List circuits; + + /* + * The provisioning state of the express route port resource. + */ + private ProvisioningState provisioningState; + + /* + * The resource GUID property of the express route port resource. + */ + private String resourceGuid; + + /* + * The billing type of the ExpressRoutePort resource. + */ + private ExpressRoutePortsBillingType billingType; + + /** + * Creates an instance of ExpressRoutePortPropertiesFormat class. + */ + public ExpressRoutePortPropertiesFormat() { + } + + /** + * 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 ExpressRoutePortPropertiesFormat object itself. + */ + public ExpressRoutePortPropertiesFormat 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 ExpressRoutePortPropertiesFormat object itself. + */ + public ExpressRoutePortPropertiesFormat 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 ExpressRoutePortPropertiesFormat object itself. + */ + public ExpressRoutePortPropertiesFormat 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 ExpressRoutePortPropertiesFormat object itself. + */ + public ExpressRoutePortPropertiesFormat 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 billingType property: The billing type of the ExpressRoutePort resource. + * + * @return the billingType value. + */ + public ExpressRoutePortsBillingType billingType() { + return this.billingType; + } + + /** + * Set the billingType property: The billing type of the ExpressRoutePort resource. + * + * @param billingType the billingType value to set. + * @return the ExpressRoutePortPropertiesFormat object itself. + */ + public ExpressRoutePortPropertiesFormat withBillingType(ExpressRoutePortsBillingType billingType) { + this.billingType = billingType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (links() != null) { + links().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("peeringLocation", this.peeringLocation); + jsonWriter.writeNumberField("bandwidthInGbps", this.bandwidthInGbps); + jsonWriter.writeStringField("encapsulation", this.encapsulation == null ? null : this.encapsulation.toString()); + jsonWriter.writeArrayField("links", this.links, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("billingType", this.billingType == null ? null : this.billingType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortPropertiesFormat. + */ + public static ExpressRoutePortPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortPropertiesFormat deserializedExpressRoutePortPropertiesFormat + = new ExpressRoutePortPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("peeringLocation".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.peeringLocation = reader.getString(); + } else if ("bandwidthInGbps".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.bandwidthInGbps + = reader.getNullable(JsonReader::getInt); + } else if ("provisionedBandwidthInGbps".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.provisionedBandwidthInGbps + = reader.getNullable(JsonReader::getFloat); + } else if ("mtu".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.mtu = reader.getString(); + } else if ("encapsulation".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.encapsulation + = ExpressRoutePortsEncapsulation.fromString(reader.getString()); + } else if ("etherType".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.etherType = reader.getString(); + } else if ("allocationDate".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.allocationDate = reader.getString(); + } else if ("links".equals(fieldName)) { + List links + = reader.readArray(reader1 -> ExpressRouteLinkInner.fromJson(reader1)); + deserializedExpressRoutePortPropertiesFormat.links = links; + } else if ("circuits".equals(fieldName)) { + List circuits = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedExpressRoutePortPropertiesFormat.circuits = circuits; + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.resourceGuid = reader.getString(); + } else if ("billingType".equals(fieldName)) { + deserializedExpressRoutePortPropertiesFormat.billingType + = ExpressRoutePortsBillingType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortPropertiesFormat; + }); + } +} 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..0fdbf89b32ce1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationInner.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * ExpressRoutePorts Peering Location + * + * Definition of the ExpressRoutePorts peering location resource. + */ +@Fluent +public final class ExpressRoutePortsLocationInner extends Resource { + /* + * ExpressRoutePort peering location properties. + */ + private ExpressRoutePortsLocationPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRoutePortsLocationInner class. + */ + public ExpressRoutePortsLocationInner() { + } + + /** + * Get the innerProperties property: ExpressRoutePort peering location properties. + * + * @return the innerProperties value. + */ + private ExpressRoutePortsLocationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRoutePortsLocationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRoutePortsLocationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the address property: Address of peering location. + * + * @return the address value. + */ + public String address() { + return this.innerProperties() == null ? null : this.innerProperties().address(); + } + + /** + * Get the contact property: Contact details of peering locations. + * + * @return the contact value. + */ + public String contact() { + return this.innerProperties() == null ? null : this.innerProperties().contact(); + } + + /** + * Get the availableBandwidths property: The inventory of available ExpressRoutePort bandwidths. + * + * @return the availableBandwidths value. + */ + public List availableBandwidths() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRoutePortsLocationPropertiesFormat(); + } + this.innerProperties().withAvailableBandwidths(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortsLocationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortsLocationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRoutePortsLocationInner. + */ + public static ExpressRoutePortsLocationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortsLocationInner deserializedExpressRoutePortsLocationInner + = new ExpressRoutePortsLocationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRoutePortsLocationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRoutePortsLocationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedExpressRoutePortsLocationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedExpressRoutePortsLocationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedExpressRoutePortsLocationInner.innerProperties + = ExpressRoutePortsLocationPropertiesFormat.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedExpressRoutePortsLocationInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortsLocationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationPropertiesFormat.java new file mode 100644 index 0000000000000..c892196716eed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRoutePortsLocationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsLocationBandwidths; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRoutePorts Location Properties + * + * Properties specific to ExpressRoutePorts peering location resources. + */ +@Fluent +public final class ExpressRoutePortsLocationPropertiesFormat + implements JsonSerializable { + /* + * Address of peering location. + */ + private String address; + + /* + * Contact details of peering locations. + */ + private String contact; + + /* + * The inventory of available ExpressRoutePort bandwidths. + */ + private List availableBandwidths; + + /* + * The provisioning state of the express route port location resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ExpressRoutePortsLocationPropertiesFormat class. + */ + public ExpressRoutePortsLocationPropertiesFormat() { + } + + /** + * 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 ExpressRoutePortsLocationPropertiesFormat object itself. + */ + public ExpressRoutePortsLocationPropertiesFormat + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availableBandwidths() != null) { + availableBandwidths().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("availableBandwidths", this.availableBandwidths, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortsLocationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortsLocationPropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortsLocationPropertiesFormat. + */ + public static ExpressRoutePortsLocationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortsLocationPropertiesFormat deserializedExpressRoutePortsLocationPropertiesFormat + = new ExpressRoutePortsLocationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedExpressRoutePortsLocationPropertiesFormat.address = reader.getString(); + } else if ("contact".equals(fieldName)) { + deserializedExpressRoutePortsLocationPropertiesFormat.contact = reader.getString(); + } else if ("availableBandwidths".equals(fieldName)) { + List availableBandwidths + = reader.readArray(reader1 -> ExpressRoutePortsLocationBandwidths.fromJson(reader1)); + deserializedExpressRoutePortsLocationPropertiesFormat.availableBandwidths = availableBandwidths; + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRoutePortsLocationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortsLocationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortInner.java new file mode 100644 index 0000000000000..2034384d044d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortInner.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * ExpressRouteProviderPort resource. + */ +@Fluent +public final class ExpressRouteProviderPortInner extends Resource { + /* + * Properties of the express route Service Provider Port. + */ + private ExpressRouteProviderPortProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRouteProviderPortInner class. + */ + public ExpressRouteProviderPortInner() { + } + + /** + * Get the innerProperties property: Properties of the express route Service Provider Port. + * + * @return the innerProperties value. + */ + private ExpressRouteProviderPortProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 ExpressRouteProviderPortInner object itself. + */ + public ExpressRouteProviderPortInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteProviderPortInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteProviderPortInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the portPairDescriptor property: The name of the port pair. + * + * @return the portPairDescriptor value. + */ + public String portPairDescriptor() { + return this.innerProperties() == null ? null : this.innerProperties().portPairDescriptor(); + } + + /** + * Get the primaryAzurePort property: The name of the primary port. + * + * @return the primaryAzurePort value. + */ + public String primaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().primaryAzurePort(); + } + + /** + * Get the secondaryAzurePort property: The name of the secondary port. + * + * @return the secondaryAzurePort value. + */ + public String secondaryAzurePort() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryAzurePort(); + } + + /** + * Get the peeringLocation property: The peering location of the port pair. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.innerProperties() == null ? null : this.innerProperties().peeringLocation(); + } + + /** + * Set the peeringLocation property: The peering location of the port pair. + * + * @param peeringLocation the peeringLocation value to set. + * @return the ExpressRouteProviderPortInner object itself. + */ + public ExpressRouteProviderPortInner withPeeringLocation(String peeringLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteProviderPortProperties(); + } + this.innerProperties().withPeeringLocation(peeringLocation); + return this; + } + + /** + * Get the overprovisionFactor property: Overprovisioning factor for the port pair. + * + * @return the overprovisionFactor value. + */ + public Integer overprovisionFactor() { + return this.innerProperties() == null ? null : this.innerProperties().overprovisionFactor(); + } + + /** + * Set the overprovisionFactor property: Overprovisioning factor for the port pair. + * + * @param overprovisionFactor the overprovisionFactor value to set. + * @return the ExpressRouteProviderPortInner object itself. + */ + public ExpressRouteProviderPortInner withOverprovisionFactor(Integer overprovisionFactor) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteProviderPortProperties(); + } + this.innerProperties().withOverprovisionFactor(overprovisionFactor); + return this; + } + + /** + * Get the portBandwidthInMbps property: Bandwidth of the port in Mbps. + * + * @return the portBandwidthInMbps value. + */ + public Integer portBandwidthInMbps() { + return this.innerProperties() == null ? null : this.innerProperties().portBandwidthInMbps(); + } + + /** + * Set the portBandwidthInMbps property: Bandwidth of the port in Mbps. + * + * @param portBandwidthInMbps the portBandwidthInMbps value to set. + * @return the ExpressRouteProviderPortInner object itself. + */ + public ExpressRouteProviderPortInner withPortBandwidthInMbps(Integer portBandwidthInMbps) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteProviderPortProperties(); + } + this.innerProperties().withPortBandwidthInMbps(portBandwidthInMbps); + return this; + } + + /** + * Get the usedBandwidthInMbps property: Used Bandwidth of the port in Mbps. + * + * @return the usedBandwidthInMbps value. + */ + public Integer usedBandwidthInMbps() { + return this.innerProperties() == null ? null : this.innerProperties().usedBandwidthInMbps(); + } + + /** + * Set the usedBandwidthInMbps property: Used Bandwidth of the port in Mbps. + * + * @param usedBandwidthInMbps the usedBandwidthInMbps value to set. + * @return the ExpressRouteProviderPortInner object itself. + */ + public ExpressRouteProviderPortInner withUsedBandwidthInMbps(Integer usedBandwidthInMbps) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteProviderPortProperties(); + } + this.innerProperties().withUsedBandwidthInMbps(usedBandwidthInMbps); + return this; + } + + /** + * Get the remainingBandwidthInMbps property: Remaining Bandwidth of the port in Mbps. + * + * @return the remainingBandwidthInMbps value. + */ + public Integer remainingBandwidthInMbps() { + return this.innerProperties() == null ? null : this.innerProperties().remainingBandwidthInMbps(); + } + + /** + * Set the remainingBandwidthInMbps property: Remaining Bandwidth of the port in Mbps. + * + * @param remainingBandwidthInMbps the remainingBandwidthInMbps value to set. + * @return the ExpressRouteProviderPortInner object itself. + */ + public ExpressRouteProviderPortInner withRemainingBandwidthInMbps(Integer remainingBandwidthInMbps) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteProviderPortProperties(); + } + this.innerProperties().withRemainingBandwidthInMbps(remainingBandwidthInMbps); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteProviderPortInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteProviderPortInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteProviderPortInner. + */ + public static ExpressRouteProviderPortInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteProviderPortInner deserializedExpressRouteProviderPortInner + = new ExpressRouteProviderPortInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRouteProviderPortInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteProviderPortInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedExpressRouteProviderPortInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedExpressRouteProviderPortInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteProviderPortInner.innerProperties + = ExpressRouteProviderPortProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedExpressRouteProviderPortInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedExpressRouteProviderPortInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteProviderPortInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortListResultInner.java new file mode 100644 index 0000000000000..76ed97f6db947 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListExpressRouteProviderPort API service call. + */ +@Fluent +public final class ExpressRouteProviderPortListResultInner + implements JsonSerializable { + /* + * A list of ExpressRouteProviderPort resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteProviderPortListResultInner class. + */ + public ExpressRouteProviderPortListResultInner() { + } + + /** + * Get the value property: A list of ExpressRouteProviderPort resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of ExpressRouteProviderPort resources. + * + * @param value the value value to set. + * @return the ExpressRouteProviderPortListResultInner object itself. + */ + public ExpressRouteProviderPortListResultInner 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteProviderPortListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteProviderPortListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteProviderPortListResultInner. + */ + public static ExpressRouteProviderPortListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteProviderPortListResultInner deserializedExpressRouteProviderPortListResultInner + = new ExpressRouteProviderPortListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteProviderPortInner.fromJson(reader1)); + deserializedExpressRouteProviderPortListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteProviderPortListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteProviderPortListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortProperties.java new file mode 100644 index 0000000000000..8e512be66c5b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteProviderPortProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of ExpressRouteProviderPort. + */ +@Fluent +public final class ExpressRouteProviderPortProperties implements JsonSerializable { + /* + * The name of the port pair. + */ + private String portPairDescriptor; + + /* + * The name of the primary port. + */ + private String primaryAzurePort; + + /* + * The name of the secondary port. + */ + private String secondaryAzurePort; + + /* + * The peering location of the port pair. + */ + private String peeringLocation; + + /* + * Overprovisioning factor for the port pair. + */ + private Integer overprovisionFactor; + + /* + * Bandwidth of the port in Mbps + */ + private Integer portBandwidthInMbps; + + /* + * Used Bandwidth of the port in Mbps + */ + private Integer usedBandwidthInMbps; + + /* + * Remaining Bandwidth of the port in Mbps + */ + private Integer remainingBandwidthInMbps; + + /** + * Creates an instance of ExpressRouteProviderPortProperties class. + */ + public ExpressRouteProviderPortProperties() { + } + + /** + * Get the portPairDescriptor property: The name of the port pair. + * + * @return the portPairDescriptor value. + */ + public String portPairDescriptor() { + return this.portPairDescriptor; + } + + /** + * 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 peeringLocation property: The peering location of the port pair. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peeringLocation property: The peering location of the port pair. + * + * @param peeringLocation the peeringLocation value to set. + * @return the ExpressRouteProviderPortProperties object itself. + */ + public ExpressRouteProviderPortProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the overprovisionFactor property: Overprovisioning factor for the port pair. + * + * @return the overprovisionFactor value. + */ + public Integer overprovisionFactor() { + return this.overprovisionFactor; + } + + /** + * Set the overprovisionFactor property: Overprovisioning factor for the port pair. + * + * @param overprovisionFactor the overprovisionFactor value to set. + * @return the ExpressRouteProviderPortProperties object itself. + */ + public ExpressRouteProviderPortProperties withOverprovisionFactor(Integer overprovisionFactor) { + this.overprovisionFactor = overprovisionFactor; + return this; + } + + /** + * Get the portBandwidthInMbps property: Bandwidth of the port in Mbps. + * + * @return the portBandwidthInMbps value. + */ + public Integer portBandwidthInMbps() { + return this.portBandwidthInMbps; + } + + /** + * Set the portBandwidthInMbps property: Bandwidth of the port in Mbps. + * + * @param portBandwidthInMbps the portBandwidthInMbps value to set. + * @return the ExpressRouteProviderPortProperties object itself. + */ + public ExpressRouteProviderPortProperties withPortBandwidthInMbps(Integer portBandwidthInMbps) { + this.portBandwidthInMbps = portBandwidthInMbps; + return this; + } + + /** + * Get the usedBandwidthInMbps property: Used Bandwidth of the port in Mbps. + * + * @return the usedBandwidthInMbps value. + */ + public Integer usedBandwidthInMbps() { + return this.usedBandwidthInMbps; + } + + /** + * Set the usedBandwidthInMbps property: Used Bandwidth of the port in Mbps. + * + * @param usedBandwidthInMbps the usedBandwidthInMbps value to set. + * @return the ExpressRouteProviderPortProperties object itself. + */ + public ExpressRouteProviderPortProperties withUsedBandwidthInMbps(Integer usedBandwidthInMbps) { + this.usedBandwidthInMbps = usedBandwidthInMbps; + return this; + } + + /** + * Get the remainingBandwidthInMbps property: Remaining Bandwidth of the port in Mbps. + * + * @return the remainingBandwidthInMbps value. + */ + public Integer remainingBandwidthInMbps() { + return this.remainingBandwidthInMbps; + } + + /** + * Set the remainingBandwidthInMbps property: Remaining Bandwidth of the port in Mbps. + * + * @param remainingBandwidthInMbps the remainingBandwidthInMbps value to set. + * @return the ExpressRouteProviderPortProperties object itself. + */ + public ExpressRouteProviderPortProperties withRemainingBandwidthInMbps(Integer remainingBandwidthInMbps) { + this.remainingBandwidthInMbps = remainingBandwidthInMbps; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("peeringLocation", this.peeringLocation); + jsonWriter.writeNumberField("overprovisionFactor", this.overprovisionFactor); + jsonWriter.writeNumberField("portBandwidthInMbps", this.portBandwidthInMbps); + jsonWriter.writeNumberField("usedBandwidthInMbps", this.usedBandwidthInMbps); + jsonWriter.writeNumberField("remainingBandwidthInMbps", this.remainingBandwidthInMbps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteProviderPortProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteProviderPortProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteProviderPortProperties. + */ + public static ExpressRouteProviderPortProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteProviderPortProperties deserializedExpressRouteProviderPortProperties + = new ExpressRouteProviderPortProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("portPairDescriptor".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.portPairDescriptor = reader.getString(); + } else if ("primaryAzurePort".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.primaryAzurePort = reader.getString(); + } else if ("secondaryAzurePort".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.secondaryAzurePort = reader.getString(); + } else if ("peeringLocation".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.peeringLocation = reader.getString(); + } else if ("overprovisionFactor".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.overprovisionFactor + = reader.getNullable(JsonReader::getInt); + } else if ("portBandwidthInMbps".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.portBandwidthInMbps + = reader.getNullable(JsonReader::getInt); + } else if ("usedBandwidthInMbps".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.usedBandwidthInMbps + = reader.getNullable(JsonReader::getInt); + } else if ("remainingBandwidthInMbps".equals(fieldName)) { + deserializedExpressRouteProviderPortProperties.remainingBandwidthInMbps + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteProviderPortProperties; + }); + } +} 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..f239e02d896de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderInner.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A ExpressRouteResourceProvider object. + */ +@Fluent +public final class ExpressRouteServiceProviderInner extends Resource { + /* + * Properties of the express route service provider. + */ + private ExpressRouteServiceProviderPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ExpressRouteServiceProviderInner class. + */ + public ExpressRouteServiceProviderInner() { + } + + /** + * Get the innerProperties property: Properties of the express route service provider. + * + * @return the innerProperties value. + */ + private ExpressRouteServiceProviderPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteServiceProviderInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ExpressRouteServiceProviderInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the peeringLocations property: A list of peering locations. + * + * @return the peeringLocations value. + */ + public List peeringLocations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteServiceProviderPropertiesFormat(); + } + this.innerProperties().withPeeringLocations(peeringLocations); + return this; + } + + /** + * Get the bandwidthsOffered property: A list of bandwidths offered. + * + * @return the bandwidthsOffered value. + */ + public List bandwidthsOffered() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ExpressRouteServiceProviderPropertiesFormat(); + } + this.innerProperties().withBandwidthsOffered(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteServiceProviderInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteServiceProviderInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExpressRouteServiceProviderInner. + */ + public static ExpressRouteServiceProviderInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteServiceProviderInner deserializedExpressRouteServiceProviderInner + = new ExpressRouteServiceProviderInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRouteServiceProviderInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExpressRouteServiceProviderInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedExpressRouteServiceProviderInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedExpressRouteServiceProviderInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedExpressRouteServiceProviderInner.innerProperties + = ExpressRouteServiceProviderPropertiesFormat.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedExpressRouteServiceProviderInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteServiceProviderInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderPropertiesFormat.java new file mode 100644 index 0000000000000..50d5d7972d629 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ExpressRouteServiceProviderPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExpressRouteServiceProviderBandwidthsOffered; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of ExpressRouteServiceProvider. + */ +@Fluent +public final class ExpressRouteServiceProviderPropertiesFormat + implements JsonSerializable { + /* + * A list of peering locations. + */ + private List peeringLocations; + + /* + * A list of bandwidths offered. + */ + private List bandwidthsOffered; + + /* + * The provisioning state of the express route service provider resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ExpressRouteServiceProviderPropertiesFormat class. + */ + public ExpressRouteServiceProviderPropertiesFormat() { + } + + /** + * 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 ExpressRouteServiceProviderPropertiesFormat object itself. + */ + public ExpressRouteServiceProviderPropertiesFormat 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 ExpressRouteServiceProviderPropertiesFormat object itself. + */ + public ExpressRouteServiceProviderPropertiesFormat + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (bandwidthsOffered() != null) { + bandwidthsOffered().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("peeringLocations", this.peeringLocations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("bandwidthsOffered", this.bandwidthsOffered, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteServiceProviderPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteServiceProviderPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteServiceProviderPropertiesFormat. + */ + public static ExpressRouteServiceProviderPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteServiceProviderPropertiesFormat deserializedExpressRouteServiceProviderPropertiesFormat + = new ExpressRouteServiceProviderPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("peeringLocations".equals(fieldName)) { + List peeringLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedExpressRouteServiceProviderPropertiesFormat.peeringLocations = peeringLocations; + } else if ("bandwidthsOffered".equals(fieldName)) { + List bandwidthsOffered + = reader.readArray(reader1 -> ExpressRouteServiceProviderBandwidthsOffered.fromJson(reader1)); + deserializedExpressRouteServiceProviderPropertiesFormat.bandwidthsOffered = bandwidthsOffered; + } else if ("provisioningState".equals(fieldName)) { + deserializedExpressRouteServiceProviderPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteServiceProviderPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftInner.java new file mode 100644 index 0000000000000..ab77ed3549f4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftInner.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import java.io.IOException; +import java.util.Map; + +/** + * FirewallPolicy Resource. + */ +@Fluent +public final class FirewallPolicyDraftInner extends Resource { + /* + * Properties of the firewall policy. + */ + private FirewallPolicyDraftProperties innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of FirewallPolicyDraftInner class. + */ + public FirewallPolicyDraftInner() { + } + + /** + * Get the innerProperties property: Properties of the firewall policy. + * + * @return the innerProperties value. + */ + private FirewallPolicyDraftProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicyDraftInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicyDraftInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the basePolicy property: The parent firewall policy from which rules are inherited. + * + * @return the basePolicy value. + */ + public SubResource basePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().basePolicy(); + } + + /** + * Set the basePolicy property: The parent firewall policy from which rules are inherited. + * + * @param basePolicy the basePolicy value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withBasePolicy(SubResource basePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withBasePolicy(basePolicy); + return this; + } + + /** + * Get the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @return the threatIntelMode value. + */ + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.innerProperties() == null ? null : this.innerProperties().threatIntelMode(); + } + + /** + * Set the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @param threatIntelMode the threatIntelMode value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withThreatIntelMode(AzureFirewallThreatIntelMode threatIntelMode) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withThreatIntelMode(threatIntelMode); + return this; + } + + /** + * Get the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy. + * + * @return the threatIntelWhitelist value. + */ + public FirewallPolicyThreatIntelWhitelist threatIntelWhitelist() { + return this.innerProperties() == null ? null : this.innerProperties().threatIntelWhitelist(); + } + + /** + * Set the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy. + * + * @param threatIntelWhitelist the threatIntelWhitelist value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withThreatIntelWhitelist(FirewallPolicyThreatIntelWhitelist threatIntelWhitelist) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withThreatIntelWhitelist(threatIntelWhitelist); + return this; + } + + /** + * Get the insights property: Insights on Firewall Policy. + * + * @return the insights value. + */ + public FirewallPolicyInsights insights() { + return this.innerProperties() == null ? null : this.innerProperties().insights(); + } + + /** + * Set the insights property: Insights on Firewall Policy. + * + * @param insights the insights value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withInsights(FirewallPolicyInsights insights) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withInsights(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.innerProperties() == null ? null : this.innerProperties().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 FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withSnat(FirewallPolicySnat snat) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withSnat(snat); + return this; + } + + /** + * Get the sql property: SQL Settings definition. + * + * @return the sql value. + */ + public FirewallPolicySql sql() { + return this.innerProperties() == null ? null : this.innerProperties().sql(); + } + + /** + * Set the sql property: SQL Settings definition. + * + * @param sql the sql value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withSql(FirewallPolicySql sql) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withSql(sql); + return this; + } + + /** + * Get the dnsSettings property: DNS Proxy Settings definition. + * + * @return the dnsSettings value. + */ + public DnsSettings dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().dnsSettings(); + } + + /** + * Set the dnsSettings property: DNS Proxy Settings definition. + * + * @param dnsSettings the dnsSettings value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withDnsSettings(DnsSettings dnsSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the explicitProxy property: Explicit Proxy Settings definition. + * + * @return the explicitProxy value. + */ + public ExplicitProxy explicitProxy() { + return this.innerProperties() == null ? null : this.innerProperties().explicitProxy(); + } + + /** + * Set the explicitProxy property: Explicit Proxy Settings definition. + * + * @param explicitProxy the explicitProxy value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withExplicitProxy(ExplicitProxy explicitProxy) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withExplicitProxy(explicitProxy); + return this; + } + + /** + * Get the intrusionDetection property: The configuration for Intrusion detection. + * + * @return the intrusionDetection value. + */ + public FirewallPolicyIntrusionDetection intrusionDetection() { + return this.innerProperties() == null ? null : this.innerProperties().intrusionDetection(); + } + + /** + * Set the intrusionDetection property: The configuration for Intrusion detection. + * + * @param intrusionDetection the intrusionDetection value to set. + * @return the FirewallPolicyDraftInner object itself. + */ + public FirewallPolicyDraftInner withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyDraftProperties(); + } + this.innerProperties().withIntrusionDetection(intrusionDetection); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyDraftInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyDraftInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FirewallPolicyDraftInner. + */ + public static FirewallPolicyDraftInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyDraftInner deserializedFirewallPolicyDraftInner = new FirewallPolicyDraftInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFirewallPolicyDraftInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFirewallPolicyDraftInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFirewallPolicyDraftInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFirewallPolicyDraftInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFirewallPolicyDraftInner.innerProperties + = FirewallPolicyDraftProperties.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedFirewallPolicyDraftInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyDraftInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftProperties.java new file mode 100644 index 0000000000000..f76cc4687300a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyDraftProperties.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import java.io.IOException; + +/** + * The FirewallPolicyDraftProperties model. + */ +@Fluent +public final class FirewallPolicyDraftProperties implements JsonSerializable { + /* + * The parent firewall policy from which rules are inherited. + */ + private SubResource basePolicy; + + /* + * The operation mode for Threat Intelligence. + */ + private AzureFirewallThreatIntelMode threatIntelMode; + + /* + * ThreatIntel Whitelist for Firewall Policy. + */ + private FirewallPolicyThreatIntelWhitelist threatIntelWhitelist; + + /* + * Insights on Firewall Policy. + */ + private FirewallPolicyInsights insights; + + /* + * The private IP addresses/IP ranges to which traffic will not be SNAT. + */ + private FirewallPolicySnat snat; + + /* + * SQL Settings definition. + */ + private FirewallPolicySql sql; + + /* + * DNS Proxy Settings definition. + */ + private DnsSettings dnsSettings; + + /* + * Explicit Proxy Settings definition. + */ + private ExplicitProxy explicitProxy; + + /* + * The configuration for Intrusion detection. + */ + private FirewallPolicyIntrusionDetection intrusionDetection; + + /** + * Creates an instance of FirewallPolicyDraftProperties class. + */ + public FirewallPolicyDraftProperties() { + } + + /** + * 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 FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties withBasePolicy(SubResource basePolicy) { + this.basePolicy = basePolicy; + return this; + } + + /** + * 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 FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties 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 FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties + 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 FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties 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 FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties withSnat(FirewallPolicySnat snat) { + this.snat = snat; + return this; + } + + /** + * Get the sql property: SQL Settings definition. + * + * @return the sql value. + */ + public FirewallPolicySql sql() { + return this.sql; + } + + /** + * Set the sql property: SQL Settings definition. + * + * @param sql the sql value to set. + * @return the FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties withSql(FirewallPolicySql sql) { + this.sql = sql; + 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 FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties withDnsSettings(DnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the explicitProxy property: Explicit Proxy Settings definition. + * + * @return the explicitProxy value. + */ + public ExplicitProxy explicitProxy() { + return this.explicitProxy; + } + + /** + * Set the explicitProxy property: Explicit Proxy Settings definition. + * + * @param explicitProxy the explicitProxy value to set. + * @return the FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties withExplicitProxy(ExplicitProxy explicitProxy) { + this.explicitProxy = explicitProxy; + 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 FirewallPolicyDraftProperties object itself. + */ + public FirewallPolicyDraftProperties withIntrusionDetection(FirewallPolicyIntrusionDetection intrusionDetection) { + this.intrusionDetection = intrusionDetection; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threatIntelWhitelist() != null) { + threatIntelWhitelist().validate(); + } + if (insights() != null) { + insights().validate(); + } + if (snat() != null) { + snat().validate(); + } + if (sql() != null) { + sql().validate(); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (explicitProxy() != null) { + explicitProxy().validate(); + } + if (intrusionDetection() != null) { + intrusionDetection().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("basePolicy", this.basePolicy); + jsonWriter.writeStringField("threatIntelMode", + this.threatIntelMode == null ? null : this.threatIntelMode.toString()); + jsonWriter.writeJsonField("threatIntelWhitelist", this.threatIntelWhitelist); + jsonWriter.writeJsonField("insights", this.insights); + jsonWriter.writeJsonField("snat", this.snat); + jsonWriter.writeJsonField("sql", this.sql); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeJsonField("explicitProxy", this.explicitProxy); + jsonWriter.writeJsonField("intrusionDetection", this.intrusionDetection); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyDraftProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyDraftProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyDraftProperties. + */ + public static FirewallPolicyDraftProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyDraftProperties deserializedFirewallPolicyDraftProperties + = new FirewallPolicyDraftProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("basePolicy".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.basePolicy = SubResource.fromJson(reader); + } else if ("threatIntelMode".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.threatIntelMode + = AzureFirewallThreatIntelMode.fromString(reader.getString()); + } else if ("threatIntelWhitelist".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.threatIntelWhitelist + = FirewallPolicyThreatIntelWhitelist.fromJson(reader); + } else if ("insights".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.insights = FirewallPolicyInsights.fromJson(reader); + } else if ("snat".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.snat = FirewallPolicySnat.fromJson(reader); + } else if ("sql".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.sql = FirewallPolicySql.fromJson(reader); + } else if ("dnsSettings".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.dnsSettings = DnsSettings.fromJson(reader); + } else if ("explicitProxy".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.explicitProxy = ExplicitProxy.fromJson(reader); + } else if ("intrusionDetection".equals(fieldName)) { + deserializedFirewallPolicyDraftProperties.intrusionDetection + = FirewallPolicyIntrusionDetection.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyDraftProperties; + }); + } +} 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..b81005b180a22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyInner.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +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.FirewallPolicySql; +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.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * FirewallPolicy Resource. + */ +@Fluent +public final class FirewallPolicyInner extends Resource { + /* + * Properties of the firewall policy. + */ + private FirewallPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The identity of the firewall policy. + */ + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of FirewallPolicyInner class. + */ + public FirewallPolicyInner() { + } + + /** + * Get the innerProperties property: Properties of the firewall policy. + * + * @return the innerProperties value. + */ + private FirewallPolicyPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the size property: A read-only string that represents the size of the FirewallPolicyPropertiesFormat in MB. + * (ex 0.5MB). + * + * @return the size value. + */ + public String size() { + return this.innerProperties() == null ? null : this.innerProperties().size(); + } + + /** + * Get the ruleCollectionGroups property: List of references to FirewallPolicyRuleCollectionGroups. + * + * @return the ruleCollectionGroups value. + */ + public List ruleCollectionGroups() { + return this.innerProperties() == null ? null : this.innerProperties().ruleCollectionGroups(); + } + + /** + * Get the provisioningState property: The provisioning state of the firewall policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the basePolicy property: The parent firewall policy from which rules are inherited. + * + * @return the basePolicy value. + */ + public SubResource basePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withBasePolicy(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.innerProperties() == null ? null : this.innerProperties().firewalls(); + } + + /** + * Get the childPolicies property: List of references to Child Firewall Policies. + * + * @return the childPolicies value. + */ + public List childPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().childPolicies(); + } + + /** + * Get the threatIntelMode property: The operation mode for Threat Intelligence. + * + * @return the threatIntelMode value. + */ + public AzureFirewallThreatIntelMode threatIntelMode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withThreatIntelMode(threatIntelMode); + return this; + } + + /** + * Get the threatIntelWhitelist property: ThreatIntel Whitelist for Firewall Policy. + * + * @return the threatIntelWhitelist value. + */ + public FirewallPolicyThreatIntelWhitelist threatIntelWhitelist() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withThreatIntelWhitelist(threatIntelWhitelist); + return this; + } + + /** + * Get the insights property: Insights on Firewall Policy. + * + * @return the insights value. + */ + public FirewallPolicyInsights insights() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withInsights(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withSnat(snat); + return this; + } + + /** + * Get the sql property: SQL Settings definition. + * + * @return the sql value. + */ + public FirewallPolicySql sql() { + return this.innerProperties() == null ? null : this.innerProperties().sql(); + } + + /** + * Set the sql property: SQL Settings definition. + * + * @param sql the sql value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withSql(FirewallPolicySql sql) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withSql(sql); + return this; + } + + /** + * Get the dnsSettings property: DNS Proxy Settings definition. + * + * @return the dnsSettings value. + */ + public DnsSettings dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the explicitProxy property: Explicit Proxy Settings definition. + * + * @return the explicitProxy value. + */ + public ExplicitProxy explicitProxy() { + return this.innerProperties() == null ? null : this.innerProperties().explicitProxy(); + } + + /** + * Set the explicitProxy property: Explicit Proxy Settings definition. + * + * @param explicitProxy the explicitProxy value to set. + * @return the FirewallPolicyInner object itself. + */ + public FirewallPolicyInner withExplicitProxy(ExplicitProxy explicitProxy) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withExplicitProxy(explicitProxy); + return this; + } + + /** + * Get the intrusionDetection property: The configuration for Intrusion detection. + * + * @return the intrusionDetection value. + */ + public FirewallPolicyIntrusionDetection intrusionDetection() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withIntrusionDetection(intrusionDetection); + return this; + } + + /** + * Get the transportSecurity property: TLS Configuration definition. + * + * @return the transportSecurity value. + */ + public FirewallPolicyTransportSecurity transportSecurity() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withTransportSecurity(transportSecurity); + return this; + } + + /** + * Get the sku property: The Firewall Policy SKU. + * + * @return the sku value. + */ + public FirewallPolicySku sku() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyPropertiesFormat(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FirewallPolicyInner. + */ + public static FirewallPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyInner deserializedFirewallPolicyInner = new FirewallPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFirewallPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFirewallPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFirewallPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFirewallPolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFirewallPolicyInner.innerProperties = FirewallPolicyPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedFirewallPolicyInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedFirewallPolicyInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedFirewallPolicyInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyPropertiesFormat.java new file mode 100644 index 0000000000000..93af1c908d9c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyPropertiesFormat.java @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +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.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyTransportSecurity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Firewall Policy definition. + */ +@Fluent +public final class FirewallPolicyPropertiesFormat implements JsonSerializable { + /* + * A read-only string that represents the size of the FirewallPolicyPropertiesFormat in MB. (ex 0.5MB) + */ + private String size; + + /* + * List of references to FirewallPolicyRuleCollectionGroups. + */ + private List ruleCollectionGroups; + + /* + * The provisioning state of the firewall policy resource. + */ + private ProvisioningState provisioningState; + + /* + * The parent firewall policy from which rules are inherited. + */ + private SubResource basePolicy; + + /* + * List of references to Azure Firewalls that this Firewall Policy is associated with. + */ + private List firewalls; + + /* + * List of references to Child Firewall Policies. + */ + private List childPolicies; + + /* + * The operation mode for Threat Intelligence. + */ + private AzureFirewallThreatIntelMode threatIntelMode; + + /* + * ThreatIntel Whitelist for Firewall Policy. + */ + private FirewallPolicyThreatIntelWhitelist threatIntelWhitelist; + + /* + * Insights on Firewall Policy. + */ + private FirewallPolicyInsights insights; + + /* + * The private IP addresses/IP ranges to which traffic will not be SNAT. + */ + private FirewallPolicySnat snat; + + /* + * SQL Settings definition. + */ + private FirewallPolicySql sql; + + /* + * DNS Proxy Settings definition. + */ + private DnsSettings dnsSettings; + + /* + * Explicit Proxy Settings definition. + */ + private ExplicitProxy explicitProxy; + + /* + * The configuration for Intrusion detection. + */ + private FirewallPolicyIntrusionDetection intrusionDetection; + + /* + * TLS Configuration definition. + */ + private FirewallPolicyTransportSecurity transportSecurity; + + /* + * The Firewall Policy SKU. + */ + private FirewallPolicySku sku; + + /** + * Creates an instance of FirewallPolicyPropertiesFormat class. + */ + public FirewallPolicyPropertiesFormat() { + } + + /** + * Get the size property: A read-only string that represents the size of the FirewallPolicyPropertiesFormat in MB. + * (ex 0.5MB). + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat + 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat withSnat(FirewallPolicySnat snat) { + this.snat = snat; + return this; + } + + /** + * Get the sql property: SQL Settings definition. + * + * @return the sql value. + */ + public FirewallPolicySql sql() { + return this.sql; + } + + /** + * Set the sql property: SQL Settings definition. + * + * @param sql the sql value to set. + * @return the FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat withSql(FirewallPolicySql sql) { + this.sql = sql; + 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat withDnsSettings(DnsSettings dnsSettings) { + this.dnsSettings = dnsSettings; + return this; + } + + /** + * Get the explicitProxy property: Explicit Proxy Settings definition. + * + * @return the explicitProxy value. + */ + public ExplicitProxy explicitProxy() { + return this.explicitProxy; + } + + /** + * Set the explicitProxy property: Explicit Proxy Settings definition. + * + * @param explicitProxy the explicitProxy value to set. + * @return the FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat withExplicitProxy(ExplicitProxy explicitProxy) { + this.explicitProxy = explicitProxy; + 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat 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 FirewallPolicyPropertiesFormat object itself. + */ + public FirewallPolicyPropertiesFormat withSku(FirewallPolicySku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (threatIntelWhitelist() != null) { + threatIntelWhitelist().validate(); + } + if (insights() != null) { + insights().validate(); + } + if (snat() != null) { + snat().validate(); + } + if (sql() != null) { + sql().validate(); + } + if (dnsSettings() != null) { + dnsSettings().validate(); + } + if (explicitProxy() != null) { + explicitProxy().validate(); + } + if (intrusionDetection() != null) { + intrusionDetection().validate(); + } + if (transportSecurity() != null) { + transportSecurity().validate(); + } + if (sku() != null) { + sku().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("basePolicy", this.basePolicy); + jsonWriter.writeStringField("threatIntelMode", + this.threatIntelMode == null ? null : this.threatIntelMode.toString()); + jsonWriter.writeJsonField("threatIntelWhitelist", this.threatIntelWhitelist); + jsonWriter.writeJsonField("insights", this.insights); + jsonWriter.writeJsonField("snat", this.snat); + jsonWriter.writeJsonField("sql", this.sql); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeJsonField("explicitProxy", this.explicitProxy); + jsonWriter.writeJsonField("intrusionDetection", this.intrusionDetection); + jsonWriter.writeJsonField("transportSecurity", this.transportSecurity); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyPropertiesFormat. + */ + public static FirewallPolicyPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyPropertiesFormat deserializedFirewallPolicyPropertiesFormat + = new FirewallPolicyPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.size = reader.getString(); + } else if ("ruleCollectionGroups".equals(fieldName)) { + List ruleCollectionGroups = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedFirewallPolicyPropertiesFormat.ruleCollectionGroups = ruleCollectionGroups; + } else if ("provisioningState".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("basePolicy".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.basePolicy = SubResource.fromJson(reader); + } else if ("firewalls".equals(fieldName)) { + List firewalls = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedFirewallPolicyPropertiesFormat.firewalls = firewalls; + } else if ("childPolicies".equals(fieldName)) { + List childPolicies = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedFirewallPolicyPropertiesFormat.childPolicies = childPolicies; + } else if ("threatIntelMode".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.threatIntelMode + = AzureFirewallThreatIntelMode.fromString(reader.getString()); + } else if ("threatIntelWhitelist".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.threatIntelWhitelist + = FirewallPolicyThreatIntelWhitelist.fromJson(reader); + } else if ("insights".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.insights = FirewallPolicyInsights.fromJson(reader); + } else if ("snat".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.snat = FirewallPolicySnat.fromJson(reader); + } else if ("sql".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.sql = FirewallPolicySql.fromJson(reader); + } else if ("dnsSettings".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.dnsSettings = DnsSettings.fromJson(reader); + } else if ("explicitProxy".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.explicitProxy = ExplicitProxy.fromJson(reader); + } else if ("intrusionDetection".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.intrusionDetection + = FirewallPolicyIntrusionDetection.fromJson(reader); + } else if ("transportSecurity".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.transportSecurity + = FirewallPolicyTransportSecurity.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedFirewallPolicyPropertiesFormat.sku = FirewallPolicySku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftInner.java new file mode 100644 index 0000000000000..41cd70db65048 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import java.io.IOException; +import java.util.List; + +/** + * Rule Collection Group resource. + */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupDraftInner extends SubResource { + /* + * The properties of the firewall policy rule collection group. + */ + private FirewallPolicyRuleCollectionGroupDraftProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * Rule Group type. + */ + private String type; + + /** + * Creates an instance of FirewallPolicyRuleCollectionGroupDraftInner class. + */ + public FirewallPolicyRuleCollectionGroupDraftInner() { + } + + /** + * Get the innerProperties property: The properties of the firewall policy rule collection group. + * + * @return the innerProperties value. + */ + private FirewallPolicyRuleCollectionGroupDraftProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 FirewallPolicyRuleCollectionGroupDraftInner object itself. + */ + public FirewallPolicyRuleCollectionGroupDraftInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Rule Group type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicyRuleCollectionGroupDraftInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the size property: A read-only string that represents the size of the + * FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB). + * + * @return the size value. + */ + public String size() { + return this.innerProperties() == null ? null : this.innerProperties().size(); + } + + /** + * Get the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @param priority the priority value to set. + * @return the FirewallPolicyRuleCollectionGroupDraftInner object itself. + */ + public FirewallPolicyRuleCollectionGroupDraftInner withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyRuleCollectionGroupDraftProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the ruleCollections property: Group of Firewall Policy rule collections. + * + * @return the ruleCollections value. + */ + public List ruleCollections() { + return this.innerProperties() == null ? null : this.innerProperties().ruleCollections(); + } + + /** + * Set the ruleCollections property: Group of Firewall Policy rule collections. + * + * @param ruleCollections the ruleCollections value to set. + * @return the FirewallPolicyRuleCollectionGroupDraftInner object itself. + */ + public FirewallPolicyRuleCollectionGroupDraftInner + withRuleCollections(List ruleCollections) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyRuleCollectionGroupDraftProperties(); + } + this.innerProperties().withRuleCollections(ruleCollections); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRuleCollectionGroupDraftInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRuleCollectionGroupDraftInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRuleCollectionGroupDraftInner. + */ + public static FirewallPolicyRuleCollectionGroupDraftInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRuleCollectionGroupDraftInner deserializedFirewallPolicyRuleCollectionGroupDraftInner + = new FirewallPolicyRuleCollectionGroupDraftInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupDraftInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupDraftInner.innerProperties + = FirewallPolicyRuleCollectionGroupDraftProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupDraftInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupDraftInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRuleCollectionGroupDraftInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftProperties.java new file mode 100644 index 0000000000000..e4aa6ca889223 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupDraftProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the rule collection group draft. + */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupDraftProperties + implements JsonSerializable { + /* + * A read-only string that represents the size of the FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB) + */ + private String size; + + /* + * Priority of the Firewall Policy Rule Collection Group resource. + */ + private Integer priority; + + /* + * Group of Firewall Policy rule collections. + */ + private List ruleCollections; + + /** + * Creates an instance of FirewallPolicyRuleCollectionGroupDraftProperties class. + */ + public FirewallPolicyRuleCollectionGroupDraftProperties() { + } + + /** + * Get the size property: A read-only string that represents the size of the + * FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB). + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * 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 FirewallPolicyRuleCollectionGroupDraftProperties object itself. + */ + public FirewallPolicyRuleCollectionGroupDraftProperties 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 FirewallPolicyRuleCollectionGroupDraftProperties object itself. + */ + public FirewallPolicyRuleCollectionGroupDraftProperties + withRuleCollections(List ruleCollections) { + this.ruleCollections = ruleCollections; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeArrayField("ruleCollections", this.ruleCollections, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRuleCollectionGroupDraftProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRuleCollectionGroupDraftProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRuleCollectionGroupDraftProperties. + */ + public static FirewallPolicyRuleCollectionGroupDraftProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRuleCollectionGroupDraftProperties deserializedFirewallPolicyRuleCollectionGroupDraftProperties + = new FirewallPolicyRuleCollectionGroupDraftProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupDraftProperties.size = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupDraftProperties.priority + = reader.getNullable(JsonReader::getInt); + } else if ("ruleCollections".equals(fieldName)) { + List ruleCollections + = reader.readArray(reader1 -> FirewallPolicyRuleCollection.fromJson(reader1)); + deserializedFirewallPolicyRuleCollectionGroupDraftProperties.ruleCollections = ruleCollections; + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRuleCollectionGroupDraftProperties; + }); + } +} 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..849c8f8f65af9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Rule Collection Group resource. + */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupInner extends SubResource { + /* + * The properties of the firewall policy rule collection group. + */ + private FirewallPolicyRuleCollectionGroupProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Rule Group type. + */ + private String type; + + /** + * Creates an instance of FirewallPolicyRuleCollectionGroupInner class. + */ + public FirewallPolicyRuleCollectionGroupInner() { + } + + /** + * Get the innerProperties property: The properties of the firewall policy rule collection group. + * + * @return the innerProperties value. + */ + private FirewallPolicyRuleCollectionGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public FirewallPolicyRuleCollectionGroupInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the size property: A read-only string that represents the size of the + * FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB). + * + * @return the size value. + */ + public String size() { + return this.innerProperties() == null ? null : this.innerProperties().size(); + } + + /** + * Get the priority property: Priority of the Firewall Policy Rule Collection Group resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyRuleCollectionGroupProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the ruleCollections property: Group of Firewall Policy rule collections. + * + * @return the ruleCollections value. + */ + public List ruleCollections() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FirewallPolicyRuleCollectionGroupProperties(); + } + this.innerProperties().withRuleCollections(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRuleCollectionGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRuleCollectionGroupInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRuleCollectionGroupInner. + */ + public static FirewallPolicyRuleCollectionGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRuleCollectionGroupInner deserializedFirewallPolicyRuleCollectionGroupInner + = new FirewallPolicyRuleCollectionGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupInner.innerProperties + = FirewallPolicyRuleCollectionGroupProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRuleCollectionGroupInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupProperties.java new file mode 100644 index 0000000000000..b5c3ca701cf5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FirewallPolicyRuleCollectionGroupProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the rule collection group. + */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupProperties + implements JsonSerializable { + /* + * A read-only string that represents the size of the FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB) + */ + private String size; + + /* + * Priority of the Firewall Policy Rule Collection Group resource. + */ + private Integer priority; + + /* + * Group of Firewall Policy rule collections. + */ + private List ruleCollections; + + /* + * The provisioning state of the firewall policy rule collection group resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of FirewallPolicyRuleCollectionGroupProperties class. + */ + public FirewallPolicyRuleCollectionGroupProperties() { + } + + /** + * Get the size property: A read-only string that represents the size of the + * FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB). + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * 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 FirewallPolicyRuleCollectionGroupProperties object itself. + */ + public FirewallPolicyRuleCollectionGroupProperties 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 FirewallPolicyRuleCollectionGroupProperties object itself. + */ + public FirewallPolicyRuleCollectionGroupProperties + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleCollections() != null) { + ruleCollections().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeArrayField("ruleCollections", this.ruleCollections, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRuleCollectionGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRuleCollectionGroupProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRuleCollectionGroupProperties. + */ + public static FirewallPolicyRuleCollectionGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRuleCollectionGroupProperties deserializedFirewallPolicyRuleCollectionGroupProperties + = new FirewallPolicyRuleCollectionGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("size".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupProperties.size = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupProperties.priority + = reader.getNullable(JsonReader::getInt); + } else if ("ruleCollections".equals(fieldName)) { + List ruleCollections + = reader.readArray(reader1 -> FirewallPolicyRuleCollection.fromJson(reader1)); + deserializedFirewallPolicyRuleCollectionGroupProperties.ruleCollections = ruleCollections; + } else if ("provisioningState".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRuleCollectionGroupProperties; + }); + } +} 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..4ce79c3e80bc2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInformationInner.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import com.azure.resourcemanager.network.generated.models.TrafficAnalyticsProperties; +import java.io.IOException; + +/** + * Information on the configuration of flow log and traffic analytics (optional) . + */ +@Fluent +public final class FlowLogInformationInner implements JsonSerializable { + /* + * The ID of the resource to configure for flow log and traffic analytics (optional) . + */ + private String targetResourceId; + + /* + * Properties of the flow log. + */ + private FlowLogProperties innerProperties = new FlowLogProperties(); + + /* + * Parameters that define the configuration of traffic analytics. + */ + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /* + * FlowLog resource Managed Identity + */ + private ManagedServiceIdentity identity; + + /** + * Creates an instance of FlowLogInformationInner class. + */ + public FlowLogInformationInner() { + } + + /** + * 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 innerProperties property: Properties of the flow log. + * + * @return the innerProperties value. + */ + private FlowLogProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 identity property: FlowLog resource Managed Identity. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: FlowLog resource Managed Identity. + * + * @param identity the identity value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogProperties(); + } + this.innerProperties().withStorageId(storageId); + return this; + } + + /** + * Get the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @return the enabledFilteringCriteria value. + */ + public String enabledFilteringCriteria() { + return this.innerProperties() == null ? null : this.innerProperties().enabledFilteringCriteria(); + } + + /** + * Set the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @param enabledFilteringCriteria the enabledFilteringCriteria value to set. + * @return the FlowLogInformationInner object itself. + */ + public FlowLogInformationInner withEnabledFilteringCriteria(String enabledFilteringCriteria) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogProperties(); + } + this.innerProperties().withEnabledFilteringCriteria(enabledFilteringCriteria); + return this; + } + + /** + * Get the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.innerProperties() == null ? false : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogProperties(); + } + this.innerProperties().withEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogProperties(); + } + this.innerProperties().withRetentionPolicy(retentionPolicy); + return this; + } + + /** + * Get the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + public FlowLogFormatParameters format() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogProperties(); + } + this.innerProperties().withFormat(format); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogInformationInner")); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model FlowLogInformationInner")); + } else { + innerProperties().validate(); + } + if (flowAnalyticsConfiguration() != null) { + flowAnalyticsConfiguration().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowLogInformationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("flowAnalyticsConfiguration", this.flowAnalyticsConfiguration); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowLogInformationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowLogInformationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlowLogInformationInner. + */ + public static FlowLogInformationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowLogInformationInner deserializedFlowLogInformationInner = new FlowLogInformationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedFlowLogInformationInner.targetResourceId = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFlowLogInformationInner.innerProperties = FlowLogProperties.fromJson(reader); + } else if ("flowAnalyticsConfiguration".equals(fieldName)) { + deserializedFlowLogInformationInner.flowAnalyticsConfiguration + = TrafficAnalyticsProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedFlowLogInformationInner.identity = ManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowLogInformationInner; + }); + } +} 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..a3079e1553606 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +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 java.io.IOException; +import java.util.Map; + +/** + * A flow log resource. + */ +@Fluent +public final class FlowLogInner extends Resource { + /* + * Properties of the flow log. + */ + private FlowLogPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * FlowLog resource Managed Identity + */ + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of FlowLogInner class. + */ + public FlowLogInner() { + } + + /** + * Get the innerProperties property: Properties of the flow log. + * + * @return the innerProperties value. + */ + private FlowLogPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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: FlowLog resource Managed Identity. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: FlowLog resource Managed Identity. + * + * @param identity the identity value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + 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 FlowLogInner object itself. + */ + public FlowLogInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public FlowLogInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FlowLogInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogPropertiesFormat(); + } + this.innerProperties().withTargetResourceId(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogPropertiesFormat(); + } + this.innerProperties().withStorageId(storageId); + return this; + } + + /** + * Get the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @return the enabledFilteringCriteria value. + */ + public String enabledFilteringCriteria() { + return this.innerProperties() == null ? null : this.innerProperties().enabledFilteringCriteria(); + } + + /** + * Set the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @param enabledFilteringCriteria the enabledFilteringCriteria value to set. + * @return the FlowLogInner object itself. + */ + public FlowLogInner withEnabledFilteringCriteria(String enabledFilteringCriteria) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogPropertiesFormat(); + } + this.innerProperties().withEnabledFilteringCriteria(enabledFilteringCriteria); + return this; + } + + /** + * Get the enabled property: Flag to enable/disable flow logging. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogPropertiesFormat(); + } + this.innerProperties().withEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogPropertiesFormat(); + } + this.innerProperties().withRetentionPolicy(retentionPolicy); + return this; + } + + /** + * Get the format property: Parameters that define the flow log format. + * + * @return the format value. + */ + public FlowLogFormatParameters format() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogPropertiesFormat(); + } + this.innerProperties().withFormat(format); + return this; + } + + /** + * Get the flowAnalyticsConfiguration property: Parameters that define the configuration of traffic analytics. + * + * @return the flowAnalyticsConfiguration value. + */ + public TrafficAnalyticsProperties flowAnalyticsConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FlowLogPropertiesFormat(); + } + this.innerProperties().withFlowAnalyticsConfiguration(flowAnalyticsConfiguration); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the flow log. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowLogInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowLogInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlowLogInner. + */ + public static FlowLogInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowLogInner deserializedFlowLogInner = new FlowLogInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFlowLogInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFlowLogInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFlowLogInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFlowLogInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFlowLogInner.innerProperties = FlowLogPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedFlowLogInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedFlowLogInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedFlowLogInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowLogInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogProperties.java new file mode 100644 index 0000000000000..70ecd1747b0cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.RetentionPolicyParameters; +import java.io.IOException; + +/** + * Parameters that define the configuration of flow log. + */ +@Fluent +public final class FlowLogProperties implements JsonSerializable { + /* + * ID of the storage account which is used to store the flow log. + */ + private String storageId; + + /* + * Optional field to filter network traffic logs based on SrcIP, SrcPort, DstIP, DstPort, Protocol, Encryption, + * Direction and Action. If not specified, all network traffic will be logged. + */ + private String enabledFilteringCriteria; + + /* + * Flag to enable/disable flow logging. + */ + private boolean enabled; + + /* + * Parameters that define the retention policy for flow log. + */ + private RetentionPolicyParameters retentionPolicy; + + /* + * Parameters that define the flow log format. + */ + private FlowLogFormatParameters format; + + /** + * Creates an instance of FlowLogProperties class. + */ + public FlowLogProperties() { + } + + /** + * 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 FlowLogProperties object itself. + */ + public FlowLogProperties withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @return the enabledFilteringCriteria value. + */ + public String enabledFilteringCriteria() { + return this.enabledFilteringCriteria; + } + + /** + * Set the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @param enabledFilteringCriteria the enabledFilteringCriteria value to set. + * @return the FlowLogProperties object itself. + */ + public FlowLogProperties withEnabledFilteringCriteria(String enabledFilteringCriteria) { + this.enabledFilteringCriteria = enabledFilteringCriteria; + 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 FlowLogProperties object itself. + */ + public FlowLogProperties 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 FlowLogProperties object itself. + */ + public FlowLogProperties 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 FlowLogProperties object itself. + */ + public FlowLogProperties withFormat(FlowLogFormatParameters format) { + this.format = format; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property storageId in model FlowLogProperties")); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + if (format() != null) { + format().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowLogProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageId", this.storageId); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("enabledFilteringCriteria", this.enabledFilteringCriteria); + jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy); + jsonWriter.writeJsonField("format", this.format); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowLogProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowLogProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlowLogProperties. + */ + public static FlowLogProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowLogProperties deserializedFlowLogProperties = new FlowLogProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageId".equals(fieldName)) { + deserializedFlowLogProperties.storageId = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedFlowLogProperties.enabled = reader.getBoolean(); + } else if ("enabledFilteringCriteria".equals(fieldName)) { + deserializedFlowLogProperties.enabledFilteringCriteria = reader.getString(); + } else if ("retentionPolicy".equals(fieldName)) { + deserializedFlowLogProperties.retentionPolicy = RetentionPolicyParameters.fromJson(reader); + } else if ("format".equals(fieldName)) { + deserializedFlowLogProperties.format = FlowLogFormatParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowLogProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogPropertiesFormat.java new file mode 100644 index 0000000000000..bb49cf28cdd14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FlowLogPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Parameters that define the configuration of flow log. + */ +@Fluent +public final class FlowLogPropertiesFormat implements JsonSerializable { + /* + * ID of network security group to which flow log will be applied. + */ + private String targetResourceId; + + /* + * Guid of network security group to which flow log will be applied. + */ + private String targetResourceGuid; + + /* + * ID of the storage account which is used to store the flow log. + */ + private String storageId; + + /* + * Optional field to filter network traffic logs based on SrcIP, SrcPort, DstIP, DstPort, Protocol, Encryption, + * Direction and Action. If not specified, all network traffic will be logged. + */ + private String enabledFilteringCriteria; + + /* + * Flag to enable/disable flow logging. + */ + private Boolean enabled; + + /* + * Parameters that define the retention policy for flow log. + */ + private RetentionPolicyParameters retentionPolicy; + + /* + * Parameters that define the flow log format. + */ + private FlowLogFormatParameters format; + + /* + * Parameters that define the configuration of traffic analytics. + */ + private TrafficAnalyticsProperties flowAnalyticsConfiguration; + + /* + * The provisioning state of the flow log. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of FlowLogPropertiesFormat class. + */ + public FlowLogPropertiesFormat() { + } + + /** + * 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 FlowLogPropertiesFormat object itself. + */ + public FlowLogPropertiesFormat 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 FlowLogPropertiesFormat object itself. + */ + public FlowLogPropertiesFormat withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Get the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @return the enabledFilteringCriteria value. + */ + public String enabledFilteringCriteria() { + return this.enabledFilteringCriteria; + } + + /** + * Set the enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be logged. + * + * @param enabledFilteringCriteria the enabledFilteringCriteria value to set. + * @return the FlowLogPropertiesFormat object itself. + */ + public FlowLogPropertiesFormat withEnabledFilteringCriteria(String enabledFilteringCriteria) { + this.enabledFilteringCriteria = enabledFilteringCriteria; + 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 FlowLogPropertiesFormat object itself. + */ + public FlowLogPropertiesFormat 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 FlowLogPropertiesFormat object itself. + */ + public FlowLogPropertiesFormat 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 FlowLogPropertiesFormat object itself. + */ + public FlowLogPropertiesFormat 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 FlowLogPropertiesFormat object itself. + */ + public FlowLogPropertiesFormat + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogPropertiesFormat")); + } + if (storageId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageId in model FlowLogPropertiesFormat")); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + if (format() != null) { + format().validate(); + } + if (flowAnalyticsConfiguration() != null) { + flowAnalyticsConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowLogPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeStringField("storageId", this.storageId); + jsonWriter.writeStringField("enabledFilteringCriteria", this.enabledFilteringCriteria); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy); + jsonWriter.writeJsonField("format", this.format); + jsonWriter.writeJsonField("flowAnalyticsConfiguration", this.flowAnalyticsConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowLogPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowLogPropertiesFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlowLogPropertiesFormat. + */ + public static FlowLogPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowLogPropertiesFormat deserializedFlowLogPropertiesFormat = new FlowLogPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.targetResourceId = reader.getString(); + } else if ("storageId".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.storageId = reader.getString(); + } else if ("targetResourceGuid".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.targetResourceGuid = reader.getString(); + } else if ("enabledFilteringCriteria".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.enabledFilteringCriteria = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("retentionPolicy".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.retentionPolicy = RetentionPolicyParameters.fromJson(reader); + } else if ("format".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.format = FlowLogFormatParameters.fromJson(reader); + } else if ("flowAnalyticsConfiguration".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.flowAnalyticsConfiguration + = TrafficAnalyticsProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedFlowLogPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowLogPropertiesFormat; + }); + } +} 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..e0efb8a220c1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Frontend IP address of the load balancer. + */ +@Fluent +public final class FrontendIpConfigurationInner extends SubResource { + /* + * Properties of the load balancer probe. + */ + private FrontendIpConfigurationPropertiesFormatInner innerProperties; + + /* + * 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. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + private List zones; + + /** + * Creates an instance of FrontendIpConfigurationInner class. + */ + public FrontendIpConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of the load balancer probe. + * + * @return the innerProperties value. + */ + private FrontendIpConfigurationPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public FrontendIpConfigurationInner withId(String id) { + super.withId(id); + 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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().loadBalancingRules(); + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The Private IP allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAllocationMethod(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the publicIpAddress property: The reference to the Public IP resource. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the publicIpPrefix property: The reference to the Public IP Prefix resource. + * + * @return the publicIpPrefix value. + */ + public SubResource publicIpPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPublicIpPrefix(publicIpPrefix); + return this; + } + + /** + * Get the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + public SubResource gatewayLoadBalancer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new FrontendIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withGatewayLoadBalancer(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FrontendIpConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FrontendIpConfigurationInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FrontendIpConfigurationInner. + */ + public static FrontendIpConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FrontendIpConfigurationInner deserializedFrontendIpConfigurationInner = new FrontendIpConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFrontendIpConfigurationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedFrontendIpConfigurationInner.innerProperties + = FrontendIpConfigurationPropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedFrontendIpConfigurationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedFrontendIpConfigurationInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFrontendIpConfigurationInner.type = reader.getString(); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedFrontendIpConfigurationInner.zones = zones; + } else { + reader.skipChildren(); + } + } + + return deserializedFrontendIpConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationPropertiesFormatInner.java new file mode 100644 index 0000000000000..45e963b900026 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/FrontendIpConfigurationPropertiesFormatInner.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Properties of Frontend IP Configuration of the load balancer. + */ +@Fluent +public final class FrontendIpConfigurationPropertiesFormatInner + implements JsonSerializable { + /* + * An array of references to inbound rules that use this frontend IP. + */ + private List inboundNatRules; + + /* + * An array of references to inbound pools that use this frontend IP. + */ + private List inboundNatPools; + + /* + * An array of references to outbound rules that use this frontend IP. + */ + private List outboundRules; + + /* + * An array of references to load balancing rules that use this frontend IP. + */ + private List loadBalancingRules; + + /* + * The private IP address of the IP configuration. + */ + private String privateIpAddress; + + /* + * The Private IP allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. + */ + private IpVersion privateIpAddressVersion; + + /* + * The reference to the subnet resource. + */ + private SubnetInner subnet; + + /* + * The reference to the Public IP resource. + */ + private PublicIpAddressInner publicIpAddress; + + /* + * The reference to the Public IP Prefix resource. + */ + private SubResource publicIpPrefix; + + /* + * The reference to gateway load balancer frontend IP. + */ + private SubResource gatewayLoadBalancer; + + /* + * The provisioning state of the frontend IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of FrontendIpConfigurationPropertiesFormatInner class. + */ + public FrontendIpConfigurationPropertiesFormatInner() { + } + + /** + * 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 FrontendIpConfigurationPropertiesFormatInner object itself. + */ + public FrontendIpConfigurationPropertiesFormatInner 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 FrontendIpConfigurationPropertiesFormatInner object itself. + */ + public FrontendIpConfigurationPropertiesFormatInner + 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 FrontendIpConfigurationPropertiesFormatInner object itself. + */ + public FrontendIpConfigurationPropertiesFormatInner 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 FrontendIpConfigurationPropertiesFormatInner object itself. + */ + public FrontendIpConfigurationPropertiesFormatInner 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 FrontendIpConfigurationPropertiesFormatInner object itself. + */ + public FrontendIpConfigurationPropertiesFormatInner 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 FrontendIpConfigurationPropertiesFormatInner object itself. + */ + public FrontendIpConfigurationPropertiesFormatInner 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 FrontendIpConfigurationPropertiesFormatInner object itself. + */ + public FrontendIpConfigurationPropertiesFormatInner 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeStringField("privateIPAddressVersion", + this.privateIpAddressVersion == null ? null : this.privateIpAddressVersion.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + jsonWriter.writeJsonField("publicIPPrefix", this.publicIpPrefix); + jsonWriter.writeJsonField("gatewayLoadBalancer", this.gatewayLoadBalancer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FrontendIpConfigurationPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FrontendIpConfigurationPropertiesFormatInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FrontendIpConfigurationPropertiesFormatInner. + */ + public static FrontendIpConfigurationPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FrontendIpConfigurationPropertiesFormatInner deserializedFrontendIpConfigurationPropertiesFormatInner + = new FrontendIpConfigurationPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inboundNatRules".equals(fieldName)) { + List inboundNatRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedFrontendIpConfigurationPropertiesFormatInner.inboundNatRules = inboundNatRules; + } else if ("inboundNatPools".equals(fieldName)) { + List inboundNatPools = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedFrontendIpConfigurationPropertiesFormatInner.inboundNatPools = inboundNatPools; + } else if ("outboundRules".equals(fieldName)) { + List outboundRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedFrontendIpConfigurationPropertiesFormatInner.outboundRules = outboundRules; + } else if ("loadBalancingRules".equals(fieldName)) { + List loadBalancingRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedFrontendIpConfigurationPropertiesFormatInner.loadBalancingRules = loadBalancingRules; + } else if ("privateIPAddress".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.privateIpAddress = reader.getString(); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("privateIPAddressVersion".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.privateIpAddressVersion + = IpVersion.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.subnet = SubnetInner.fromJson(reader); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.publicIpAddress + = PublicIpAddressInner.fromJson(reader); + } else if ("publicIPPrefix".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.publicIpPrefix + = SubResource.fromJson(reader); + } else if ("gatewayLoadBalancer".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.gatewayLoadBalancer + = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedFrontendIpConfigurationPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFrontendIpConfigurationPropertiesFormatInner; + }); + } +} 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..dfc29a8c25548 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GatewayRouteListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GatewayRoute; +import java.io.IOException; +import java.util.List; + +/** + * List of virtual network gateway routes. + */ +@Fluent +public final class GatewayRouteListResultInner implements JsonSerializable { + /* + * List of gateway routes. + */ + private List value; + + /** + * Creates an instance of GatewayRouteListResultInner class. + */ + public GatewayRouteListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GatewayRouteListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GatewayRouteListResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GatewayRouteListResultInner. + */ + public static GatewayRouteListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GatewayRouteListResultInner deserializedGatewayRouteListResultInner = new GatewayRouteListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GatewayRoute.fromJson(reader1)); + deserializedGatewayRouteListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedGatewayRouteListResultInner; + }); + } +} 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..48f79333efd45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/GenerateExpressRoutePortsLoaResultInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response for GenerateExpressRoutePortsLOA API service call. + */ +@Fluent +public final class GenerateExpressRoutePortsLoaResultInner + implements JsonSerializable { + /* + * The content as a base64 encoded string. + */ + private String encodedContent; + + /** + * Creates an instance of GenerateExpressRoutePortsLoaResultInner class. + */ + public GenerateExpressRoutePortsLoaResultInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("encodedContent", this.encodedContent); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateExpressRoutePortsLoaResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateExpressRoutePortsLoaResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GenerateExpressRoutePortsLoaResultInner. + */ + public static GenerateExpressRoutePortsLoaResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateExpressRoutePortsLoaResultInner deserializedGenerateExpressRoutePortsLoaResultInner + = new GenerateExpressRoutePortsLoaResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("encodedContent".equals(fieldName)) { + deserializedGenerateExpressRoutePortsLoaResultInner.encodedContent = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateExpressRoutePortsLoaResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HopLinkProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HopLinkProperties.java new file mode 100644 index 0000000000000..fbcffa9f1a982 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HopLinkProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Hop link properties. + */ +@Immutable +public final class HopLinkProperties implements JsonSerializable { + /* + * Minimum roundtrip time in milliseconds. + */ + private Long roundTripTimeMin; + + /* + * Average roundtrip time in milliseconds. + */ + private Long roundTripTimeAvg; + + /* + * Maximum roundtrip time in milliseconds. + */ + private Long roundTripTimeMax; + + /** + * Creates an instance of HopLinkProperties class. + */ + public HopLinkProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HopLinkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HopLinkProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HopLinkProperties. + */ + public static HopLinkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HopLinkProperties deserializedHopLinkProperties = new HopLinkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roundTripTimeMin".equals(fieldName)) { + deserializedHopLinkProperties.roundTripTimeMin = reader.getNullable(JsonReader::getLong); + } else if ("roundTripTimeAvg".equals(fieldName)) { + deserializedHopLinkProperties.roundTripTimeAvg = reader.getNullable(JsonReader::getLong); + } else if ("roundTripTimeMax".equals(fieldName)) { + deserializedHopLinkProperties.roundTripTimeMax = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedHopLinkProperties; + }); + } +} 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..cb891421e6a76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationInner.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * IpConfigurations. + */ +@Fluent +public final class HubIpConfigurationInner extends SubResource { + /* + * The properties of the Virtual Hub IPConfigurations. + */ + private HubIpConfigurationPropertiesFormatInner innerProperties; + + /* + * Name of the Ip Configuration. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Ipconfiguration type. + */ + private String type; + + /** + * Creates an instance of HubIpConfigurationInner class. + */ + public HubIpConfigurationInner() { + } + + /** + * Get the innerProperties property: The properties of the Virtual Hub IPConfigurations. + * + * @return the innerProperties value. + */ + private HubIpConfigurationPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public HubIpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubIpConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubIpConfigurationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HubIpConfigurationInner. + */ + public static HubIpConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubIpConfigurationInner deserializedHubIpConfigurationInner = new HubIpConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHubIpConfigurationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedHubIpConfigurationInner.innerProperties + = HubIpConfigurationPropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedHubIpConfigurationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedHubIpConfigurationInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHubIpConfigurationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHubIpConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationPropertiesFormatInner.java new file mode 100644 index 0000000000000..9fd60a37c6ec6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubIpConfigurationPropertiesFormatInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of IP configuration. + */ +@Fluent +public final class HubIpConfigurationPropertiesFormatInner + implements JsonSerializable { + /* + * The private IP address of the IP configuration. + */ + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + private SubnetInner subnet; + + /* + * The reference to the public IP resource. + */ + private PublicIpAddressInner publicIpAddress; + + /* + * The provisioning state of the IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of HubIpConfigurationPropertiesFormatInner class. + */ + public HubIpConfigurationPropertiesFormatInner() { + } + + /** + * 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 HubIpConfigurationPropertiesFormatInner object itself. + */ + public HubIpConfigurationPropertiesFormatInner 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 HubIpConfigurationPropertiesFormatInner object itself. + */ + public HubIpConfigurationPropertiesFormatInner + 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 HubIpConfigurationPropertiesFormatInner object itself. + */ + public HubIpConfigurationPropertiesFormatInner 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 HubIpConfigurationPropertiesFormatInner object itself. + */ + public HubIpConfigurationPropertiesFormatInner 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubIpConfigurationPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubIpConfigurationPropertiesFormatInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HubIpConfigurationPropertiesFormatInner. + */ + public static HubIpConfigurationPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubIpConfigurationPropertiesFormatInner deserializedHubIpConfigurationPropertiesFormatInner + = new HubIpConfigurationPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAddress".equals(fieldName)) { + deserializedHubIpConfigurationPropertiesFormatInner.privateIpAddress = reader.getString(); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedHubIpConfigurationPropertiesFormatInner.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedHubIpConfigurationPropertiesFormatInner.subnet = SubnetInner.fromJson(reader); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedHubIpConfigurationPropertiesFormatInner.publicIpAddress + = PublicIpAddressInner.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedHubIpConfigurationPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHubIpConfigurationPropertiesFormatInner; + }); + } +} 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..648f5ae4955a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableInner.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * RouteTable resource in a virtual hub. + */ +@Fluent +public final class HubRouteTableInner extends SubResource { + /* + * Properties of the RouteTable resource. + */ + private HubRouteTableProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of HubRouteTableInner class. + */ + public HubRouteTableInner() { + } + + /** + * Get the innerProperties property: Properties of the RouteTable resource. + * + * @return the innerProperties value. + */ + private HubRouteTableProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public HubRouteTableInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the routes property: List of all routes. + * + * @return the routes value. + */ + public List routes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubRouteTableProperties(); + } + this.innerProperties().withRoutes(routes); + return this; + } + + /** + * Get the labels property: List of labels associated with this route table. + * + * @return the labels value. + */ + public List labels() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubRouteTableProperties(); + } + this.innerProperties().withLabels(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.innerProperties() == null ? null : this.innerProperties().associatedConnections(); + } + + /** + * Get the propagatingConnections property: List of all connections that advertise to this route table. + * + * @return the propagatingConnections value. + */ + public List propagatingConnections() { + return this.innerProperties() == null ? null : this.innerProperties().propagatingConnections(); + } + + /** + * Get the provisioningState property: The provisioning state of the RouteTable resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubRouteTableInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubRouteTableInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HubRouteTableInner. + */ + public static HubRouteTableInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubRouteTableInner deserializedHubRouteTableInner = new HubRouteTableInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHubRouteTableInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedHubRouteTableInner.innerProperties = HubRouteTableProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedHubRouteTableInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedHubRouteTableInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedHubRouteTableInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHubRouteTableInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableProperties.java new file mode 100644 index 0000000000000..36209188887d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubRouteTableProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.HubRoute; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for RouteTable. + */ +@Fluent +public final class HubRouteTableProperties implements JsonSerializable { + /* + * List of all routes. + */ + private List routes; + + /* + * List of labels associated with this route table. + */ + private List labels; + + /* + * List of all connections associated with this route table. + */ + private List associatedConnections; + + /* + * List of all connections that advertise to this route table. + */ + private List propagatingConnections; + + /* + * The provisioning state of the RouteTable resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of HubRouteTableProperties class. + */ + public HubRouteTableProperties() { + } + + /** + * 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 HubRouteTableProperties object itself. + */ + public HubRouteTableProperties 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 HubRouteTableProperties object itself. + */ + public HubRouteTableProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routes", this.routes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubRouteTableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubRouteTableProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HubRouteTableProperties. + */ + public static HubRouteTableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubRouteTableProperties deserializedHubRouteTableProperties = new HubRouteTableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routes".equals(fieldName)) { + List routes = reader.readArray(reader1 -> HubRoute.fromJson(reader1)); + deserializedHubRouteTableProperties.routes = routes; + } else if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> reader1.getString()); + deserializedHubRouteTableProperties.labels = labels; + } else if ("associatedConnections".equals(fieldName)) { + List associatedConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedHubRouteTableProperties.associatedConnections = associatedConnections; + } else if ("propagatingConnections".equals(fieldName)) { + List propagatingConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedHubRouteTableProperties.propagatingConnections = propagatingConnections; + } else if ("provisioningState".equals(fieldName)) { + deserializedHubRouteTableProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHubRouteTableProperties; + }); + } +} 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..80acd817a164b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.io.IOException; + +/** + * HubVirtualNetworkConnection Resource. + */ +@Fluent +public final class HubVirtualNetworkConnectionInner extends SubResource { + /* + * Properties of the hub virtual network connection. + */ + private HubVirtualNetworkConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of HubVirtualNetworkConnectionInner class. + */ + public HubVirtualNetworkConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the hub virtual network connection. + * + * @return the innerProperties value. + */ + private HubVirtualNetworkConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public HubVirtualNetworkConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the remoteVirtualNetwork property: Reference to the remote virtual network. + * + * @return the remoteVirtualNetwork value. + */ + public SubResource remoteVirtualNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubVirtualNetworkConnectionProperties(); + } + this.innerProperties().withRemoteVirtualNetwork(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubVirtualNetworkConnectionProperties(); + } + this.innerProperties().withAllowHubToRemoteVnetTransit(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubVirtualNetworkConnectionProperties(); + } + this.innerProperties().withAllowRemoteVnetToUseHubVnetGateways(allowRemoteVnetToUseHubVnetGateways); + return this; + } + + /** + * Get the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubVirtualNetworkConnectionProperties(); + } + this.innerProperties().withEnableInternetSecurity(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new HubVirtualNetworkConnectionProperties(); + } + this.innerProperties().withRoutingConfiguration(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubVirtualNetworkConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubVirtualNetworkConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HubVirtualNetworkConnectionInner. + */ + public static HubVirtualNetworkConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubVirtualNetworkConnectionInner deserializedHubVirtualNetworkConnectionInner + = new HubVirtualNetworkConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionInner.innerProperties + = HubVirtualNetworkConnectionProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHubVirtualNetworkConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionProperties.java new file mode 100644 index 0000000000000..5d9d3e5200d13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/HubVirtualNetworkConnectionProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.io.IOException; + +/** + * Parameters for HubVirtualNetworkConnection. + */ +@Fluent +public final class HubVirtualNetworkConnectionProperties + implements JsonSerializable { + /* + * Reference to the remote virtual network. + */ + private SubResource remoteVirtualNetwork; + + /* + * Deprecated: VirtualHub to RemoteVnet transit to enabled or not. + */ + private Boolean allowHubToRemoteVnetTransit; + + /* + * Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. + */ + private Boolean allowRemoteVnetToUseHubVnetGateways; + + /* + * Enable internet security. + */ + private Boolean enableInternetSecurity; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + private RoutingConfiguration routingConfiguration; + + /* + * The provisioning state of the hub virtual network connection resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of HubVirtualNetworkConnectionProperties class. + */ + public HubVirtualNetworkConnectionProperties() { + } + + /** + * 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 HubVirtualNetworkConnectionProperties object itself. + */ + public HubVirtualNetworkConnectionProperties 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 HubVirtualNetworkConnectionProperties object itself. + */ + public HubVirtualNetworkConnectionProperties 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 HubVirtualNetworkConnectionProperties object itself. + */ + public HubVirtualNetworkConnectionProperties + 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 HubVirtualNetworkConnectionProperties object itself. + */ + public HubVirtualNetworkConnectionProperties 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 HubVirtualNetworkConnectionProperties object itself. + */ + public HubVirtualNetworkConnectionProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("remoteVirtualNetwork", this.remoteVirtualNetwork); + jsonWriter.writeBooleanField("allowHubToRemoteVnetTransit", this.allowHubToRemoteVnetTransit); + jsonWriter.writeBooleanField("allowRemoteVnetToUseHubVnetGateways", this.allowRemoteVnetToUseHubVnetGateways); + jsonWriter.writeBooleanField("enableInternetSecurity", this.enableInternetSecurity); + jsonWriter.writeJsonField("routingConfiguration", this.routingConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubVirtualNetworkConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubVirtualNetworkConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the HubVirtualNetworkConnectionProperties. + */ + public static HubVirtualNetworkConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubVirtualNetworkConnectionProperties deserializedHubVirtualNetworkConnectionProperties + = new HubVirtualNetworkConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteVirtualNetwork".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionProperties.remoteVirtualNetwork + = SubResource.fromJson(reader); + } else if ("allowHubToRemoteVnetTransit".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionProperties.allowHubToRemoteVnetTransit + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowRemoteVnetToUseHubVnetGateways".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionProperties.allowRemoteVnetToUseHubVnetGateways + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableInternetSecurity".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionProperties.enableInternetSecurity + = reader.getNullable(JsonReader::getBoolean); + } else if ("routingConfiguration".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionProperties.routingConfiguration + = RoutingConfiguration.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedHubVirtualNetworkConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHubVirtualNetworkConnectionProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatPoolPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatPoolPropertiesFormat.java new file mode 100644 index 0000000000000..d25f95fd94a9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatPoolPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import java.io.IOException; + +/** + * Properties of Inbound NAT pool. + */ +@Fluent +public final class InboundNatPoolPropertiesFormat implements JsonSerializable { + /* + * A reference to frontend IP addresses. + */ + private SubResource frontendIpConfiguration; + + /* + * The reference to the transport protocol used by the inbound NAT pool. + */ + 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. + */ + private int 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. + */ + private int frontendPortRangeEnd; + + /* + * The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. + */ + private int 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. + */ + 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. + */ + 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. + */ + private Boolean enableTcpReset; + + /* + * The provisioning state of the inbound NAT pool resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of InboundNatPoolPropertiesFormat class. + */ + public InboundNatPoolPropertiesFormat() { + } + + /** + * 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat 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 int 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat withFrontendPortRangeStart(int 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 int 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat withFrontendPortRangeEnd(int 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 int 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat withBackendPort(int 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat 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 InboundNatPoolPropertiesFormat object itself. + */ + public InboundNatPoolPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocol in model InboundNatPoolPropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InboundNatPoolPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeIntField("frontendPortRangeStart", this.frontendPortRangeStart); + jsonWriter.writeIntField("frontendPortRangeEnd", this.frontendPortRangeEnd); + jsonWriter.writeIntField("backendPort", this.backendPort); + jsonWriter.writeJsonField("frontendIPConfiguration", this.frontendIpConfiguration); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + jsonWriter.writeBooleanField("enableFloatingIP", this.enableFloatingIp); + jsonWriter.writeBooleanField("enableTcpReset", this.enableTcpReset); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundNatPoolPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundNatPoolPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InboundNatPoolPropertiesFormat. + */ + public static InboundNatPoolPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundNatPoolPropertiesFormat deserializedInboundNatPoolPropertiesFormat + = new InboundNatPoolPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.protocol + = TransportProtocol.fromString(reader.getString()); + } else if ("frontendPortRangeStart".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.frontendPortRangeStart = reader.getInt(); + } else if ("frontendPortRangeEnd".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.frontendPortRangeEnd = reader.getInt(); + } else if ("backendPort".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.backendPort = reader.getInt(); + } else if ("frontendIPConfiguration".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.frontendIpConfiguration = SubResource.fromJson(reader); + } else if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("enableFloatingIP".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.enableFloatingIp + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableTcpReset".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.enableTcpReset + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedInboundNatPoolPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundNatPoolPropertiesFormat; + }); + } +} 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..bb256db59fd7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRuleInner.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import java.io.IOException; + +/** + * Inbound NAT rule of the load balancer. + */ +@Fluent +public final class InboundNatRuleInner extends SubResource { + /* + * Properties of load balancer inbound NAT rule. + */ + private InboundNatRulePropertiesFormatInner innerProperties; + + /* + * 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. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of InboundNatRuleInner class. + */ + public InboundNatRuleInner() { + } + + /** + * Get the innerProperties property: Properties of load balancer inbound NAT rule. + * + * @return the innerProperties value. + */ + private InboundNatRulePropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public InboundNatRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withFrontendIpConfiguration(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withProtocol(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withFrontendPort(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withBackendPort(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withIdleTimeoutInMinutes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withEnableFloatingIp(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withEnableTcpReset(enableTcpReset); + return this; + } + + /** + * Get the frontendPortRangeStart property: The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeStart value. + */ + public Integer frontendPortRangeStart() { + return this.innerProperties() == null ? null : this.innerProperties().frontendPortRangeStart(); + } + + /** + * Set the frontendPortRangeStart property: The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @param frontendPortRangeStart the frontendPortRangeStart value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendPortRangeStart(Integer frontendPortRangeStart) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withFrontendPortRangeStart(frontendPortRangeStart); + return this; + } + + /** + * Get the frontendPortRangeEnd property: The port range end for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeEnd value. + */ + public Integer frontendPortRangeEnd() { + return this.innerProperties() == null ? null : this.innerProperties().frontendPortRangeEnd(); + } + + /** + * Set the frontendPortRangeEnd property: The port range end for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withFrontendPortRangeEnd(Integer frontendPortRangeEnd) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withFrontendPortRangeEnd(frontendPortRangeEnd); + return this; + } + + /** + * Get the backendAddressPool property: A reference to backendAddressPool resource. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.innerProperties() == null ? null : this.innerProperties().backendAddressPool(); + } + + /** + * Set the backendAddressPool property: A reference to backendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the InboundNatRuleInner object itself. + */ + public InboundNatRuleInner withBackendAddressPool(SubResource backendAddressPool) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatRulePropertiesFormatInner(); + } + this.innerProperties().withBackendAddressPool(backendAddressPool); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the inbound NAT rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundNatRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundNatRuleInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundNatRuleInner. + */ + public static InboundNatRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundNatRuleInner deserializedInboundNatRuleInner = new InboundNatRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedInboundNatRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedInboundNatRuleInner.innerProperties + = InboundNatRulePropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedInboundNatRuleInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedInboundNatRuleInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedInboundNatRuleInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundNatRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRulePropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRulePropertiesFormatInner.java new file mode 100644 index 0000000000000..c1b389485beaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundNatRulePropertiesFormatInner.java @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import java.io.IOException; + +/** + * Properties of the inbound NAT rule. + */ +@Fluent +public final class InboundNatRulePropertiesFormatInner + implements JsonSerializable { + /* + * A reference to frontend IP addresses. + */ + 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. + */ + private NetworkInterfaceIpConfigurationInner backendIpConfiguration; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + 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. + */ + private Integer frontendPort; + + /* + * The port used for the internal endpoint. Acceptable values range from 1 to 65535. + */ + 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. + */ + 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. + */ + 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. + */ + private Boolean enableTcpReset; + + /* + * The port range start for the external endpoint. This property is used together with BackendAddressPool and + * FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be created for each backend address from + * BackendAddressPool. Acceptable values range from 1 to 65534. + */ + private Integer frontendPortRangeStart; + + /* + * The port range end for the external endpoint. This property is used together with BackendAddressPool and + * FrontendPortRangeStart. Individual inbound NAT rule port mappings will be created for each backend address from + * BackendAddressPool. Acceptable values range from 1 to 65534. + */ + private Integer frontendPortRangeEnd; + + /* + * A reference to backendAddressPool resource. + */ + private SubResource backendAddressPool; + + /* + * The provisioning state of the inbound NAT rule resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of InboundNatRulePropertiesFormatInner class. + */ + public InboundNatRulePropertiesFormatInner() { + } + + /** + * 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 InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner 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 InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner 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 InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner 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 InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner 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 InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner 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 InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner 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 InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner withEnableTcpReset(Boolean enableTcpReset) { + this.enableTcpReset = enableTcpReset; + return this; + } + + /** + * Get the frontendPortRangeStart property: The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeStart value. + */ + public Integer frontendPortRangeStart() { + return this.frontendPortRangeStart; + } + + /** + * Set the frontendPortRangeStart property: The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @param frontendPortRangeStart the frontendPortRangeStart value to set. + * @return the InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner withFrontendPortRangeStart(Integer frontendPortRangeStart) { + this.frontendPortRangeStart = frontendPortRangeStart; + return this; + } + + /** + * Get the frontendPortRangeEnd property: The port range end for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeEnd value. + */ + public Integer frontendPortRangeEnd() { + return this.frontendPortRangeEnd; + } + + /** + * Set the frontendPortRangeEnd property: The port range end for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set. + * @return the InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner withFrontendPortRangeEnd(Integer frontendPortRangeEnd) { + this.frontendPortRangeEnd = frontendPortRangeEnd; + return this; + } + + /** + * Get the backendAddressPool property: A reference to backendAddressPool resource. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.backendAddressPool; + } + + /** + * Set the backendAddressPool property: A reference to backendAddressPool resource. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the InboundNatRulePropertiesFormatInner object itself. + */ + public InboundNatRulePropertiesFormatInner withBackendAddressPool(SubResource backendAddressPool) { + this.backendAddressPool = backendAddressPool; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (backendIpConfiguration() != null) { + backendIpConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("frontendIPConfiguration", this.frontendIpConfiguration); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeNumberField("frontendPort", this.frontendPort); + jsonWriter.writeNumberField("backendPort", this.backendPort); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + jsonWriter.writeBooleanField("enableFloatingIP", this.enableFloatingIp); + jsonWriter.writeBooleanField("enableTcpReset", this.enableTcpReset); + jsonWriter.writeNumberField("frontendPortRangeStart", this.frontendPortRangeStart); + jsonWriter.writeNumberField("frontendPortRangeEnd", this.frontendPortRangeEnd); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundNatRulePropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundNatRulePropertiesFormatInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundNatRulePropertiesFormatInner. + */ + public static InboundNatRulePropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundNatRulePropertiesFormatInner deserializedInboundNatRulePropertiesFormatInner + = new InboundNatRulePropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frontendIPConfiguration".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.frontendIpConfiguration + = SubResource.fromJson(reader); + } else if ("backendIPConfiguration".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.backendIpConfiguration + = NetworkInterfaceIpConfigurationInner.fromJson(reader); + } else if ("protocol".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.protocol + = TransportProtocol.fromString(reader.getString()); + } else if ("frontendPort".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.frontendPort + = reader.getNullable(JsonReader::getInt); + } else if ("backendPort".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.backendPort + = reader.getNullable(JsonReader::getInt); + } else if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("enableFloatingIP".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.enableFloatingIp + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableTcpReset".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.enableTcpReset + = reader.getNullable(JsonReader::getBoolean); + } else if ("frontendPortRangeStart".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.frontendPortRangeStart + = reader.getNullable(JsonReader::getInt); + } else if ("frontendPortRangeEnd".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.frontendPortRangeEnd + = reader.getNullable(JsonReader::getInt); + } else if ("backendAddressPool".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.backendAddressPool = SubResource.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedInboundNatRulePropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundNatRulePropertiesFormatInner; + }); + } +} 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..65772793649c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleType; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * NVA Inbound Security Rule resource. + */ +@Fluent +public final class InboundSecurityRuleInner extends SubResource { + /* + * The properties of the Inbound Security Rules. + */ + private InboundSecurityRuleProperties innerProperties; + + /* + * Name of security rule collection. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * NVA inbound security rule type. + */ + private String type; + + /** + * Creates an instance of InboundSecurityRuleInner class. + */ + public InboundSecurityRuleInner() { + } + + /** + * Get the innerProperties property: The properties of the Inbound Security Rules. + * + * @return the innerProperties value. + */ + private InboundSecurityRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public InboundSecurityRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the ruleType property: Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only + * creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. + * + * @return the ruleType value. + */ + public InboundSecurityRuleType ruleType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleType(); + } + + /** + * Set the ruleType property: Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only + * creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. + * + * @param ruleType the ruleType value to set. + * @return the InboundSecurityRuleInner object itself. + */ + public InboundSecurityRuleInner withRuleType(InboundSecurityRuleType ruleType) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundSecurityRuleProperties(); + } + this.innerProperties().withRuleType(ruleType); + return this; + } + + /** + * Get the rules property: List of allowed rules. + * + * @return the rules value. + */ + public List rules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundSecurityRuleProperties(); + } + this.innerProperties().withRules(rules); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundSecurityRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundSecurityRuleInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundSecurityRuleInner. + */ + public static InboundSecurityRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundSecurityRuleInner deserializedInboundSecurityRuleInner = new InboundSecurityRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedInboundSecurityRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedInboundSecurityRuleInner.innerProperties + = InboundSecurityRuleProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedInboundSecurityRuleInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedInboundSecurityRuleInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedInboundSecurityRuleInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundSecurityRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleProperties.java new file mode 100644 index 0000000000000..4438afb0080ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/InboundSecurityRuleProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleType; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the Inbound Security Rules resource. + */ +@Fluent +public final class InboundSecurityRuleProperties implements JsonSerializable { + /* + * Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates NSG rules. Permanent Rule + * creates NSG rule and SLB LB Rule. + */ + private InboundSecurityRuleType ruleType; + + /* + * List of allowed rules. + */ + private List rules; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of InboundSecurityRuleProperties class. + */ + public InboundSecurityRuleProperties() { + } + + /** + * Get the ruleType property: Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only + * creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. + * + * @return the ruleType value. + */ + public InboundSecurityRuleType ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only + * creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. + * + * @param ruleType the ruleType value to set. + * @return the InboundSecurityRuleProperties object itself. + */ + public InboundSecurityRuleProperties withRuleType(InboundSecurityRuleType ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * 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 InboundSecurityRuleProperties object itself. + */ + public InboundSecurityRuleProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundSecurityRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundSecurityRuleProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundSecurityRuleProperties. + */ + public static InboundSecurityRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundSecurityRuleProperties deserializedInboundSecurityRuleProperties + = new InboundSecurityRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleType".equals(fieldName)) { + deserializedInboundSecurityRuleProperties.ruleType + = InboundSecurityRuleType.fromString(reader.getString()); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> InboundSecurityRules.fromJson(reader1)); + deserializedInboundSecurityRuleProperties.rules = rules; + } else if ("provisioningState".equals(fieldName)) { + deserializedInboundSecurityRuleProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundSecurityRuleProperties; + }); + } +} 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..dd3b0c6d61570 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAddressAvailabilityResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Response for CheckIPAddressAvailability API service call. + */ +@Fluent +public final class IpAddressAvailabilityResultInner implements JsonSerializable { + /* + * Private IP address availability. + */ + private Boolean available; + + /* + * Contains other available private IP addresses if the asked for address is taken. + */ + private List availableIpAddresses; + + /* + * Private IP address platform reserved. + */ + private Boolean isPlatformReserved; + + /** + * Creates an instance of IpAddressAvailabilityResultInner class. + */ + public IpAddressAvailabilityResultInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("available", this.available); + jsonWriter.writeArrayField("availableIPAddresses", this.availableIpAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isPlatformReserved", this.isPlatformReserved); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAddressAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAddressAvailabilityResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpAddressAvailabilityResultInner. + */ + public static IpAddressAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAddressAvailabilityResultInner deserializedIpAddressAvailabilityResultInner + = new IpAddressAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("available".equals(fieldName)) { + deserializedIpAddressAvailabilityResultInner.available = reader.getNullable(JsonReader::getBoolean); + } else if ("availableIPAddresses".equals(fieldName)) { + List availableIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedIpAddressAvailabilityResultInner.availableIpAddresses = availableIpAddresses; + } else if ("isPlatformReserved".equals(fieldName)) { + deserializedIpAddressAvailabilityResultInner.isPlatformReserved + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAddressAvailabilityResultInner; + }); + } +} 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..a9cf816c6e2ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationInner.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import java.io.IOException; +import java.util.Map; + +/** + * IpAllocation resource. + */ +@Fluent +public final class IpAllocationInner extends Resource { + /* + * Properties of the IpAllocation. + */ + private IpAllocationPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of IpAllocationInner class. + */ + public IpAllocationInner() { + } + + /** + * Get the innerProperties property: Properties of the IpAllocation. + * + * @return the innerProperties value. + */ + private IpAllocationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 IpAllocationInner object itself. + */ + public IpAllocationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public IpAllocationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IpAllocationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the subnet property: The Subnet that using the prefix of this IpAllocation resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Get the virtualNetwork property: The VirtualNetwork that using the prefix of this IpAllocation resource. + * + * @return the virtualNetwork value. + */ + public SubResource virtualNetwork() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetwork(); + } + + /** + * Get the type property: The type for the IpAllocation. + * + * @return the type value. + */ + public IpAllocationType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type for the IpAllocation. + * + * @param type the type value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withTypePropertiesType(IpAllocationType type) { + if (this.innerProperties() == null) { + this.innerProperties = new IpAllocationPropertiesFormat(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the prefix property: The address prefix for the IpAllocation. + * + * @return the prefix value. + */ + public String prefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpAllocationPropertiesFormat(); + } + this.innerProperties().withPrefix(prefix); + return this; + } + + /** + * Get the prefixLength property: The address prefix length for the IpAllocation. + * + * @return the prefixLength value. + */ + public Integer prefixLength() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpAllocationPropertiesFormat(); + } + this.innerProperties().withPrefixLength(prefixLength); + return this; + } + + /** + * Get the prefixType property: The address prefix Type for the IpAllocation. + * + * @return the prefixType value. + */ + public IpVersion prefixType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpAllocationPropertiesFormat(); + } + this.innerProperties().withPrefixType(prefixType); + return this; + } + + /** + * Get the ipamAllocationId property: The IPAM allocation ID. + * + * @return the ipamAllocationId value. + */ + public String ipamAllocationId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpAllocationPropertiesFormat(); + } + this.innerProperties().withIpamAllocationId(ipamAllocationId); + return this; + } + + /** + * Get the allocationTags property: IpAllocation tags. + * + * @return the allocationTags value. + */ + public Map allocationTags() { + return this.innerProperties() == null ? null : this.innerProperties().allocationTags(); + } + + /** + * Set the allocationTags property: IpAllocation tags. + * + * @param allocationTags the allocationTags value to set. + * @return the IpAllocationInner object itself. + */ + public IpAllocationInner withAllocationTags(Map allocationTags) { + if (this.innerProperties() == null) { + this.innerProperties = new IpAllocationPropertiesFormat(); + } + this.innerProperties().withAllocationTags(allocationTags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAllocationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAllocationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpAllocationInner. + */ + public static IpAllocationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAllocationInner deserializedIpAllocationInner = new IpAllocationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIpAllocationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIpAllocationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIpAllocationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIpAllocationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIpAllocationInner.innerProperties = IpAllocationPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedIpAllocationInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedIpAllocationInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAllocationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationPropertiesFormat.java new file mode 100644 index 0000000000000..3fae50293ee60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpAllocationPropertiesFormat.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import java.io.IOException; +import java.util.Map; + +/** + * Properties of the IpAllocation. + */ +@Fluent +public final class IpAllocationPropertiesFormat implements JsonSerializable { + /* + * The Subnet that using the prefix of this IpAllocation resource. + */ + private SubResource subnet; + + /* + * The VirtualNetwork that using the prefix of this IpAllocation resource. + */ + private SubResource virtualNetwork; + + /* + * The type for the IpAllocation. + */ + private IpAllocationType type; + + /* + * The address prefix for the IpAllocation. + */ + private String prefix; + + /* + * The address prefix length for the IpAllocation. + */ + private Integer prefixLength; + + /* + * The address prefix Type for the IpAllocation. + */ + private IpVersion prefixType; + + /* + * The IPAM allocation ID. + */ + private String ipamAllocationId; + + /* + * IpAllocation tags. + */ + private Map allocationTags; + + /** + * Creates an instance of IpAllocationPropertiesFormat class. + */ + public IpAllocationPropertiesFormat() { + } + + /** + * 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 type property: The type for the IpAllocation. + * + * @return the type value. + */ + public IpAllocationType type() { + return this.type; + } + + /** + * Set the type property: The type for the IpAllocation. + * + * @param type the type value to set. + * @return the IpAllocationPropertiesFormat object itself. + */ + public IpAllocationPropertiesFormat withType(IpAllocationType type) { + this.type = type; + 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 IpAllocationPropertiesFormat object itself. + */ + public IpAllocationPropertiesFormat 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 IpAllocationPropertiesFormat object itself. + */ + public IpAllocationPropertiesFormat 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 IpAllocationPropertiesFormat object itself. + */ + public IpAllocationPropertiesFormat 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 IpAllocationPropertiesFormat object itself. + */ + public IpAllocationPropertiesFormat 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 IpAllocationPropertiesFormat object itself. + */ + public IpAllocationPropertiesFormat withAllocationTags(Map allocationTags) { + this.allocationTags = allocationTags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeNumberField("prefixLength", this.prefixLength); + jsonWriter.writeStringField("prefixType", this.prefixType == null ? null : this.prefixType.toString()); + jsonWriter.writeStringField("ipamAllocationId", this.ipamAllocationId); + jsonWriter.writeMapField("allocationTags", this.allocationTags, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAllocationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAllocationPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpAllocationPropertiesFormat. + */ + public static IpAllocationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAllocationPropertiesFormat deserializedIpAllocationPropertiesFormat = new IpAllocationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnet".equals(fieldName)) { + deserializedIpAllocationPropertiesFormat.subnet = SubResource.fromJson(reader); + } else if ("virtualNetwork".equals(fieldName)) { + deserializedIpAllocationPropertiesFormat.virtualNetwork = SubResource.fromJson(reader); + } else if ("type".equals(fieldName)) { + deserializedIpAllocationPropertiesFormat.type = IpAllocationType.fromString(reader.getString()); + } else if ("prefix".equals(fieldName)) { + deserializedIpAllocationPropertiesFormat.prefix = reader.getString(); + } else if ("prefixLength".equals(fieldName)) { + deserializedIpAllocationPropertiesFormat.prefixLength = reader.getNullable(JsonReader::getInt); + } else if ("prefixType".equals(fieldName)) { + deserializedIpAllocationPropertiesFormat.prefixType = IpVersion.fromString(reader.getString()); + } else if ("ipamAllocationId".equals(fieldName)) { + deserializedIpAllocationPropertiesFormat.ipamAllocationId = reader.getString(); + } else if ("allocationTags".equals(fieldName)) { + Map allocationTags = reader.readMap(reader1 -> reader1.getString()); + deserializedIpAllocationPropertiesFormat.allocationTags = allocationTags; + } else { + reader.skipChildren(); + } + } + + return deserializedIpAllocationPropertiesFormat; + }); + } +} 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..5ca3f5b981c86 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationInner.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * IP configuration. + */ +@Fluent +public final class IpConfigurationInner extends SubResource { + /* + * Properties of the IP configuration. + */ + private IpConfigurationPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of IpConfigurationInner class. + */ + public IpConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of the IP configuration. + * + * @return the innerProperties value. + */ + private IpConfigurationPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public IpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the IP configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfigurationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfigurationInner. + */ + public static IpConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfigurationInner deserializedIpConfigurationInner = new IpConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIpConfigurationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedIpConfigurationInner.innerProperties + = IpConfigurationPropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedIpConfigurationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedIpConfigurationInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfigurationInner; + }); + } +} 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..46dc94c69dc09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfileInner.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * IP configuration profile child resource. + */ +@Fluent +public final class IpConfigurationProfileInner extends SubResource { + /* + * Properties of the IP configuration profile. + */ + private IpConfigurationProfilePropertiesFormatInner innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + private String name; + + /* + * Sub Resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of IpConfigurationProfileInner class. + */ + public IpConfigurationProfileInner() { + } + + /** + * Get the innerProperties property: Properties of the IP configuration profile. + * + * @return the innerProperties value. + */ + private IpConfigurationProfilePropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public IpConfigurationProfileInner withId(String id) { + super.withId(id); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpConfigurationProfilePropertiesFormatInner(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfigurationProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfigurationProfileInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfigurationProfileInner. + */ + public static IpConfigurationProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfigurationProfileInner deserializedIpConfigurationProfileInner = new IpConfigurationProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIpConfigurationProfileInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedIpConfigurationProfileInner.innerProperties + = IpConfigurationProfilePropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedIpConfigurationProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIpConfigurationProfileInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedIpConfigurationProfileInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfigurationProfileInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfilePropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfilePropertiesFormatInner.java new file mode 100644 index 0000000000000..4cb89830cd5f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationProfilePropertiesFormatInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * IP configuration profile properties. + */ +@Fluent +public final class IpConfigurationProfilePropertiesFormatInner + implements JsonSerializable { + /* + * The reference to the subnet resource to create a container network interface ip configuration. + */ + private SubnetInner subnet; + + /* + * The provisioning state of the IP configuration profile resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IpConfigurationProfilePropertiesFormatInner class. + */ + public IpConfigurationProfilePropertiesFormatInner() { + } + + /** + * 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 IpConfigurationProfilePropertiesFormatInner object itself. + */ + public IpConfigurationProfilePropertiesFormatInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subnet", this.subnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfigurationProfilePropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfigurationProfilePropertiesFormatInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfigurationProfilePropertiesFormatInner. + */ + public static IpConfigurationProfilePropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfigurationProfilePropertiesFormatInner deserializedIpConfigurationProfilePropertiesFormatInner + = new IpConfigurationProfilePropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnet".equals(fieldName)) { + deserializedIpConfigurationProfilePropertiesFormatInner.subnet = SubnetInner.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedIpConfigurationProfilePropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfigurationProfilePropertiesFormatInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationPropertiesFormatInner.java new file mode 100644 index 0000000000000..e491239476f3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpConfigurationPropertiesFormatInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of IP configuration. + */ +@Fluent +public final class IpConfigurationPropertiesFormatInner + implements JsonSerializable { + /* + * The private IP address of the IP configuration. + */ + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + private SubnetInner subnet; + + /* + * The reference to the public IP resource. + */ + private PublicIpAddressInner publicIpAddress; + + /* + * The provisioning state of the IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of IpConfigurationPropertiesFormatInner class. + */ + public IpConfigurationPropertiesFormatInner() { + } + + /** + * 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 IpConfigurationPropertiesFormatInner object itself. + */ + public IpConfigurationPropertiesFormatInner 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 IpConfigurationPropertiesFormatInner object itself. + */ + public IpConfigurationPropertiesFormatInner + 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 IpConfigurationPropertiesFormatInner object itself. + */ + public IpConfigurationPropertiesFormatInner 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 IpConfigurationPropertiesFormatInner object itself. + */ + public IpConfigurationPropertiesFormatInner 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfigurationPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfigurationPropertiesFormatInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfigurationPropertiesFormatInner. + */ + public static IpConfigurationPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfigurationPropertiesFormatInner deserializedIpConfigurationPropertiesFormatInner + = new IpConfigurationPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAddress".equals(fieldName)) { + deserializedIpConfigurationPropertiesFormatInner.privateIpAddress = reader.getString(); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedIpConfigurationPropertiesFormatInner.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedIpConfigurationPropertiesFormatInner.subnet = SubnetInner.fromJson(reader); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedIpConfigurationPropertiesFormatInner.publicIpAddress + = PublicIpAddressInner.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedIpConfigurationPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfigurationPropertiesFormatInner; + }); + } +} 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..35b503e757600 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The IpGroups resource information. + */ +@Fluent +public final class IpGroupInner extends Resource { + /* + * Properties of the IpGroups. + */ + private IpGroupPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of IpGroupInner class. + */ + public IpGroupInner() { + } + + /** + * Get the innerProperties property: Properties of the IpGroups. + * + * @return the innerProperties value. + */ + private IpGroupPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 IpGroupInner object itself. + */ + public IpGroupInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public IpGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public IpGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the IpGroups resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ipAddresses property: IpAddresses/IpAddressPrefixes in the IpGroups resource. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new IpGroupPropertiesFormat(); + } + this.innerProperties().withIpAddresses(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().firewallPolicies(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpGroupInner. + */ + public static IpGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpGroupInner deserializedIpGroupInner = new IpGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIpGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIpGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedIpGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedIpGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedIpGroupInner.innerProperties = IpGroupPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedIpGroupInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedIpGroupInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpGroupInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupPropertiesFormat.java new file mode 100644 index 0000000000000..eeddcb933b158 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpGroupPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * The IpGroups property information. + */ +@Fluent +public final class IpGroupPropertiesFormat implements JsonSerializable { + /* + * The provisioning state of the IpGroups resource. + */ + private ProvisioningState provisioningState; + + /* + * IpAddresses/IpAddressPrefixes in the IpGroups resource. + */ + private List ipAddresses; + + /* + * List of references to Firewall resources that this IpGroups is associated with. + */ + private List firewalls; + + /* + * List of references to Firewall Policies resources that this IpGroups is associated with. + */ + private List firewallPolicies; + + /** + * Creates an instance of IpGroupPropertiesFormat class. + */ + public IpGroupPropertiesFormat() { + } + + /** + * 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 IpGroupPropertiesFormat object itself. + */ + public IpGroupPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipAddresses", this.ipAddresses, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpGroupPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpGroupPropertiesFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpGroupPropertiesFormat. + */ + public static IpGroupPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpGroupPropertiesFormat deserializedIpGroupPropertiesFormat = new IpGroupPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedIpGroupPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedIpGroupPropertiesFormat.ipAddresses = ipAddresses; + } else if ("firewalls".equals(fieldName)) { + List firewalls = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedIpGroupPropertiesFormat.firewalls = firewalls; + } else if ("firewallPolicies".equals(fieldName)) { + List firewallPolicies = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedIpGroupPropertiesFormat.firewallPolicies = firewallPolicies; + } else { + reader.skipChildren(); + } + } + + return deserializedIpGroupPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpPrefixesListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpPrefixesListInner.java new file mode 100644 index 0000000000000..a95a944642dac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/IpPrefixesListInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of SNAT IP Prefixes learnt by firewall to not SNAT. + */ +@Fluent +public final class IpPrefixesListInner implements JsonSerializable { + /* + * IP Prefix value. + */ + private List ipPrefixes; + + /** + * Creates an instance of IpPrefixesListInner class. + */ + public IpPrefixesListInner() { + } + + /** + * Get the ipPrefixes property: IP Prefix value. + * + * @return the ipPrefixes value. + */ + public List ipPrefixes() { + return this.ipPrefixes; + } + + /** + * Set the ipPrefixes property: IP Prefix value. + * + * @param ipPrefixes the ipPrefixes value to set. + * @return the IpPrefixesListInner object itself. + */ + public IpPrefixesListInner withIpPrefixes(List ipPrefixes) { + this.ipPrefixes = ipPrefixes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipPrefixes", this.ipPrefixes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpPrefixesListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpPrefixesListInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpPrefixesListInner. + */ + public static IpPrefixesListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpPrefixesListInner deserializedIpPrefixesListInner = new IpPrefixesListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipPrefixes".equals(fieldName)) { + List ipPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedIpPrefixesListInner.ipPrefixes = ipPrefixes; + } else { + reader.skipChildren(); + } + } + + return deserializedIpPrefixesListInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerBackendAddressPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerBackendAddressPropertiesFormat.java new file mode 100644 index 0000000000000..b027b59f9bb38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerBackendAddressPropertiesFormat.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddressAdminState; +import com.azure.resourcemanager.network.generated.models.NatRulePortMapping; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the load balancer backend addresses. + */ +@Fluent +public final class LoadBalancerBackendAddressPropertiesFormat + implements JsonSerializable { + /* + * Reference to an existing virtual network. + */ + private SubResource virtualNetwork; + + /* + * Reference to an existing subnet. + */ + private SubResource subnet; + + /* + * IP Address belonging to the referenced virtual network. + */ + private String ipAddress; + + /* + * Reference to IP address defined in network interfaces. + */ + private SubResource networkInterfaceIpConfiguration; + + /* + * Reference to the frontend ip address configuration defined in regional loadbalancer. + */ + private SubResource loadBalancerFrontendIpConfiguration; + + /* + * Collection of inbound NAT rule port mappings. + */ + private List inboundNatRulesPortMapping; + + /* + * A list of administrative states which once set can override health probe so that Load Balancer will always + * forward new connections to backend, or deny new connections and reset existing connections. + */ + private LoadBalancerBackendAddressAdminState adminState; + + /** + * Creates an instance of LoadBalancerBackendAddressPropertiesFormat class. + */ + public LoadBalancerBackendAddressPropertiesFormat() { + } + + /** + * 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 LoadBalancerBackendAddressPropertiesFormat object itself. + */ + public LoadBalancerBackendAddressPropertiesFormat 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 LoadBalancerBackendAddressPropertiesFormat object itself. + */ + public LoadBalancerBackendAddressPropertiesFormat 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 LoadBalancerBackendAddressPropertiesFormat object itself. + */ + public LoadBalancerBackendAddressPropertiesFormat 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 LoadBalancerBackendAddressPropertiesFormat object itself. + */ + public LoadBalancerBackendAddressPropertiesFormat + withLoadBalancerFrontendIpConfiguration(SubResource loadBalancerFrontendIpConfiguration) { + this.loadBalancerFrontendIpConfiguration = loadBalancerFrontendIpConfiguration; + return this; + } + + /** + * Get the inboundNatRulesPortMapping property: Collection of inbound NAT rule port mappings. + * + * @return the inboundNatRulesPortMapping value. + */ + public List inboundNatRulesPortMapping() { + return this.inboundNatRulesPortMapping; + } + + /** + * Get the adminState property: A list of administrative states which once set can override health probe so that + * Load Balancer will always forward new connections to backend, or deny new connections and reset existing + * connections. + * + * @return the adminState value. + */ + public LoadBalancerBackendAddressAdminState adminState() { + return this.adminState; + } + + /** + * Set the adminState property: A list of administrative states which once set can override health probe so that + * Load Balancer will always forward new connections to backend, or deny new connections and reset existing + * connections. + * + * @param adminState the adminState value to set. + * @return the LoadBalancerBackendAddressPropertiesFormat object itself. + */ + public LoadBalancerBackendAddressPropertiesFormat withAdminState(LoadBalancerBackendAddressAdminState adminState) { + this.adminState = adminState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inboundNatRulesPortMapping() != null) { + inboundNatRulesPortMapping().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualNetwork", this.virtualNetwork); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeJsonField("loadBalancerFrontendIPConfiguration", this.loadBalancerFrontendIpConfiguration); + jsonWriter.writeStringField("adminState", this.adminState == null ? null : this.adminState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerBackendAddressPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerBackendAddressPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerBackendAddressPropertiesFormat. + */ + public static LoadBalancerBackendAddressPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerBackendAddressPropertiesFormat deserializedLoadBalancerBackendAddressPropertiesFormat + = new LoadBalancerBackendAddressPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualNetwork".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPropertiesFormat.virtualNetwork + = SubResource.fromJson(reader); + } else if ("subnet".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPropertiesFormat.subnet = SubResource.fromJson(reader); + } else if ("ipAddress".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPropertiesFormat.ipAddress = reader.getString(); + } else if ("networkInterfaceIPConfiguration".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPropertiesFormat.networkInterfaceIpConfiguration + = SubResource.fromJson(reader); + } else if ("loadBalancerFrontendIPConfiguration".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPropertiesFormat.loadBalancerFrontendIpConfiguration + = SubResource.fromJson(reader); + } else if ("inboundNatRulesPortMapping".equals(fieldName)) { + List inboundNatRulesPortMapping + = reader.readArray(reader1 -> NatRulePortMapping.fromJson(reader1)); + deserializedLoadBalancerBackendAddressPropertiesFormat.inboundNatRulesPortMapping + = inboundNatRulesPortMapping; + } else if ("adminState".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPropertiesFormat.adminState + = LoadBalancerBackendAddressAdminState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerBackendAddressPropertiesFormat; + }); + } +} 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..0d95d284a1a98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerInner.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * LoadBalancer resource. + */ +@Fluent +public final class LoadBalancerInner extends Resource { + /* + * The extended location of the load balancer. + */ + private ExtendedLocation extendedLocation; + + /* + * The load balancer SKU. + */ + private LoadBalancerSku sku; + + /* + * Properties of load balancer. + */ + private LoadBalancerPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of LoadBalancerInner class. + */ + public LoadBalancerInner() { + } + + /** + * 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 innerProperties property: Properties of load balancer. + * + * @return the innerProperties value. + */ + private LoadBalancerPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 LoadBalancerInner object itself. + */ + public LoadBalancerInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public LoadBalancerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LoadBalancerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerPropertiesFormat(); + } + this.innerProperties().withFrontendIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerPropertiesFormat(); + } + this.innerProperties().withBackendAddressPools(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerPropertiesFormat(); + } + this.innerProperties().withLoadBalancingRules(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerPropertiesFormat(); + } + this.innerProperties().withProbes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerPropertiesFormat(); + } + this.innerProperties().withInboundNatRules(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerPropertiesFormat(); + } + this.innerProperties().withInboundNatPools(inboundNatPools); + return this; + } + + /** + * Get the outboundRules property: The outbound rules. + * + * @return the outboundRules value. + */ + public List outboundRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerPropertiesFormat(); + } + this.innerProperties().withOutboundRules(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the load balancer resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoadBalancerInner. + */ + public static LoadBalancerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerInner deserializedLoadBalancerInner = new LoadBalancerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLoadBalancerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLoadBalancerInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLoadBalancerInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLoadBalancerInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedLoadBalancerInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedLoadBalancerInner.sku = LoadBalancerSku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedLoadBalancerInner.innerProperties = LoadBalancerPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedLoadBalancerInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedLoadBalancerInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerPropertiesFormat.java new file mode 100644 index 0000000000000..cc94fd043ce10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerPropertiesFormat.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the load balancer. + */ +@Fluent +public final class LoadBalancerPropertiesFormat implements JsonSerializable { + /* + * Object representing the frontend IPs to be used for the load balancer. + */ + private List frontendIpConfigurations; + + /* + * Collection of backend address pools used by a load balancer. + */ + private List backendAddressPools; + + /* + * Object collection representing the load balancing rules Gets the provisioning. + */ + private List loadBalancingRules; + + /* + * Collection of probe objects used in the load balancer. + */ + 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. + */ + 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. + */ + private List inboundNatPools; + + /* + * The outbound rules. + */ + private List outboundRules; + + /* + * The resource GUID property of the load balancer resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the load balancer resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LoadBalancerPropertiesFormat class. + */ + public LoadBalancerPropertiesFormat() { + } + + /** + * 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 LoadBalancerPropertiesFormat object itself. + */ + public LoadBalancerPropertiesFormat + 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 LoadBalancerPropertiesFormat object itself. + */ + public LoadBalancerPropertiesFormat 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 LoadBalancerPropertiesFormat object itself. + */ + public LoadBalancerPropertiesFormat 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 LoadBalancerPropertiesFormat object itself. + */ + public LoadBalancerPropertiesFormat 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 LoadBalancerPropertiesFormat object itself. + */ + public LoadBalancerPropertiesFormat 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 LoadBalancerPropertiesFormat object itself. + */ + public LoadBalancerPropertiesFormat 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 LoadBalancerPropertiesFormat object itself. + */ + public LoadBalancerPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("frontendIPConfigurations", this.frontendIpConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("backendAddressPools", this.backendAddressPools, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("loadBalancingRules", this.loadBalancingRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("probes", this.probes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("inboundNatRules", this.inboundNatRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("inboundNatPools", this.inboundNatPools, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("outboundRules", this.outboundRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerPropertiesFormat. + */ + public static LoadBalancerPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerPropertiesFormat deserializedLoadBalancerPropertiesFormat = new LoadBalancerPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frontendIPConfigurations".equals(fieldName)) { + List frontendIpConfigurations + = reader.readArray(reader1 -> FrontendIpConfigurationInner.fromJson(reader1)); + deserializedLoadBalancerPropertiesFormat.frontendIpConfigurations = frontendIpConfigurations; + } else if ("backendAddressPools".equals(fieldName)) { + List backendAddressPools + = reader.readArray(reader1 -> BackendAddressPoolInner.fromJson(reader1)); + deserializedLoadBalancerPropertiesFormat.backendAddressPools = backendAddressPools; + } else if ("loadBalancingRules".equals(fieldName)) { + List loadBalancingRules + = reader.readArray(reader1 -> LoadBalancingRuleInner.fromJson(reader1)); + deserializedLoadBalancerPropertiesFormat.loadBalancingRules = loadBalancingRules; + } else if ("probes".equals(fieldName)) { + List probes = reader.readArray(reader1 -> ProbeInner.fromJson(reader1)); + deserializedLoadBalancerPropertiesFormat.probes = probes; + } else if ("inboundNatRules".equals(fieldName)) { + List inboundNatRules + = reader.readArray(reader1 -> InboundNatRuleInner.fromJson(reader1)); + deserializedLoadBalancerPropertiesFormat.inboundNatRules = inboundNatRules; + } else if ("inboundNatPools".equals(fieldName)) { + List inboundNatPools + = reader.readArray(reader1 -> InboundNatPool.fromJson(reader1)); + deserializedLoadBalancerPropertiesFormat.inboundNatPools = inboundNatPools; + } else if ("outboundRules".equals(fieldName)) { + List outboundRules + = reader.readArray(reader1 -> OutboundRuleInner.fromJson(reader1)); + deserializedLoadBalancerPropertiesFormat.outboundRules = outboundRules; + } else if ("resourceGuid".equals(fieldName)) { + deserializedLoadBalancerPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedLoadBalancerPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.java new file mode 100644 index 0000000000000..01d5d4b6b629d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of VIP swap request's frontend IP configuration object. + */ +@Fluent +public final class LoadBalancerVipSwapRequestFrontendIpConfigurationProperties + implements JsonSerializable { + /* + * A reference to public IP address resource. + */ + private SubResource publicIpAddress; + + /** + * Creates an instance of LoadBalancerVipSwapRequestFrontendIpConfigurationProperties class. + */ + public LoadBalancerVipSwapRequestFrontendIpConfigurationProperties() { + } + + /** + * 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 LoadBalancerVipSwapRequestFrontendIpConfigurationProperties object itself. + */ + public LoadBalancerVipSwapRequestFrontendIpConfigurationProperties + withPublicIpAddress(SubResource publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerVipSwapRequestFrontendIpConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerVipSwapRequestFrontendIpConfigurationProperties if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * LoadBalancerVipSwapRequestFrontendIpConfigurationProperties. + */ + public static LoadBalancerVipSwapRequestFrontendIpConfigurationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerVipSwapRequestFrontendIpConfigurationProperties deserializedLoadBalancerVipSwapRequestFrontendIpConfigurationProperties + = new LoadBalancerVipSwapRequestFrontendIpConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPAddress".equals(fieldName)) { + deserializedLoadBalancerVipSwapRequestFrontendIpConfigurationProperties.publicIpAddress + = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerVipSwapRequestFrontendIpConfigurationProperties; + }); + } +} 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..8a24b02f41b62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRuleInner.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.io.IOException; +import java.util.List; + +/** + * A load balancing rule for a load balancer. + */ +@Fluent +public final class LoadBalancingRuleInner extends SubResource { + /* + * Properties of load balancer load balancing rule. + */ + private LoadBalancingRulePropertiesFormat innerProperties; + + /* + * 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. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of LoadBalancingRuleInner class. + */ + public LoadBalancingRuleInner() { + } + + /** + * Get the innerProperties property: Properties of load balancer load balancing rule. + * + * @return the innerProperties value. + */ + private LoadBalancingRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public LoadBalancingRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withFrontendIpConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withBackendAddressPool(backendAddressPool); + return this; + } + + /** + * Get the backendAddressPools property: An array of references to pool of DIPs. + * + * @return the backendAddressPools value. + */ + public List backendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withBackendAddressPools(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withProbe(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the loadDistribution property: The load distribution policy for this rule. + * + * @return the loadDistribution value. + */ + public LoadDistribution loadDistribution() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withLoadDistribution(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withFrontendPort(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withBackendPort(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withIdleTimeoutInMinutes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withEnableFloatingIp(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withEnableTcpReset(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancingRulePropertiesFormat(); + } + this.innerProperties().withDisableOutboundSnat(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancingRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancingRuleInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancingRuleInner. + */ + public static LoadBalancingRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancingRuleInner deserializedLoadBalancingRuleInner = new LoadBalancingRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLoadBalancingRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedLoadBalancingRuleInner.innerProperties + = LoadBalancingRulePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedLoadBalancingRuleInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedLoadBalancingRuleInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLoadBalancingRuleInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancingRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRulePropertiesFormat.java new file mode 100644 index 0000000000000..3db0f5e112947 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LoadBalancingRulePropertiesFormat.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.io.IOException; +import java.util.List; + +/** + * Properties of the load balancer. + */ +@Fluent +public final class LoadBalancingRulePropertiesFormat implements JsonSerializable { + /* + * A reference to frontend IP addresses. + */ + private SubResource frontendIpConfiguration; + + /* + * A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + */ + private SubResource backendAddressPool; + + /* + * An array of references to pool of DIPs. + */ + private List backendAddressPools; + + /* + * The reference to the load balancer probe used by the load balancing rule. + */ + private SubResource probe; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + private TransportProtocol protocol; + + /* + * The load distribution policy for this rule. + */ + 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". + */ + private int frontendPort; + + /* + * The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that + * value 0 enables "Any Port". + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + private Boolean disableOutboundSnat; + + /* + * The provisioning state of the load balancing rule resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LoadBalancingRulePropertiesFormat class. + */ + public LoadBalancingRulePropertiesFormat() { + } + + /** + * 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 int 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat withFrontendPort(int 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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 LoadBalancingRulePropertiesFormat object itself. + */ + public LoadBalancingRulePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocol in model LoadBalancingRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadBalancingRulePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeIntField("frontendPort", this.frontendPort); + jsonWriter.writeJsonField("frontendIPConfiguration", this.frontendIpConfiguration); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeArrayField("backendAddressPools", this.backendAddressPools, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("probe", this.probe); + jsonWriter.writeStringField("loadDistribution", + this.loadDistribution == null ? null : this.loadDistribution.toString()); + jsonWriter.writeNumberField("backendPort", this.backendPort); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + jsonWriter.writeBooleanField("enableFloatingIP", this.enableFloatingIp); + jsonWriter.writeBooleanField("enableTcpReset", this.enableTcpReset); + jsonWriter.writeBooleanField("disableOutboundSnat", this.disableOutboundSnat); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancingRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancingRulePropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LoadBalancingRulePropertiesFormat. + */ + public static LoadBalancingRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancingRulePropertiesFormat deserializedLoadBalancingRulePropertiesFormat + = new LoadBalancingRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.protocol + = TransportProtocol.fromString(reader.getString()); + } else if ("frontendPort".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.frontendPort = reader.getInt(); + } else if ("frontendIPConfiguration".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.frontendIpConfiguration + = SubResource.fromJson(reader); + } else if ("backendAddressPool".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.backendAddressPool = SubResource.fromJson(reader); + } else if ("backendAddressPools".equals(fieldName)) { + List backendAddressPools = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedLoadBalancingRulePropertiesFormat.backendAddressPools = backendAddressPools; + } else if ("probe".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.probe = SubResource.fromJson(reader); + } else if ("loadDistribution".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.loadDistribution + = LoadDistribution.fromString(reader.getString()); + } else if ("backendPort".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.backendPort = reader.getNullable(JsonReader::getInt); + } else if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("enableFloatingIP".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.enableFloatingIp + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableTcpReset".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.enableTcpReset + = reader.getNullable(JsonReader::getBoolean); + } else if ("disableOutboundSnat".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.disableOutboundSnat + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedLoadBalancingRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancingRulePropertiesFormat; + }); + } +} 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..fba96f5e5b8cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.Map; + +/** + * A common class for general resource information. + */ +@Fluent +public final class LocalNetworkGatewayInner extends Resource { + /* + * Properties of the local network gateway. + */ + private LocalNetworkGatewayPropertiesFormat innerProperties = new LocalNetworkGatewayPropertiesFormat(); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of LocalNetworkGatewayInner class. + */ + public LocalNetworkGatewayInner() { + } + + /** + * Get the innerProperties property: Properties of the local network gateway. + * + * @return the innerProperties value. + */ + private LocalNetworkGatewayPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 LocalNetworkGatewayInner object itself. + */ + public LocalNetworkGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public LocalNetworkGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LocalNetworkGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the localNetworkAddressSpace property: Local network site address space. + * + * @return the localNetworkAddressSpace value. + */ + public AddressSpace localNetworkAddressSpace() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withLocalNetworkAddressSpace(localNetworkAddressSpace); + return this; + } + + /** + * Get the gatewayIpAddress property: IP address of local network gateway. + * + * @return the gatewayIpAddress value. + */ + public String gatewayIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withGatewayIpAddress(gatewayIpAddress); + return this; + } + + /** + * Get the fqdn property: FQDN of local network gateway. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withFqdn(fqdn); + return this; + } + + /** + * Get the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + public BgpSettings bgpSettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LocalNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withBgpSettings(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the local network gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model LocalNetworkGatewayInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LocalNetworkGatewayInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalNetworkGatewayInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalNetworkGatewayInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LocalNetworkGatewayInner. + */ + public static LocalNetworkGatewayInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalNetworkGatewayInner deserializedLocalNetworkGatewayInner = new LocalNetworkGatewayInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLocalNetworkGatewayInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLocalNetworkGatewayInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLocalNetworkGatewayInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLocalNetworkGatewayInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLocalNetworkGatewayInner.innerProperties + = LocalNetworkGatewayPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedLocalNetworkGatewayInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedLocalNetworkGatewayInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalNetworkGatewayInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayPropertiesFormat.java new file mode 100644 index 0000000000000..be2fa6588383b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/LocalNetworkGatewayPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * LocalNetworkGateway properties. + */ +@Fluent +public final class LocalNetworkGatewayPropertiesFormat + implements JsonSerializable { + /* + * Local network site address space. + */ + private AddressSpace localNetworkAddressSpace; + + /* + * IP address of local network gateway. + */ + private String gatewayIpAddress; + + /* + * FQDN of local network gateway. + */ + private String fqdn; + + /* + * Local network gateway's BGP speaker settings. + */ + private BgpSettings bgpSettings; + + /* + * The resource GUID property of the local network gateway resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the local network gateway resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of LocalNetworkGatewayPropertiesFormat class. + */ + public LocalNetworkGatewayPropertiesFormat() { + } + + /** + * 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 LocalNetworkGatewayPropertiesFormat object itself. + */ + public LocalNetworkGatewayPropertiesFormat 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 LocalNetworkGatewayPropertiesFormat object itself. + */ + public LocalNetworkGatewayPropertiesFormat 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 LocalNetworkGatewayPropertiesFormat object itself. + */ + public LocalNetworkGatewayPropertiesFormat 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 LocalNetworkGatewayPropertiesFormat object itself. + */ + public LocalNetworkGatewayPropertiesFormat 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("localNetworkAddressSpace", this.localNetworkAddressSpace); + jsonWriter.writeStringField("gatewayIpAddress", this.gatewayIpAddress); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeJsonField("bgpSettings", this.bgpSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalNetworkGatewayPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalNetworkGatewayPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LocalNetworkGatewayPropertiesFormat. + */ + public static LocalNetworkGatewayPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalNetworkGatewayPropertiesFormat deserializedLocalNetworkGatewayPropertiesFormat + = new LocalNetworkGatewayPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("localNetworkAddressSpace".equals(fieldName)) { + deserializedLocalNetworkGatewayPropertiesFormat.localNetworkAddressSpace + = AddressSpace.fromJson(reader); + } else if ("gatewayIpAddress".equals(fieldName)) { + deserializedLocalNetworkGatewayPropertiesFormat.gatewayIpAddress = reader.getString(); + } else if ("fqdn".equals(fieldName)) { + deserializedLocalNetworkGatewayPropertiesFormat.fqdn = reader.getString(); + } else if ("bgpSettings".equals(fieldName)) { + deserializedLocalNetworkGatewayPropertiesFormat.bgpSettings = BgpSettings.fromJson(reader); + } else if ("resourceGuid".equals(fieldName)) { + deserializedLocalNetworkGatewayPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedLocalNetworkGatewayPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalNetworkGatewayPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/MigratedPoolsInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/MigratedPoolsInner.java new file mode 100644 index 0000000000000..991293b6330d7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/MigratedPoolsInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response for a migrateToIpBased API. + */ +@Fluent +public final class MigratedPoolsInner implements JsonSerializable { + /* + * A list of pools migrated from Nic based to IP based pool + */ + private List migratedPools; + + /** + * Creates an instance of MigratedPoolsInner class. + */ + public MigratedPoolsInner() { + } + + /** + * Get the migratedPools property: A list of pools migrated from Nic based to IP based pool. + * + * @return the migratedPools value. + */ + public List migratedPools() { + return this.migratedPools; + } + + /** + * Set the migratedPools property: A list of pools migrated from Nic based to IP based pool. + * + * @param migratedPools the migratedPools value to set. + * @return the MigratedPoolsInner object itself. + */ + public MigratedPoolsInner withMigratedPools(List migratedPools) { + this.migratedPools = migratedPools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("migratedPools", this.migratedPools, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigratedPoolsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigratedPoolsInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MigratedPoolsInner. + */ + public static MigratedPoolsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigratedPoolsInner deserializedMigratedPoolsInner = new MigratedPoolsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("migratedPools".equals(fieldName)) { + List migratedPools = reader.readArray(reader1 -> reader1.getString()); + deserializedMigratedPoolsInner.migratedPools = migratedPools; + } else { + reader.skipChildren(); + } + } + + return deserializedMigratedPoolsInner; + }); + } +} 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..79bb4b5211f21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayInner.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Nat Gateway resource. + */ +@Fluent +public final class NatGatewayInner extends Resource { + /* + * The nat gateway SKU. + */ + private NatGatewaySku sku; + + /* + * Nat Gateway properties. + */ + private NatGatewayPropertiesFormat innerProperties; + + /* + * A list of availability zones denoting the zone in which Nat Gateway should be deployed. + */ + private List zones; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NatGatewayInner class. + */ + public NatGatewayInner() { + } + + /** + * 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 innerProperties property: Nat Gateway properties. + * + * @return the innerProperties value. + */ + private NatGatewayPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NatGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NatGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the nat gateway. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NatGatewayPropertiesFormat(); + } + this.innerProperties().withIdleTimeoutInMinutes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NatGatewayPropertiesFormat(); + } + this.innerProperties().withPublicIpAddresses(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NatGatewayPropertiesFormat(); + } + this.innerProperties().withPublicIpPrefixes(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.innerProperties() == null ? null : this.innerProperties().subnets(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the NAT gateway resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the NAT gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NatGatewayInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NatGatewayInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NatGatewayInner. + */ + public static NatGatewayInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NatGatewayInner deserializedNatGatewayInner = new NatGatewayInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNatGatewayInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNatGatewayInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNatGatewayInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNatGatewayInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedNatGatewayInner.sku = NatGatewaySku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedNatGatewayInner.innerProperties = NatGatewayPropertiesFormat.fromJson(reader); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedNatGatewayInner.zones = zones; + } else if ("etag".equals(fieldName)) { + deserializedNatGatewayInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedNatGatewayInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNatGatewayInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayPropertiesFormat.java new file mode 100644 index 0000000000000..a6938d8e3b2f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NatGatewayPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Nat Gateway properties. + */ +@Fluent +public final class NatGatewayPropertiesFormat implements JsonSerializable { + /* + * The idle timeout of the nat gateway. + */ + private Integer idleTimeoutInMinutes; + + /* + * An array of public ip addresses associated with the nat gateway resource. + */ + private List publicIpAddresses; + + /* + * An array of public ip prefixes associated with the nat gateway resource. + */ + private List publicIpPrefixes; + + /* + * An array of references to the subnets using this nat gateway resource. + */ + private List subnets; + + /* + * The resource GUID property of the NAT gateway resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the NAT gateway resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NatGatewayPropertiesFormat class. + */ + public NatGatewayPropertiesFormat() { + } + + /** + * 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 NatGatewayPropertiesFormat object itself. + */ + public NatGatewayPropertiesFormat 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 NatGatewayPropertiesFormat object itself. + */ + public NatGatewayPropertiesFormat 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 NatGatewayPropertiesFormat object itself. + */ + public NatGatewayPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + jsonWriter.writeArrayField("publicIpAddresses", this.publicIpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("publicIpPrefixes", this.publicIpPrefixes, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NatGatewayPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NatGatewayPropertiesFormat if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NatGatewayPropertiesFormat. + */ + public static NatGatewayPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NatGatewayPropertiesFormat deserializedNatGatewayPropertiesFormat = new NatGatewayPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedNatGatewayPropertiesFormat.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("publicIpAddresses".equals(fieldName)) { + List publicIpAddresses = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedNatGatewayPropertiesFormat.publicIpAddresses = publicIpAddresses; + } else if ("publicIpPrefixes".equals(fieldName)) { + List publicIpPrefixes = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedNatGatewayPropertiesFormat.publicIpPrefixes = publicIpPrefixes; + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedNatGatewayPropertiesFormat.subnets = subnets; + } else if ("resourceGuid".equals(fieldName)) { + deserializedNatGatewayPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNatGatewayPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNatGatewayPropertiesFormat; + }); + } +} 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..0fb805667ca73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkConfigurationDiagnosticResponseInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticResult; +import java.io.IOException; +import java.util.List; + +/** + * Results of network configuration diagnostic on the target resource. + */ +@Immutable +public final class NetworkConfigurationDiagnosticResponseInner + implements JsonSerializable { + /* + * List of network configuration diagnostic results. + */ + private List results; + + /** + * Creates an instance of NetworkConfigurationDiagnosticResponseInner class. + */ + public NetworkConfigurationDiagnosticResponseInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkConfigurationDiagnosticResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkConfigurationDiagnosticResponseInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkConfigurationDiagnosticResponseInner. + */ + public static NetworkConfigurationDiagnosticResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkConfigurationDiagnosticResponseInner deserializedNetworkConfigurationDiagnosticResponseInner + = new NetworkConfigurationDiagnosticResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("results".equals(fieldName)) { + List results + = reader.readArray(reader1 -> NetworkConfigurationDiagnosticResult.fromJson(reader1)); + deserializedNetworkConfigurationDiagnosticResponseInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkConfigurationDiagnosticResponseInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupInner.java new file mode 100644 index 0000000000000..2c2553db498fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.GroupMemberType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * The network group resource. + */ +@Fluent +public final class NetworkGroupInner extends ChildResource { + /* + * The Network Group properties + */ + private NetworkGroupProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkGroupInner class. + */ + public NetworkGroupInner() { + } + + /** + * Get the innerProperties property: The Network Group properties. + * + * @return the innerProperties value. + */ + private NetworkGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the network group. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the network group. + * + * @param description the description value to set. + * @return the NetworkGroupInner object itself. + */ + public NetworkGroupInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkGroupProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the memberType property: The type of the group member. + * + * @return the memberType value. + */ + public GroupMemberType memberType() { + return this.innerProperties() == null ? null : this.innerProperties().memberType(); + } + + /** + * Set the memberType property: The type of the group member. + * + * @param memberType the memberType value to set. + * @return the NetworkGroupInner object itself. + */ + public NetworkGroupInner withMemberType(GroupMemberType memberType) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkGroupProperties(); + } + this.innerProperties().withMemberType(memberType); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the scope assignment resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkGroupInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkGroupInner. + */ + public static NetworkGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkGroupInner deserializedNetworkGroupInner = new NetworkGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkGroupInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkGroupInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedNetworkGroupInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkGroupInner.innerProperties = NetworkGroupProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkGroupInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkGroupInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupProperties.java new file mode 100644 index 0000000000000..732c7de5f5167 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkGroupProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GroupMemberType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of network group. + */ +@Fluent +public final class NetworkGroupProperties implements JsonSerializable { + /* + * A description of the network group. + */ + private String description; + + /* + * The type of the group member. + */ + private GroupMemberType memberType; + + /* + * The provisioning state of the scope assignment resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of NetworkGroupProperties class. + */ + public NetworkGroupProperties() { + } + + /** + * Get the description property: A description of the network group. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the network group. + * + * @param description the description value to set. + * @return the NetworkGroupProperties object itself. + */ + public NetworkGroupProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the memberType property: The type of the group member. + * + * @return the memberType value. + */ + public GroupMemberType memberType() { + return this.memberType; + } + + /** + * Set the memberType property: The type of the group member. + * + * @param memberType the memberType value to set. + * @return the NetworkGroupProperties object itself. + */ + public NetworkGroupProperties withMemberType(GroupMemberType memberType) { + this.memberType = memberType; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the scope assignment resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("memberType", this.memberType == null ? null : this.memberType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkGroupProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkGroupProperties. + */ + public static NetworkGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkGroupProperties deserializedNetworkGroupProperties = new NetworkGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedNetworkGroupProperties.description = reader.getString(); + } else if ("memberType".equals(fieldName)) { + deserializedNetworkGroupProperties.memberType = GroupMemberType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedNetworkGroupProperties.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkGroupProperties; + }); + } +} 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..3804943fd1795 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceInner.java @@ -0,0 +1,601 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceAuxiliarySku; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A network interface in a resource group. + */ +@Fluent +public final class NetworkInterfaceInner extends Resource { + /* + * The extended location of the network interface. + */ + private ExtendedLocation extendedLocation; + + /* + * Properties of the network interface. + */ + private NetworkInterfacePropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkInterfaceInner class. + */ + public NetworkInterfaceInner() { + } + + /** + * 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 innerProperties property: Properties of the network interface. + * + * @return the innerProperties value. + */ + private NetworkInterfacePropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkInterfaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkInterfaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the virtualMachine property: The reference to a virtual machine. + * + * @return the virtualMachine value. + */ + public SubResource virtualMachine() { + return this.innerProperties() == null ? null : this.innerProperties().virtualMachine(); + } + + /** + * Get the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value. + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withNetworkSecurityGroup(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.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Get the ipConfigurations property: A list of IPConfigurations of the network interface. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the tapConfigurations property: A list of TapConfigurations of the network interface. + * + * @return the tapConfigurations value. + */ + public List tapConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().tapConfigurations(); + } + + /** + * Get the dnsSettings property: The DNS settings in network interface. + * + * @return the dnsSettings value. + */ + public NetworkInterfaceDnsSettings dnsSettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withDnsSettings(dnsSettings); + return this; + } + + /** + * Get the macAddress property: The MAC address of the network interface. + * + * @return the macAddress value. + */ + public String macAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().primary(); + } + + /** + * Get the vnetEncryptionSupported property: Whether the virtual machine this nic is attached to supports + * encryption. + * + * @return the vnetEncryptionSupported value. + */ + public Boolean vnetEncryptionSupported() { + return this.innerProperties() == null ? null : this.innerProperties().vnetEncryptionSupported(); + } + + /** + * Get the enableAcceleratedNetworking property: If the network interface is configured for accelerated networking. + * Not applicable to VM sizes which require accelerated networking. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.innerProperties() == null ? null : this.innerProperties().enableAcceleratedNetworking(); + } + + /** + * Set the enableAcceleratedNetworking property: If the network interface is configured for accelerated networking. + * Not applicable to VM sizes which require accelerated networking. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withEnableAcceleratedNetworking(enableAcceleratedNetworking); + return this; + } + + /** + * Get the disableTcpStateTracking property: Indicates whether to disable tcp state tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.innerProperties() == null ? null : this.innerProperties().disableTcpStateTracking(); + } + + /** + * Set the disableTcpStateTracking property: Indicates whether to disable tcp state tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withDisableTcpStateTracking(Boolean disableTcpStateTracking) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withDisableTcpStateTracking(disableTcpStateTracking); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withEnableIpForwarding(enableIpForwarding); + return this; + } + + /** + * Get the hostedWorkloads property: A list of references to linked BareMetal resources. + * + * @return the hostedWorkloads value. + */ + public List hostedWorkloads() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().dscpConfiguration(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the network interface resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the network interface resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the workloadType property: WorkloadType of the NetworkInterface for BareMetal resources. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withWorkloadType(workloadType); + return this; + } + + /** + * Get the nicType property: Type of Network Interface resource. + * + * @return the nicType value. + */ + public NetworkInterfaceNicType nicType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withNicType(nicType); + return this; + } + + /** + * Get the privateLinkService property: Privatelinkservice of the network interface resource. + * + * @return the privateLinkService value. + */ + public PrivateLinkServiceInner privateLinkService() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withPrivateLinkService(privateLinkService); + return this; + } + + /** + * Get the migrationPhase property: Migration phase of Network Interface resource. + * + * @return the migrationPhase value. + */ + public NetworkInterfaceMigrationPhase migrationPhase() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withMigrationPhase(migrationPhase); + return this; + } + + /** + * Get the auxiliaryMode property: Auxiliary mode of Network Interface resource. + * + * @return the auxiliaryMode value. + */ + public NetworkInterfaceAuxiliaryMode auxiliaryMode() { + return this.innerProperties() == null ? null : this.innerProperties().auxiliaryMode(); + } + + /** + * Set the auxiliaryMode property: Auxiliary mode of Network Interface resource. + * + * @param auxiliaryMode the auxiliaryMode value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withAuxiliaryMode(NetworkInterfaceAuxiliaryMode auxiliaryMode) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withAuxiliaryMode(auxiliaryMode); + return this; + } + + /** + * Get the auxiliarySku property: Auxiliary sku of Network Interface resource. + * + * @return the auxiliarySku value. + */ + public NetworkInterfaceAuxiliarySku auxiliarySku() { + return this.innerProperties() == null ? null : this.innerProperties().auxiliarySku(); + } + + /** + * Set the auxiliarySku property: Auxiliary sku of Network Interface resource. + * + * @param auxiliarySku the auxiliarySku value to set. + * @return the NetworkInterfaceInner object itself. + */ + public NetworkInterfaceInner withAuxiliarySku(NetworkInterfaceAuxiliarySku auxiliarySku) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfacePropertiesFormatInner(); + } + this.innerProperties().withAuxiliarySku(auxiliarySku); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkInterfaceInner. + */ + public static NetworkInterfaceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceInner deserializedNetworkInterfaceInner = new NetworkInterfaceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkInterfaceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkInterfaceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkInterfaceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkInterfaceInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedNetworkInterfaceInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedNetworkInterfaceInner.innerProperties + = NetworkInterfacePropertiesFormatInner.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedNetworkInterfaceInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedNetworkInterfaceInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceInner; + }); + } +} 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..00313d9e97fb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationInner.java @@ -0,0 +1,510 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * IPConfiguration in a network interface. + */ +@Fluent +public final class NetworkInterfaceIpConfigurationInner extends SubResource { + /* + * Network interface IP configuration properties. + */ + private NetworkInterfaceIpConfigurationPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of NetworkInterfaceIpConfigurationInner class. + */ + public NetworkInterfaceIpConfigurationInner() { + } + + /** + * Get the innerProperties property: Network interface IP configuration properties. + * + * @return the innerProperties value. + */ + private NetworkInterfaceIpConfigurationPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkInterfaceIpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the gatewayLoadBalancer property: The reference to gateway load balancer frontend IP. + * + * @return the gatewayLoadBalancer value. + */ + public SubResource gatewayLoadBalancer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withGatewayLoadBalancer(gatewayLoadBalancer); + return this; + } + + /** + * Get the virtualNetworkTaps property: The reference to Virtual Network Taps. + * + * @return the virtualNetworkTaps value. + */ + public List virtualNetworkTaps() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withVirtualNetworkTaps(virtualNetworkTaps); + return this; + } + + /** + * Get the applicationGatewayBackendAddressPools property: The reference to ApplicationGatewayBackendAddressPool + * resource. + * + * @return the applicationGatewayBackendAddressPools value. + */ + public List applicationGatewayBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withApplicationGatewayBackendAddressPools(applicationGatewayBackendAddressPools); + return this; + } + + /** + * Get the loadBalancerBackendAddressPools property: The reference to LoadBalancerBackendAddressPool resource. + * + * @return the loadBalancerBackendAddressPools value. + */ + public List loadBalancerBackendAddressPools() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withLoadBalancerBackendAddressPools(loadBalancerBackendAddressPools); + return this; + } + + /** + * Get the loadBalancerInboundNatRules property: A list of references of LoadBalancerInboundNatRules. + * + * @return the loadBalancerInboundNatRules value. + */ + public List loadBalancerInboundNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withLoadBalancerInboundNatRules(loadBalancerInboundNatRules); + return this; + } + + /** + * Get the privateIpAddress property: Private IP address of the IP configuration. It can be a single IP address or a + * CIDR block in the format <address>/<prefix-length>. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: Private IP address of the IP configuration. It can be a single IP address or a + * CIDR block in the format <address>/<prefix-length>. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withPrivateIpAddress(String privateIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the privateIpAddressPrefixLength property: The private IP address prefix length. If specified and the + * allocation method is dynamic, the service will allocate a CIDR block instead of a single IP address. + * + * @return the privateIpAddressPrefixLength value. + */ + public Integer privateIpAddressPrefixLength() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddressPrefixLength(); + } + + /** + * Set the privateIpAddressPrefixLength property: The private IP address prefix length. If specified and the + * allocation method is dynamic, the service will allocate a CIDR block instead of a single IP address. + * + * @param privateIpAddressPrefixLength the privateIpAddressPrefixLength value to set. + * @return the NetworkInterfaceIpConfigurationInner object itself. + */ + public NetworkInterfaceIpConfigurationInner withPrivateIpAddressPrefixLength(Integer privateIpAddressPrefixLength) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAddressPrefixLength(privateIpAddressPrefixLength); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAllocationMethod(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); + return this; + } + + /** + * Get the subnet property: Subnet bound to the IP configuration. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPrimary(primary); + return this; + } + + /** + * Get the publicIpAddress property: Public IP address bound to the IP configuration. + * + * @return the publicIpAddress value. + */ + public PublicIpAddressInner publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withPublicIpAddress(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + } + this.innerProperties().withApplicationSecurityGroups(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateLinkConnectionProperties property: PrivateLinkConnection properties for the network interface. + * + * @return the privateLinkConnectionProperties value. + */ + public NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkConnectionProperties(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceIpConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceIpConfigurationInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceIpConfigurationInner. + */ + public static NetworkInterfaceIpConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceIpConfigurationInner deserializedNetworkInterfaceIpConfigurationInner + = new NetworkInterfaceIpConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationInner.innerProperties + = NetworkInterfaceIpConfigurationPropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceIpConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.java new file mode 100644 index 0000000000000..9c4764c6185da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceIpConfigurationPropertiesFormatInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Properties of IP configuration. + */ +@Fluent +public final class NetworkInterfaceIpConfigurationPropertiesFormatInner + implements JsonSerializable { + /* + * The reference to gateway load balancer frontend IP. + */ + private SubResource gatewayLoadBalancer; + + /* + * The reference to Virtual Network Taps. + */ + private List virtualNetworkTaps; + + /* + * The reference to ApplicationGatewayBackendAddressPool resource. + */ + private List applicationGatewayBackendAddressPools; + + /* + * The reference to LoadBalancerBackendAddressPool resource. + */ + private List loadBalancerBackendAddressPools; + + /* + * A list of references of LoadBalancerInboundNatRules. + */ + private List loadBalancerInboundNatRules; + + /* + * Private IP address of the IP configuration. It can be a single IP address or a CIDR block in the format + *

/. + */ + private String privateIpAddress; + + /* + * The private IP address prefix length. If specified and the allocation method is dynamic, the service will + * allocate a CIDR block instead of a single IP address. + */ + private Integer privateIpAddressPrefixLength; + + /* + * The private IP address allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + */ + private IpVersion privateIpAddressVersion; + + /* + * Subnet bound to the IP configuration. + */ + private SubnetInner subnet; + + /* + * Whether this is a primary customer address on the network interface. + */ + private Boolean primary; + + /* + * Public IP address bound to the IP configuration. + */ + private PublicIpAddressInner publicIpAddress; + + /* + * Application security groups in which the IP configuration is included. + */ + private List applicationSecurityGroups; + + /* + * The provisioning state of the network interface IP configuration. + */ + private ProvisioningState provisioningState; + + /* + * PrivateLinkConnection properties for the network interface. + */ + private NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties; + + /** + * Creates an instance of NetworkInterfaceIpConfigurationPropertiesFormatInner class. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner() { + } + + /** + * 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + withLoadBalancerInboundNatRules(List loadBalancerInboundNatRules) { + this.loadBalancerInboundNatRules = loadBalancerInboundNatRules; + return this; + } + + /** + * Get the privateIpAddress property: Private IP address of the IP configuration. It can be a single IP address or a + * CIDR block in the format <address>/<prefix-length>. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: Private IP address of the IP configuration. It can be a single IP address or a + * CIDR block in the format <address>/<prefix-length>. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Get the privateIpAddressPrefixLength property: The private IP address prefix length. If specified and the + * allocation method is dynamic, the service will allocate a CIDR block instead of a single IP address. + * + * @return the privateIpAddressPrefixLength value. + */ + public Integer privateIpAddressPrefixLength() { + return this.privateIpAddressPrefixLength; + } + + /** + * Set the privateIpAddressPrefixLength property: The private IP address prefix length. If specified and the + * allocation method is dynamic, the service will allocate a CIDR block instead of a single IP address. + * + * @param privateIpAddressPrefixLength the privateIpAddressPrefixLength value to set. + * @return the NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + withPrivateIpAddressPrefixLength(Integer privateIpAddressPrefixLength) { + this.privateIpAddressPrefixLength = privateIpAddressPrefixLength; + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceIpConfigurationPropertiesFormatInner + 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("gatewayLoadBalancer", this.gatewayLoadBalancer); + jsonWriter.writeArrayField("virtualNetworkTaps", this.virtualNetworkTaps, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationGatewayBackendAddressPools", this.applicationGatewayBackendAddressPools, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("loadBalancerBackendAddressPools", this.loadBalancerBackendAddressPools, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("loadBalancerInboundNatRules", this.loadBalancerInboundNatRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeNumberField("privateIPAddressPrefixLength", this.privateIpAddressPrefixLength); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeStringField("privateIPAddressVersion", + this.privateIpAddressVersion == null ? null : this.privateIpAddressVersion.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeBooleanField("primary", this.primary); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + jsonWriter.writeArrayField("applicationSecurityGroups", this.applicationSecurityGroups, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceIpConfigurationPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceIpConfigurationPropertiesFormatInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceIpConfigurationPropertiesFormatInner. + */ + public static NetworkInterfaceIpConfigurationPropertiesFormatInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceIpConfigurationPropertiesFormatInner deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner + = new NetworkInterfaceIpConfigurationPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("gatewayLoadBalancer".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.gatewayLoadBalancer + = SubResource.fromJson(reader); + } else if ("virtualNetworkTaps".equals(fieldName)) { + List virtualNetworkTaps + = reader.readArray(reader1 -> VirtualNetworkTapInner.fromJson(reader1)); + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.virtualNetworkTaps + = virtualNetworkTaps; + } else if ("applicationGatewayBackendAddressPools".equals(fieldName)) { + List applicationGatewayBackendAddressPools + = reader.readArray(reader1 -> ApplicationGatewayBackendAddressPool.fromJson(reader1)); + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.applicationGatewayBackendAddressPools + = applicationGatewayBackendAddressPools; + } else if ("loadBalancerBackendAddressPools".equals(fieldName)) { + List loadBalancerBackendAddressPools + = reader.readArray(reader1 -> BackendAddressPoolInner.fromJson(reader1)); + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.loadBalancerBackendAddressPools + = loadBalancerBackendAddressPools; + } else if ("loadBalancerInboundNatRules".equals(fieldName)) { + List loadBalancerInboundNatRules + = reader.readArray(reader1 -> InboundNatRuleInner.fromJson(reader1)); + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.loadBalancerInboundNatRules + = loadBalancerInboundNatRules; + } else if ("privateIPAddress".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.privateIpAddress + = reader.getString(); + } else if ("privateIPAddressPrefixLength".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.privateIpAddressPrefixLength + = reader.getNullable(JsonReader::getInt); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("privateIPAddressVersion".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.privateIpAddressVersion + = IpVersion.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.subnet + = SubnetInner.fromJson(reader); + } else if ("primary".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.primary + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.publicIpAddress + = PublicIpAddressInner.fromJson(reader); + } else if ("applicationSecurityGroups".equals(fieldName)) { + List applicationSecurityGroups + = reader.readArray(reader1 -> ApplicationSecurityGroupInner.fromJson(reader1)); + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.applicationSecurityGroups + = applicationSecurityGroups; + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateLinkConnectionProperties".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner.privateLinkConnectionProperties + = NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceIpConfigurationPropertiesFormatInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfacePropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfacePropertiesFormatInner.java new file mode 100644 index 0000000000000..f37595cae6526 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfacePropertiesFormatInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceAuxiliarySku; +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 java.io.IOException; +import java.util.List; + +/** + * NetworkInterface properties. + */ +@Fluent +public final class NetworkInterfacePropertiesFormatInner + implements JsonSerializable { + /* + * The reference to a virtual machine. + */ + private SubResource virtualMachine; + + /* + * The reference to the NetworkSecurityGroup resource. + */ + private NetworkSecurityGroupInner networkSecurityGroup; + + /* + * A reference to the private endpoint to which the network interface is linked. + */ + private PrivateEndpointInner privateEndpoint; + + /* + * A list of IPConfigurations of the network interface. + */ + private List ipConfigurations; + + /* + * A list of TapConfigurations of the network interface. + */ + private List tapConfigurations; + + /* + * The DNS settings in network interface. + */ + private NetworkInterfaceDnsSettings dnsSettings; + + /* + * The MAC address of the network interface. + */ + private String macAddress; + + /* + * Whether this is a primary network interface on a virtual machine. + */ + private Boolean primary; + + /* + * Whether the virtual machine this nic is attached to supports encryption. + */ + private Boolean vnetEncryptionSupported; + + /* + * If the network interface is configured for accelerated networking. Not applicable to VM sizes which require + * accelerated networking. + */ + private Boolean enableAcceleratedNetworking; + + /* + * Indicates whether to disable tcp state tracking. + */ + private Boolean disableTcpStateTracking; + + /* + * Indicates whether IP forwarding is enabled on this network interface. + */ + private Boolean enableIpForwarding; + + /* + * A list of references to linked BareMetal resources. + */ + private List hostedWorkloads; + + /* + * A reference to the dscp configuration to which the network interface is linked. + */ + private SubResource dscpConfiguration; + + /* + * The resource GUID property of the network interface resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the network interface resource. + */ + private ProvisioningState provisioningState; + + /* + * WorkloadType of the NetworkInterface for BareMetal resources + */ + private String workloadType; + + /* + * Type of Network Interface resource. + */ + private NetworkInterfaceNicType nicType; + + /* + * Privatelinkservice of the network interface resource. + */ + private PrivateLinkServiceInner privateLinkService; + + /* + * Migration phase of Network Interface resource. + */ + private NetworkInterfaceMigrationPhase migrationPhase; + + /* + * Auxiliary mode of Network Interface resource. + */ + private NetworkInterfaceAuxiliaryMode auxiliaryMode; + + /* + * Auxiliary sku of Network Interface resource. + */ + private NetworkInterfaceAuxiliarySku auxiliarySku; + + /** + * Creates an instance of NetworkInterfacePropertiesFormatInner class. + */ + public NetworkInterfacePropertiesFormatInner() { + } + + /** + * 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner + 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner + 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner 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 vnetEncryptionSupported property: Whether the virtual machine this nic is attached to supports + * encryption. + * + * @return the vnetEncryptionSupported value. + */ + public Boolean vnetEncryptionSupported() { + return this.vnetEncryptionSupported; + } + + /** + * Get the enableAcceleratedNetworking property: If the network interface is configured for accelerated networking. + * Not applicable to VM sizes which require accelerated networking. + * + * @return the enableAcceleratedNetworking value. + */ + public Boolean enableAcceleratedNetworking() { + return this.enableAcceleratedNetworking; + } + + /** + * Set the enableAcceleratedNetworking property: If the network interface is configured for accelerated networking. + * Not applicable to VM sizes which require accelerated networking. + * + * @param enableAcceleratedNetworking the enableAcceleratedNetworking value to set. + * @return the NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking) { + this.enableAcceleratedNetworking = enableAcceleratedNetworking; + return this; + } + + /** + * Get the disableTcpStateTracking property: Indicates whether to disable tcp state tracking. + * + * @return the disableTcpStateTracking value. + */ + public Boolean disableTcpStateTracking() { + return this.disableTcpStateTracking; + } + + /** + * Set the disableTcpStateTracking property: Indicates whether to disable tcp state tracking. + * + * @param disableTcpStateTracking the disableTcpStateTracking value to set. + * @return the NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner withDisableTcpStateTracking(Boolean disableTcpStateTracking) { + this.disableTcpStateTracking = disableTcpStateTracking; + 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner 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 NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner withMigrationPhase(NetworkInterfaceMigrationPhase migrationPhase) { + this.migrationPhase = migrationPhase; + return this; + } + + /** + * Get the auxiliaryMode property: Auxiliary mode of Network Interface resource. + * + * @return the auxiliaryMode value. + */ + public NetworkInterfaceAuxiliaryMode auxiliaryMode() { + return this.auxiliaryMode; + } + + /** + * Set the auxiliaryMode property: Auxiliary mode of Network Interface resource. + * + * @param auxiliaryMode the auxiliaryMode value to set. + * @return the NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner withAuxiliaryMode(NetworkInterfaceAuxiliaryMode auxiliaryMode) { + this.auxiliaryMode = auxiliaryMode; + return this; + } + + /** + * Get the auxiliarySku property: Auxiliary sku of Network Interface resource. + * + * @return the auxiliarySku value. + */ + public NetworkInterfaceAuxiliarySku auxiliarySku() { + return this.auxiliarySku; + } + + /** + * Set the auxiliarySku property: Auxiliary sku of Network Interface resource. + * + * @param auxiliarySku the auxiliarySku value to set. + * @return the NetworkInterfacePropertiesFormatInner object itself. + */ + public NetworkInterfacePropertiesFormatInner withAuxiliarySku(NetworkInterfaceAuxiliarySku auxiliarySku) { + this.auxiliarySku = auxiliarySku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkSecurityGroup", this.networkSecurityGroup); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeBooleanField("enableAcceleratedNetworking", this.enableAcceleratedNetworking); + jsonWriter.writeBooleanField("disableTcpStateTracking", this.disableTcpStateTracking); + jsonWriter.writeBooleanField("enableIPForwarding", this.enableIpForwarding); + jsonWriter.writeStringField("workloadType", this.workloadType); + jsonWriter.writeStringField("nicType", this.nicType == null ? null : this.nicType.toString()); + jsonWriter.writeJsonField("privateLinkService", this.privateLinkService); + jsonWriter.writeStringField("migrationPhase", + this.migrationPhase == null ? null : this.migrationPhase.toString()); + jsonWriter.writeStringField("auxiliaryMode", this.auxiliaryMode == null ? null : this.auxiliaryMode.toString()); + jsonWriter.writeStringField("auxiliarySku", this.auxiliarySku == null ? null : this.auxiliarySku.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfacePropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfacePropertiesFormatInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfacePropertiesFormatInner. + */ + public static NetworkInterfacePropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfacePropertiesFormatInner deserializedNetworkInterfacePropertiesFormatInner + = new NetworkInterfacePropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualMachine".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.virtualMachine = SubResource.fromJson(reader); + } else if ("networkSecurityGroup".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.networkSecurityGroup + = NetworkSecurityGroupInner.fromJson(reader); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.privateEndpoint + = PrivateEndpointInner.fromJson(reader); + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> NetworkInterfaceIpConfigurationInner.fromJson(reader1)); + deserializedNetworkInterfacePropertiesFormatInner.ipConfigurations = ipConfigurations; + } else if ("tapConfigurations".equals(fieldName)) { + List tapConfigurations + = reader.readArray(reader1 -> NetworkInterfaceTapConfigurationInner.fromJson(reader1)); + deserializedNetworkInterfacePropertiesFormatInner.tapConfigurations = tapConfigurations; + } else if ("dnsSettings".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.dnsSettings + = NetworkInterfaceDnsSettings.fromJson(reader); + } else if ("macAddress".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.macAddress = reader.getString(); + } else if ("primary".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.primary + = reader.getNullable(JsonReader::getBoolean); + } else if ("vnetEncryptionSupported".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.vnetEncryptionSupported + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAcceleratedNetworking".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.enableAcceleratedNetworking + = reader.getNullable(JsonReader::getBoolean); + } else if ("disableTcpStateTracking".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.disableTcpStateTracking + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableIPForwarding".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.enableIpForwarding + = reader.getNullable(JsonReader::getBoolean); + } else if ("hostedWorkloads".equals(fieldName)) { + List hostedWorkloads = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkInterfacePropertiesFormatInner.hostedWorkloads = hostedWorkloads; + } else if ("dscpConfiguration".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.dscpConfiguration = SubResource.fromJson(reader); + } else if ("resourceGuid".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("workloadType".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.workloadType = reader.getString(); + } else if ("nicType".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.nicType + = NetworkInterfaceNicType.fromString(reader.getString()); + } else if ("privateLinkService".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.privateLinkService + = PrivateLinkServiceInner.fromJson(reader); + } else if ("migrationPhase".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.migrationPhase + = NetworkInterfaceMigrationPhase.fromString(reader.getString()); + } else if ("auxiliaryMode".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.auxiliaryMode + = NetworkInterfaceAuxiliaryMode.fromString(reader.getString()); + } else if ("auxiliarySku".equals(fieldName)) { + deserializedNetworkInterfacePropertiesFormatInner.auxiliarySku + = NetworkInterfaceAuxiliarySku.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfacePropertiesFormatInner; + }); + } +} 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..6ad5a526bc890 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Tap configuration in a Network Interface. + */ +@Fluent +public final class NetworkInterfaceTapConfigurationInner extends SubResource { + /* + * Properties of the Virtual Network Tap configuration. + */ + private NetworkInterfaceTapConfigurationPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Sub Resource type. + */ + private String type; + + /** + * Creates an instance of NetworkInterfaceTapConfigurationInner class. + */ + public NetworkInterfaceTapConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of the Virtual Network Tap configuration. + * + * @return the innerProperties value. + */ + private NetworkInterfaceTapConfigurationPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkInterfaceTapConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the virtualNetworkTap property: The reference to the Virtual Network Tap resource. + * + * @return the virtualNetworkTap value. + */ + public VirtualNetworkTapInner virtualNetworkTap() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkInterfaceTapConfigurationPropertiesFormatInner(); + } + this.innerProperties().withVirtualNetworkTap(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceTapConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceTapConfigurationInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceTapConfigurationInner. + */ + public static NetworkInterfaceTapConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceTapConfigurationInner deserializedNetworkInterfaceTapConfigurationInner + = new NetworkInterfaceTapConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationInner.innerProperties + = NetworkInterfaceTapConfigurationPropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceTapConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.java new file mode 100644 index 0000000000000..2b0914b9a0ab5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkInterfaceTapConfigurationPropertiesFormatInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of Virtual Network Tap configuration. + */ +@Fluent +public final class NetworkInterfaceTapConfigurationPropertiesFormatInner + implements JsonSerializable { + /* + * The reference to the Virtual Network Tap resource. + */ + private VirtualNetworkTapInner virtualNetworkTap; + + /* + * The provisioning state of the network interface tap configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NetworkInterfaceTapConfigurationPropertiesFormatInner class. + */ + public NetworkInterfaceTapConfigurationPropertiesFormatInner() { + } + + /** + * 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 NetworkInterfaceTapConfigurationPropertiesFormatInner object itself. + */ + public NetworkInterfaceTapConfigurationPropertiesFormatInner + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkTap() != null) { + virtualNetworkTap().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualNetworkTap", this.virtualNetworkTap); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceTapConfigurationPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceTapConfigurationPropertiesFormatInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceTapConfigurationPropertiesFormatInner. + */ + public static NetworkInterfaceTapConfigurationPropertiesFormatInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceTapConfigurationPropertiesFormatInner deserializedNetworkInterfaceTapConfigurationPropertiesFormatInner + = new NetworkInterfaceTapConfigurationPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualNetworkTap".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationPropertiesFormatInner.virtualNetworkTap + = VirtualNetworkTapInner.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceTapConfigurationPropertiesFormatInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerCommitInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerCommitInner.java new file mode 100644 index 0000000000000..e720c04073946 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerCommitInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import java.io.IOException; +import java.util.List; + +/** + * Network Manager Commit. + */ +@Fluent +public final class NetworkManagerCommitInner implements JsonSerializable { + /* + * Commit Id. + */ + private String commitId; + + /* + * List of target locations. + */ + private List targetLocations; + + /* + * List of configuration ids. + */ + private List configurationIds; + + /* + * Commit Type. + */ + private ConfigurationType commitType; + + /** + * Creates an instance of NetworkManagerCommitInner class. + */ + public NetworkManagerCommitInner() { + } + + /** + * Get the commitId property: Commit Id. + * + * @return the commitId value. + */ + public String commitId() { + return this.commitId; + } + + /** + * Get the targetLocations property: List of target locations. + * + * @return the targetLocations value. + */ + public List targetLocations() { + return this.targetLocations; + } + + /** + * Set the targetLocations property: List of target locations. + * + * @param targetLocations the targetLocations value to set. + * @return the NetworkManagerCommitInner object itself. + */ + public NetworkManagerCommitInner withTargetLocations(List targetLocations) { + this.targetLocations = targetLocations; + return this; + } + + /** + * Get the configurationIds property: List of configuration ids. + * + * @return the configurationIds value. + */ + public List configurationIds() { + return this.configurationIds; + } + + /** + * Set the configurationIds property: List of configuration ids. + * + * @param configurationIds the configurationIds value to set. + * @return the NetworkManagerCommitInner object itself. + */ + public NetworkManagerCommitInner withConfigurationIds(List configurationIds) { + this.configurationIds = configurationIds; + return this; + } + + /** + * Get the commitType property: Commit Type. + * + * @return the commitType value. + */ + public ConfigurationType commitType() { + return this.commitType; + } + + /** + * Set the commitType property: Commit Type. + * + * @param commitType the commitType value to set. + * @return the NetworkManagerCommitInner object itself. + */ + public NetworkManagerCommitInner withCommitType(ConfigurationType commitType) { + this.commitType = commitType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetLocations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetLocations in model NetworkManagerCommitInner")); + } + if (commitType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property commitType in model NetworkManagerCommitInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerCommitInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("targetLocations", this.targetLocations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("commitType", this.commitType == null ? null : this.commitType.toString()); + jsonWriter.writeArrayField("configurationIds", this.configurationIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerCommitInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerCommitInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkManagerCommitInner. + */ + public static NetworkManagerCommitInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerCommitInner deserializedNetworkManagerCommitInner = new NetworkManagerCommitInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetLocations".equals(fieldName)) { + List targetLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkManagerCommitInner.targetLocations = targetLocations; + } else if ("commitType".equals(fieldName)) { + deserializedNetworkManagerCommitInner.commitType = ConfigurationType.fromString(reader.getString()); + } else if ("commitId".equals(fieldName)) { + deserializedNetworkManagerCommitInner.commitId = reader.getString(); + } else if ("configurationIds".equals(fieldName)) { + List configurationIds = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkManagerCommitInner.configurationIds = configurationIds; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerCommitInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionInner.java new file mode 100644 index 0000000000000..c1c37eac8820c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; +import java.io.IOException; + +/** + * The Network Manager Connection resource. + */ +@Fluent +public final class NetworkManagerConnectionInner extends ChildResource { + /* + * The scope connection properties + */ + private NetworkManagerConnectionProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkManagerConnectionInner class. + */ + public NetworkManagerConnectionInner() { + } + + /** + * Get the innerProperties property: The scope connection properties. + * + * @return the innerProperties value. + */ + private NetworkManagerConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the networkManagerId property: Network Manager Id. + * + * @return the networkManagerId value. + */ + public String networkManagerId() { + return this.innerProperties() == null ? null : this.innerProperties().networkManagerId(); + } + + /** + * Set the networkManagerId property: Network Manager Id. + * + * @param networkManagerId the networkManagerId value to set. + * @return the NetworkManagerConnectionInner object itself. + */ + public NetworkManagerConnectionInner withNetworkManagerId(String networkManagerId) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkManagerConnectionProperties(); + } + this.innerProperties().withNetworkManagerId(networkManagerId); + return this; + } + + /** + * Get the connectionState property: Connection state. + * + * @return the connectionState value. + */ + public ScopeConnectionState connectionState() { + return this.innerProperties() == null ? null : this.innerProperties().connectionState(); + } + + /** + * Get the description property: A description of the network manager connection. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the network manager connection. + * + * @param description the description value to set. + * @return the NetworkManagerConnectionInner object itself. + */ + public NetworkManagerConnectionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkManagerConnectionProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerConnectionInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkManagerConnectionInner. + */ + public static NetworkManagerConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerConnectionInner deserializedNetworkManagerConnectionInner + = new NetworkManagerConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkManagerConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkManagerConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkManagerConnectionInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedNetworkManagerConnectionInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkManagerConnectionInner.innerProperties + = NetworkManagerConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkManagerConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionProperties.java new file mode 100644 index 0000000000000..4c145e705a313 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerConnectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; +import java.io.IOException; + +/** + * Information about the network manager connection. + */ +@Fluent +public final class NetworkManagerConnectionProperties implements JsonSerializable { + /* + * Network Manager Id. + */ + private String networkManagerId; + + /* + * Connection state. + */ + private ScopeConnectionState connectionState; + + /* + * A description of the network manager connection. + */ + private String description; + + /** + * Creates an instance of NetworkManagerConnectionProperties class. + */ + public NetworkManagerConnectionProperties() { + } + + /** + * Get the networkManagerId property: Network Manager Id. + * + * @return the networkManagerId value. + */ + public String networkManagerId() { + return this.networkManagerId; + } + + /** + * Set the networkManagerId property: Network Manager Id. + * + * @param networkManagerId the networkManagerId value to set. + * @return the NetworkManagerConnectionProperties object itself. + */ + public NetworkManagerConnectionProperties withNetworkManagerId(String networkManagerId) { + this.networkManagerId = networkManagerId; + return this; + } + + /** + * Get the connectionState property: Connection state. + * + * @return the connectionState value. + */ + public ScopeConnectionState connectionState() { + return this.connectionState; + } + + /** + * Get the description property: A description of the network manager connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the network manager connection. + * + * @param description the description value to set. + * @return the NetworkManagerConnectionProperties object itself. + */ + public NetworkManagerConnectionProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkManagerId", this.networkManagerId); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerConnectionProperties. + */ + public static NetworkManagerConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerConnectionProperties deserializedNetworkManagerConnectionProperties + = new NetworkManagerConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkManagerId".equals(fieldName)) { + deserializedNetworkManagerConnectionProperties.networkManagerId = reader.getString(); + } else if ("connectionState".equals(fieldName)) { + deserializedNetworkManagerConnectionProperties.connectionState + = ScopeConnectionState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedNetworkManagerConnectionProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerConnectionProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerDeploymentStatusListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerDeploymentStatusListResultInner.java new file mode 100644 index 0000000000000..14486bf70f29c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerDeploymentStatusListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatus; +import java.io.IOException; +import java.util.List; + +/** + * A list of Network Manager Deployment Status. + */ +@Fluent +public final class NetworkManagerDeploymentStatusListResultInner + implements JsonSerializable { + /* + * Gets a page of Network Manager Deployment Status + */ + private List value; + + /* + * When present, the value can be passed to a subsequent query call (together with the same query and scopes used in + * the current request) to retrieve the next page of data. + */ + private String skipToken; + + /** + * Creates an instance of NetworkManagerDeploymentStatusListResultInner class. + */ + public NetworkManagerDeploymentStatusListResultInner() { + } + + /** + * Get the value property: Gets a page of Network Manager Deployment Status. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of Network Manager Deployment Status. + * + * @param value the value value to set. + * @return the NetworkManagerDeploymentStatusListResultInner object itself. + */ + public NetworkManagerDeploymentStatusListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @param skipToken the skipToken value to set. + * @return the NetworkManagerDeploymentStatusListResultInner object itself. + */ + public NetworkManagerDeploymentStatusListResultInner withSkipToken(String skipToken) { + this.skipToken = skipToken; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerDeploymentStatusListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerDeploymentStatusListResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerDeploymentStatusListResultInner. + */ + public static NetworkManagerDeploymentStatusListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerDeploymentStatusListResultInner deserializedNetworkManagerDeploymentStatusListResultInner + = new NetworkManagerDeploymentStatusListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkManagerDeploymentStatus.fromJson(reader1)); + deserializedNetworkManagerDeploymentStatusListResultInner.value = value; + } else if ("skipToken".equals(fieldName)) { + deserializedNetworkManagerDeploymentStatusListResultInner.skipToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerDeploymentStatusListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveConnectivityConfigurationListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveConnectivityConfigurationListResultInner.java new file mode 100644 index 0000000000000..9da8c254c89d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveConnectivityConfigurationListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.EffectiveConnectivityConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list networkManagerEffectiveConnectivityConfiguration. It contains a list of groups and a + * skiptoken to get the next set of results. + */ +@Fluent +public final class NetworkManagerEffectiveConnectivityConfigurationListResultInner + implements JsonSerializable { + /* + * Gets a page of NetworkManagerEffectiveConnectivityConfiguration + */ + private List value; + + /* + * When present, the value can be passed to a subsequent query call (together with the same query and scopes used in + * the current request) to retrieve the next page of data. + */ + private String skipToken; + + /** + * Creates an instance of NetworkManagerEffectiveConnectivityConfigurationListResultInner class. + */ + public NetworkManagerEffectiveConnectivityConfigurationListResultInner() { + } + + /** + * Get the value property: Gets a page of NetworkManagerEffectiveConnectivityConfiguration. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of NetworkManagerEffectiveConnectivityConfiguration. + * + * @param value the value value to set. + * @return the NetworkManagerEffectiveConnectivityConfigurationListResultInner object itself. + */ + public NetworkManagerEffectiveConnectivityConfigurationListResultInner + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @param skipToken the skipToken value to set. + * @return the NetworkManagerEffectiveConnectivityConfigurationListResultInner object itself. + */ + public NetworkManagerEffectiveConnectivityConfigurationListResultInner withSkipToken(String skipToken) { + this.skipToken = skipToken; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerEffectiveConnectivityConfigurationListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerEffectiveConnectivityConfigurationListResultInner if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * NetworkManagerEffectiveConnectivityConfigurationListResultInner. + */ + public static NetworkManagerEffectiveConnectivityConfigurationListResultInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerEffectiveConnectivityConfigurationListResultInner deserializedNetworkManagerEffectiveConnectivityConfigurationListResultInner + = new NetworkManagerEffectiveConnectivityConfigurationListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EffectiveConnectivityConfiguration.fromJson(reader1)); + deserializedNetworkManagerEffectiveConnectivityConfigurationListResultInner.value = value; + } else if ("skipToken".equals(fieldName)) { + deserializedNetworkManagerEffectiveConnectivityConfigurationListResultInner.skipToken + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerEffectiveConnectivityConfigurationListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveSecurityAdminRulesListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveSecurityAdminRulesListResultInner.java new file mode 100644 index 0000000000000..8bc73e4c4ade2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerEffectiveSecurityAdminRulesListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.EffectiveBaseSecurityAdminRule; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list networkManagerEffectiveSecurityAdminRules. It contains a list of groups and a skiptoken + * to get the next set of results. + */ +@Fluent +public final class NetworkManagerEffectiveSecurityAdminRulesListResultInner + implements JsonSerializable { + /* + * Gets a page of NetworkManagerEffectiveSecurityAdminRules + */ + private List value; + + /* + * When present, the value can be passed to a subsequent query call (together with the same query and scopes used in + * the current request) to retrieve the next page of data. + */ + private String skipToken; + + /** + * Creates an instance of NetworkManagerEffectiveSecurityAdminRulesListResultInner class. + */ + public NetworkManagerEffectiveSecurityAdminRulesListResultInner() { + } + + /** + * Get the value property: Gets a page of NetworkManagerEffectiveSecurityAdminRules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of NetworkManagerEffectiveSecurityAdminRules. + * + * @param value the value value to set. + * @return the NetworkManagerEffectiveSecurityAdminRulesListResultInner object itself. + */ + public NetworkManagerEffectiveSecurityAdminRulesListResultInner + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @param skipToken the skipToken value to set. + * @return the NetworkManagerEffectiveSecurityAdminRulesListResultInner object itself. + */ + public NetworkManagerEffectiveSecurityAdminRulesListResultInner withSkipToken(String skipToken) { + this.skipToken = skipToken; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerEffectiveSecurityAdminRulesListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerEffectiveSecurityAdminRulesListResultInner if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * NetworkManagerEffectiveSecurityAdminRulesListResultInner. + */ + public static NetworkManagerEffectiveSecurityAdminRulesListResultInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerEffectiveSecurityAdminRulesListResultInner deserializedNetworkManagerEffectiveSecurityAdminRulesListResultInner + = new NetworkManagerEffectiveSecurityAdminRulesListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EffectiveBaseSecurityAdminRule.fromJson(reader1)); + deserializedNetworkManagerEffectiveSecurityAdminRulesListResultInner.value = value; + } else if ("skipToken".equals(fieldName)) { + deserializedNetworkManagerEffectiveSecurityAdminRulesListResultInner.skipToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerEffectiveSecurityAdminRulesListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerInner.java new file mode 100644 index 0000000000000..00c7d5ab80583 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerInner.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManagerPropertiesNetworkManagerScopes; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The Managed Network resource. + */ +@Fluent +public final class NetworkManagerInner extends Resource { + /* + * The network manager properties + */ + private NetworkManagerProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkManagerInner class. + */ + public NetworkManagerInner() { + } + + /** + * Get the innerProperties property: The network manager properties. + * + * @return the innerProperties value. + */ + private NetworkManagerProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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 NetworkManagerInner object itself. + */ + public NetworkManagerInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkManagerInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkManagerInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the description property: A description of the network manager. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the network manager. + * + * @param description the description value to set. + * @return the NetworkManagerInner object itself. + */ + public NetworkManagerInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkManagerProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the networkManagerScopes property: Scope of Network Manager. + * + * @return the networkManagerScopes value. + */ + public NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes() { + return this.innerProperties() == null ? null : this.innerProperties().networkManagerScopes(); + } + + /** + * Set the networkManagerScopes property: Scope of Network Manager. + * + * @param networkManagerScopes the networkManagerScopes value to set. + * @return the NetworkManagerInner object itself. + */ + public NetworkManagerInner + withNetworkManagerScopes(NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkManagerProperties(); + } + this.innerProperties().withNetworkManagerScopes(networkManagerScopes); + return this; + } + + /** + * Get the networkManagerScopeAccesses property: Scope Access. + * + * @return the networkManagerScopeAccesses value. + */ + public List networkManagerScopeAccesses() { + return this.innerProperties() == null ? null : this.innerProperties().networkManagerScopeAccesses(); + } + + /** + * Set the networkManagerScopeAccesses property: Scope Access. + * + * @param networkManagerScopeAccesses the networkManagerScopeAccesses value to set. + * @return the NetworkManagerInner object itself. + */ + public NetworkManagerInner withNetworkManagerScopeAccesses(List networkManagerScopeAccesses) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkManagerProperties(); + } + this.innerProperties().withNetworkManagerScopeAccesses(networkManagerScopeAccesses); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the network manager resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkManagerInner. + */ + public static NetworkManagerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerInner deserializedNetworkManagerInner = new NetworkManagerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkManagerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkManagerInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkManagerInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkManagerInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkManagerInner.innerProperties = NetworkManagerProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedNetworkManagerInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkManagerInner.systemData = SystemData.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedNetworkManagerInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerProperties.java new file mode 100644 index 0000000000000..1c624469e4b62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManagerPropertiesNetworkManagerScopes; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Managed Network. + */ +@Fluent +public final class NetworkManagerProperties implements JsonSerializable { + /* + * A description of the network manager. + */ + private String description; + + /* + * Scope of Network Manager. + */ + private NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes; + + /* + * Scope Access. + */ + private List networkManagerScopeAccesses; + + /* + * The provisioning state of the network manager resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of NetworkManagerProperties class. + */ + public NetworkManagerProperties() { + } + + /** + * Get the description property: A description of the network manager. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the network manager. + * + * @param description the description value to set. + * @return the NetworkManagerProperties object itself. + */ + public NetworkManagerProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the networkManagerScopes property: Scope of Network Manager. + * + * @return the networkManagerScopes value. + */ + public NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes() { + return this.networkManagerScopes; + } + + /** + * Set the networkManagerScopes property: Scope of Network Manager. + * + * @param networkManagerScopes the networkManagerScopes value to set. + * @return the NetworkManagerProperties object itself. + */ + public NetworkManagerProperties + withNetworkManagerScopes(NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes) { + this.networkManagerScopes = networkManagerScopes; + return this; + } + + /** + * Get the networkManagerScopeAccesses property: Scope Access. + * + * @return the networkManagerScopeAccesses value. + */ + public List networkManagerScopeAccesses() { + return this.networkManagerScopeAccesses; + } + + /** + * Set the networkManagerScopeAccesses property: Scope Access. + * + * @param networkManagerScopeAccesses the networkManagerScopeAccesses value to set. + * @return the NetworkManagerProperties object itself. + */ + public NetworkManagerProperties + withNetworkManagerScopeAccesses(List networkManagerScopeAccesses) { + this.networkManagerScopeAccesses = networkManagerScopeAccesses; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the network manager resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkManagerScopes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkManagerScopes in model NetworkManagerProperties")); + } else { + networkManagerScopes().validate(); + } + if (networkManagerScopeAccesses() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkManagerScopeAccesses in model NetworkManagerProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkManagerScopes", this.networkManagerScopes); + jsonWriter.writeArrayField("networkManagerScopeAccesses", this.networkManagerScopeAccesses, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkManagerProperties. + */ + public static NetworkManagerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerProperties deserializedNetworkManagerProperties = new NetworkManagerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkManagerScopes".equals(fieldName)) { + deserializedNetworkManagerProperties.networkManagerScopes + = NetworkManagerPropertiesNetworkManagerScopes.fromJson(reader); + } else if ("networkManagerScopeAccesses".equals(fieldName)) { + List networkManagerScopeAccesses + = reader.readArray(reader1 -> ConfigurationType.fromString(reader1.getString())); + deserializedNetworkManagerProperties.networkManagerScopeAccesses = networkManagerScopeAccesses; + } else if ("description".equals(fieldName)) { + deserializedNetworkManagerProperties.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkManagerProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedNetworkManagerProperties.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationInner.java new file mode 100644 index 0000000000000..d0bb80a721143 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationInner.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.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Defines the routing configuration. + */ +@Fluent +public final class NetworkManagerRoutingConfigurationInner extends ChildResource { + /* + * Indicates the properties for the network manager routing configuration. + */ + private NetworkManagerRoutingConfigurationPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkManagerRoutingConfigurationInner class. + */ + public NetworkManagerRoutingConfigurationInner() { + } + + /** + * Get the innerProperties property: Indicates the properties for the network manager routing configuration. + * + * @return the innerProperties value. + */ + private NetworkManagerRoutingConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the routing configuration. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the routing configuration. + * + * @param description the description value to set. + * @return the NetworkManagerRoutingConfigurationInner object itself. + */ + public NetworkManagerRoutingConfigurationInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkManagerRoutingConfigurationPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerRoutingConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerRoutingConfigurationInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkManagerRoutingConfigurationInner. + */ + public static NetworkManagerRoutingConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerRoutingConfigurationInner deserializedNetworkManagerRoutingConfigurationInner + = new NetworkManagerRoutingConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationInner.innerProperties + = NetworkManagerRoutingConfigurationPropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerRoutingConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..19e0020880ab8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkManagerRoutingConfigurationPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Defines the routing configuration properties. + */ +@Fluent +public final class NetworkManagerRoutingConfigurationPropertiesFormat + implements JsonSerializable { + /* + * A description of the routing configuration. + */ + private String description; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of NetworkManagerRoutingConfigurationPropertiesFormat class. + */ + public NetworkManagerRoutingConfigurationPropertiesFormat() { + } + + /** + * Get the description property: A description of the routing configuration. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the routing configuration. + * + * @param description the description value to set. + * @return the NetworkManagerRoutingConfigurationPropertiesFormat object itself. + */ + public NetworkManagerRoutingConfigurationPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerRoutingConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerRoutingConfigurationPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerRoutingConfigurationPropertiesFormat. + */ + public static NetworkManagerRoutingConfigurationPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerRoutingConfigurationPropertiesFormat deserializedNetworkManagerRoutingConfigurationPropertiesFormat + = new NetworkManagerRoutingConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationPropertiesFormat.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationPropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerRoutingConfigurationPropertiesFormat; + }); + } +} 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..c060ae58393ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfileInner.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Network profile resource. + */ +@Fluent +public final class NetworkProfileInner extends Resource { + /* + * Network profile properties. + */ + private NetworkProfilePropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkProfileInner class. + */ + public NetworkProfileInner() { + } + + /** + * Get the innerProperties property: Network profile properties. + * + * @return the innerProperties value. + */ + private NetworkProfilePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 NetworkProfileInner object itself. + */ + public NetworkProfileInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the containerNetworkInterfaces property: List of child container network interfaces. + * + * @return the containerNetworkInterfaces value. + */ + public List containerNetworkInterfaces() { + return this.innerProperties() == null ? null : this.innerProperties().containerNetworkInterfaces(); + } + + /** + * Get the containerNetworkInterfaceConfigurations property: List of chid container network interface + * configurations. + * + * @return the containerNetworkInterfaceConfigurations value. + */ + public List containerNetworkInterfaceConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkProfilePropertiesFormat(); + } + this.innerProperties().withContainerNetworkInterfaceConfigurations(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the network profile resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfileInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfileInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkProfileInner. + */ + public static NetworkProfileInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfileInner deserializedNetworkProfileInner = new NetworkProfileInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkProfileInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkProfileInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkProfileInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkProfileInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkProfileInner.innerProperties = NetworkProfilePropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedNetworkProfileInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedNetworkProfileInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfileInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfilePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfilePropertiesFormat.java new file mode 100644 index 0000000000000..6297390938652 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkProfilePropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Network profile properties. + */ +@Fluent +public final class NetworkProfilePropertiesFormat implements JsonSerializable { + /* + * List of child container network interfaces. + */ + private List containerNetworkInterfaces; + + /* + * List of chid container network interface configurations. + */ + private List containerNetworkInterfaceConfigurations; + + /* + * The resource GUID property of the network profile resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the network profile resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NetworkProfilePropertiesFormat class. + */ + public NetworkProfilePropertiesFormat() { + } + + /** + * 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 NetworkProfilePropertiesFormat object itself. + */ + public NetworkProfilePropertiesFormat 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("containerNetworkInterfaceConfigurations", + this.containerNetworkInterfaceConfigurations, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfilePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfilePropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkProfilePropertiesFormat. + */ + public static NetworkProfilePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfilePropertiesFormat deserializedNetworkProfilePropertiesFormat + = new NetworkProfilePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerNetworkInterfaces".equals(fieldName)) { + List containerNetworkInterfaces + = reader.readArray(reader1 -> ContainerNetworkInterface.fromJson(reader1)); + deserializedNetworkProfilePropertiesFormat.containerNetworkInterfaces = containerNetworkInterfaces; + } else if ("containerNetworkInterfaceConfigurations".equals(fieldName)) { + List containerNetworkInterfaceConfigurations + = reader.readArray(reader1 -> ContainerNetworkInterfaceConfiguration.fromJson(reader1)); + deserializedNetworkProfilePropertiesFormat.containerNetworkInterfaceConfigurations + = containerNetworkInterfaceConfigurations; + } else if ("resourceGuid".equals(fieldName)) { + deserializedNetworkProfilePropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkProfilePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfilePropertiesFormat; + }); + } +} 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..ebe65f0603336 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * NetworkSecurityGroup resource. + */ +@Fluent +public final class NetworkSecurityGroupInner extends Resource { + /* + * Properties of the network security group. + */ + private NetworkSecurityGroupPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkSecurityGroupInner class. + */ + public NetworkSecurityGroupInner() { + } + + /** + * Get the innerProperties property: Properties of the network security group. + * + * @return the innerProperties value. + */ + private NetworkSecurityGroupPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkSecurityGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkSecurityGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the flushConnection property: When enabled, flows created from Network Security Group connections will be + * re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + * + * @return the flushConnection value. + */ + public Boolean flushConnection() { + return this.innerProperties() == null ? null : this.innerProperties().flushConnection(); + } + + /** + * Set the flushConnection property: When enabled, flows created from Network Security Group connections will be + * re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + * + * @param flushConnection the flushConnection value to set. + * @return the NetworkSecurityGroupInner object itself. + */ + public NetworkSecurityGroupInner withFlushConnection(Boolean flushConnection) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkSecurityGroupPropertiesFormat(); + } + this.innerProperties().withFlushConnection(flushConnection); + return this; + } + + /** + * Get the securityRules property: A collection of security rules of the network security group. + * + * @return the securityRules value. + */ + public List securityRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkSecurityGroupPropertiesFormat(); + } + this.innerProperties().withSecurityRules(securityRules); + return this; + } + + /** + * Get the defaultSecurityRules property: The default security rules of network security group. + * + * @return the defaultSecurityRules value. + */ + public List defaultSecurityRules() { + return this.innerProperties() == null ? null : this.innerProperties().defaultSecurityRules(); + } + + /** + * Get the networkInterfaces property: A collection of references to network interfaces. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.innerProperties() == null ? null : this.innerProperties().networkInterfaces(); + } + + /** + * Get the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + public List subnets() { + return this.innerProperties() == null ? null : this.innerProperties().subnets(); + } + + /** + * Get the flowLogs property: A collection of references to flow log resources. + * + * @return the flowLogs value. + */ + public List flowLogs() { + return this.innerProperties() == null ? null : this.innerProperties().flowLogs(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the network security group resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the network security group resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityGroupInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkSecurityGroupInner. + */ + public static NetworkSecurityGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityGroupInner deserializedNetworkSecurityGroupInner = new NetworkSecurityGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkSecurityGroupInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkSecurityGroupInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkSecurityGroupInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkSecurityGroupInner.innerProperties + = NetworkSecurityGroupPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedNetworkSecurityGroupInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedNetworkSecurityGroupInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityGroupInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupPropertiesFormat.java new file mode 100644 index 0000000000000..e27780aa9173b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkSecurityGroupPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Network Security Group resource. + */ +@Fluent +public final class NetworkSecurityGroupPropertiesFormat + implements JsonSerializable { + /* + * When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. + * Initial enablement will trigger re-evaluation. + */ + private Boolean flushConnection; + + /* + * A collection of security rules of the network security group. + */ + private List securityRules; + + /* + * The default security rules of network security group. + */ + private List defaultSecurityRules; + + /* + * A collection of references to network interfaces. + */ + private List networkInterfaces; + + /* + * A collection of references to subnets. + */ + private List subnets; + + /* + * A collection of references to flow log resources. + */ + private List flowLogs; + + /* + * The resource GUID property of the network security group resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the network security group resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NetworkSecurityGroupPropertiesFormat class. + */ + public NetworkSecurityGroupPropertiesFormat() { + } + + /** + * Get the flushConnection property: When enabled, flows created from Network Security Group connections will be + * re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + * + * @return the flushConnection value. + */ + public Boolean flushConnection() { + return this.flushConnection; + } + + /** + * Set the flushConnection property: When enabled, flows created from Network Security Group connections will be + * re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + * + * @param flushConnection the flushConnection value to set. + * @return the NetworkSecurityGroupPropertiesFormat object itself. + */ + public NetworkSecurityGroupPropertiesFormat withFlushConnection(Boolean flushConnection) { + this.flushConnection = flushConnection; + return this; + } + + /** + * 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 NetworkSecurityGroupPropertiesFormat object itself. + */ + public NetworkSecurityGroupPropertiesFormat 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("flushConnection", this.flushConnection); + jsonWriter.writeArrayField("securityRules", this.securityRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityGroupPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityGroupPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityGroupPropertiesFormat. + */ + public static NetworkSecurityGroupPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityGroupPropertiesFormat deserializedNetworkSecurityGroupPropertiesFormat + = new NetworkSecurityGroupPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("flushConnection".equals(fieldName)) { + deserializedNetworkSecurityGroupPropertiesFormat.flushConnection + = reader.getNullable(JsonReader::getBoolean); + } else if ("securityRules".equals(fieldName)) { + List securityRules + = reader.readArray(reader1 -> SecurityRuleInner.fromJson(reader1)); + deserializedNetworkSecurityGroupPropertiesFormat.securityRules = securityRules; + } else if ("defaultSecurityRules".equals(fieldName)) { + List defaultSecurityRules + = reader.readArray(reader1 -> SecurityRuleInner.fromJson(reader1)); + deserializedNetworkSecurityGroupPropertiesFormat.defaultSecurityRules = defaultSecurityRules; + } else if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> NetworkInterfaceInner.fromJson(reader1)); + deserializedNetworkSecurityGroupPropertiesFormat.networkInterfaces = networkInterfaces; + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> SubnetInner.fromJson(reader1)); + deserializedNetworkSecurityGroupPropertiesFormat.subnets = subnets; + } else if ("flowLogs".equals(fieldName)) { + List flowLogs = reader.readArray(reader1 -> FlowLogInner.fromJson(reader1)); + deserializedNetworkSecurityGroupPropertiesFormat.flowLogs = flowLogs; + } else if ("resourceGuid".equals(fieldName)) { + deserializedNetworkSecurityGroupPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkSecurityGroupPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityGroupPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionInner.java new file mode 100644 index 0000000000000..3a4231f0dd2ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * NetworkVirtualApplianceConnection resource. + */ +@Fluent +public final class NetworkVirtualApplianceConnectionInner extends SubResource { + /* + * Properties of the express route connection. + */ + private NetworkVirtualApplianceConnectionProperties innerProperties; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkVirtualApplianceConnectionInner class. + */ + public NetworkVirtualApplianceConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the express route connection. + * + * @return the innerProperties value. + */ + private NetworkVirtualApplianceConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 NetworkVirtualApplianceConnectionInner object itself. + */ + public NetworkVirtualApplianceConnectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkVirtualApplianceConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Set the name property: The name of the resource. + * + * @param name the name value to set. + * @return the NetworkVirtualApplianceConnectionInner object itself. + */ + public NetworkVirtualApplianceConnectionInner withNamePropertiesName(String name) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualApplianceConnectionProperties(); + } + this.innerProperties().withName(name); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the NetworkVirtualApplianceConnection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the asn property: Network Virtual Appliance ASN. + * + * @return the asn value. + */ + public Long asn() { + return this.innerProperties() == null ? null : this.innerProperties().asn(); + } + + /** + * Set the asn property: Network Virtual Appliance ASN. + * + * @param asn the asn value to set. + * @return the NetworkVirtualApplianceConnectionInner object itself. + */ + public NetworkVirtualApplianceConnectionInner withAsn(Long asn) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualApplianceConnectionProperties(); + } + this.innerProperties().withAsn(asn); + return this; + } + + /** + * Get the tunnelIdentifier property: Unique identifier for the connection. + * + * @return the tunnelIdentifier value. + */ + public Long tunnelIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().tunnelIdentifier(); + } + + /** + * Set the tunnelIdentifier property: Unique identifier for the connection. + * + * @param tunnelIdentifier the tunnelIdentifier value to set. + * @return the NetworkVirtualApplianceConnectionInner object itself. + */ + public NetworkVirtualApplianceConnectionInner withTunnelIdentifier(Long tunnelIdentifier) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualApplianceConnectionProperties(); + } + this.innerProperties().withTunnelIdentifier(tunnelIdentifier); + return this; + } + + /** + * Get the bgpPeerAddress property: List of bgpPeerAddresses for the NVA instances. + * + * @return the bgpPeerAddress value. + */ + public List bgpPeerAddress() { + return this.innerProperties() == null ? null : this.innerProperties().bgpPeerAddress(); + } + + /** + * Set the bgpPeerAddress property: List of bgpPeerAddresses for the NVA instances. + * + * @param bgpPeerAddress the bgpPeerAddress value to set. + * @return the NetworkVirtualApplianceConnectionInner object itself. + */ + public NetworkVirtualApplianceConnectionInner withBgpPeerAddress(List bgpPeerAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualApplianceConnectionProperties(); + } + this.innerProperties().withBgpPeerAddress(bgpPeerAddress); + return this; + } + + /** + * Get the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.innerProperties() == null ? null : this.innerProperties().enableInternetSecurity(); + } + + /** + * Set the enableInternetSecurity property: Enable internet security. + * + * @param enableInternetSecurity the enableInternetSecurity value to set. + * @return the NetworkVirtualApplianceConnectionInner object itself. + */ + public NetworkVirtualApplianceConnectionInner withEnableInternetSecurity(Boolean enableInternetSecurity) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualApplianceConnectionProperties(); + } + this.innerProperties().withEnableInternetSecurity(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.innerProperties() == null ? null : this.innerProperties().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 NetworkVirtualApplianceConnectionInner object itself. + */ + public NetworkVirtualApplianceConnectionInner withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualApplianceConnectionProperties(); + } + this.innerProperties().withRoutingConfiguration(routingConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceConnectionInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceConnectionInner. + */ + public static NetworkVirtualApplianceConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceConnectionInner deserializedNetworkVirtualApplianceConnectionInner + = new NetworkVirtualApplianceConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionInner.innerProperties + = NetworkVirtualApplianceConnectionProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionInner.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionProperties.java new file mode 100644 index 0000000000000..f8fd9a7a6d8fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceConnectionProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the NetworkVirtualApplianceConnection subresource. + */ +@Fluent +public final class NetworkVirtualApplianceConnectionProperties + implements JsonSerializable { + /* + * The name of the resource. + */ + private String name; + + /* + * The provisioning state of the NetworkVirtualApplianceConnection resource. + */ + private ProvisioningState provisioningState; + + /* + * Network Virtual Appliance ASN. + */ + private Long asn; + + /* + * Unique identifier for the connection. + */ + private Long tunnelIdentifier; + + /* + * List of bgpPeerAddresses for the NVA instances + */ + private List bgpPeerAddress; + + /* + * Enable internet security. + */ + private Boolean enableInternetSecurity; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + private RoutingConfiguration routingConfiguration; + + /** + * Creates an instance of NetworkVirtualApplianceConnectionProperties class. + */ + public NetworkVirtualApplianceConnectionProperties() { + } + + /** + * 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 NetworkVirtualApplianceConnectionProperties object itself. + */ + public NetworkVirtualApplianceConnectionProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the NetworkVirtualApplianceConnection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the asn property: Network Virtual Appliance ASN. + * + * @return the asn value. + */ + public Long asn() { + return this.asn; + } + + /** + * Set the asn property: Network Virtual Appliance ASN. + * + * @param asn the asn value to set. + * @return the NetworkVirtualApplianceConnectionProperties object itself. + */ + public NetworkVirtualApplianceConnectionProperties withAsn(Long asn) { + this.asn = asn; + return this; + } + + /** + * Get the tunnelIdentifier property: Unique identifier for the connection. + * + * @return the tunnelIdentifier value. + */ + public Long tunnelIdentifier() { + return this.tunnelIdentifier; + } + + /** + * Set the tunnelIdentifier property: Unique identifier for the connection. + * + * @param tunnelIdentifier the tunnelIdentifier value to set. + * @return the NetworkVirtualApplianceConnectionProperties object itself. + */ + public NetworkVirtualApplianceConnectionProperties withTunnelIdentifier(Long tunnelIdentifier) { + this.tunnelIdentifier = tunnelIdentifier; + return this; + } + + /** + * Get the bgpPeerAddress property: List of bgpPeerAddresses for the NVA instances. + * + * @return the bgpPeerAddress value. + */ + public List bgpPeerAddress() { + return this.bgpPeerAddress; + } + + /** + * Set the bgpPeerAddress property: List of bgpPeerAddresses for the NVA instances. + * + * @param bgpPeerAddress the bgpPeerAddress value to set. + * @return the NetworkVirtualApplianceConnectionProperties object itself. + */ + public NetworkVirtualApplianceConnectionProperties withBgpPeerAddress(List bgpPeerAddress) { + this.bgpPeerAddress = bgpPeerAddress; + 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 NetworkVirtualApplianceConnectionProperties object itself. + */ + public NetworkVirtualApplianceConnectionProperties 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 NetworkVirtualApplianceConnectionProperties object itself. + */ + public NetworkVirtualApplianceConnectionProperties + withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + this.routingConfiguration = routingConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("asn", this.asn); + jsonWriter.writeNumberField("tunnelIdentifier", this.tunnelIdentifier); + jsonWriter.writeArrayField("bgpPeerAddress", this.bgpPeerAddress, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableInternetSecurity", this.enableInternetSecurity); + jsonWriter.writeJsonField("routingConfiguration", this.routingConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceConnectionProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceConnectionProperties. + */ + public static NetworkVirtualApplianceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceConnectionProperties deserializedNetworkVirtualApplianceConnectionProperties + = new NetworkVirtualApplianceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionProperties.name = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("asn".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionProperties.asn + = reader.getNullable(JsonReader::getLong); + } else if ("tunnelIdentifier".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionProperties.tunnelIdentifier + = reader.getNullable(JsonReader::getLong); + } else if ("bgpPeerAddress".equals(fieldName)) { + List bgpPeerAddress = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkVirtualApplianceConnectionProperties.bgpPeerAddress = bgpPeerAddress; + } else if ("enableInternetSecurity".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionProperties.enableInternetSecurity + = reader.getNullable(JsonReader::getBoolean); + } else if ("routingConfiguration".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionProperties.routingConfiguration + = RoutingConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceConnectionProperties; + }); + } +} 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..4b65ab0ce103a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInner.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.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.InternetIngressPublicIpsProperties; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliancePropertiesFormatNetworkProfile; +import com.azure.resourcemanager.network.generated.models.PartnerManagedResourceProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceAdditionalNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * NetworkVirtualAppliance Resource. + */ +@Fluent +public final class NetworkVirtualApplianceInner extends Resource { + /* + * Properties of the Network Virtual Appliance. + */ + private NetworkVirtualAppliancePropertiesFormat innerProperties; + + /* + * The service principal that has read access to cloud-init and config blob. + */ + private ManagedServiceIdentity identity; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkVirtualApplianceInner class. + */ + public NetworkVirtualApplianceInner() { + } + + /** + * Get the innerProperties property: Properties of the Network Virtual Appliance. + * + * @return the innerProperties value. + */ + private NetworkVirtualAppliancePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkVirtualApplianceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkVirtualApplianceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the nvaSku property: Network Virtual Appliance SKU. + * + * @return the nvaSku value. + */ + public VirtualApplianceSkuProperties nvaSku() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withNvaSku(nvaSku); + return this; + } + + /** + * Get the addressPrefix property: Address Prefix. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); + } + + /** + * Get the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs. + * + * @return the bootStrapConfigurationBlobs value. + */ + public List bootStrapConfigurationBlobs() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withBootStrapConfigurationBlobs(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withVirtualHub(virtualHub); + return this; + } + + /** + * Get the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs. + * + * @return the cloudInitConfigurationBlobs value. + */ + public List cloudInitConfigurationBlobs() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withCloudInitConfigurationBlobs(cloudInitConfigurationBlobs); + return this; + } + + /** + * Get the cloudInitConfiguration property: CloudInitConfiguration string in plain text. + * + * @return the cloudInitConfiguration value. + */ + public String cloudInitConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withCloudInitConfiguration(cloudInitConfiguration); + return this; + } + + /** + * Get the virtualApplianceAsn property: VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are + * not supported. + * + * @return the virtualApplianceAsn value. + */ + public Long virtualApplianceAsn() { + return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceAsn(); + } + + /** + * Set the virtualApplianceAsn property: VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are + * not supported. + * + * @param virtualApplianceAsn the virtualApplianceAsn value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withVirtualApplianceAsn(Long virtualApplianceAsn) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withVirtualApplianceAsn(virtualApplianceAsn); + return this; + } + + /** + * Get the sshPublicKey property: Public key for SSH login. + * + * @return the sshPublicKey value. + */ + public String sshPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().sshPublicKey(); + } + + /** + * Set the sshPublicKey property: Public key for SSH login. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withSshPublicKey(String sshPublicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withSshPublicKey(sshPublicKey); + return this; + } + + /** + * Get the virtualApplianceNics property: List of Virtual Appliance Network Interfaces. + * + * @return the virtualApplianceNics value. + */ + public List virtualApplianceNics() { + return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceNics(); + } + + /** + * Get the networkProfile property: Network Profile containing configurations for Public and Private NIC. + * + * @return the networkProfile value. + */ + public NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: Network Profile containing configurations for Public and Private NIC. + * + * @param networkProfile the networkProfile value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner + withNetworkProfile(NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the additionalNics property: Details required for Additional Network Interface. + * + * @return the additionalNics value. + */ + public List additionalNics() { + return this.innerProperties() == null ? null : this.innerProperties().additionalNics(); + } + + /** + * Set the additionalNics property: Details required for Additional Network Interface. + * + * @param additionalNics the additionalNics value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner + withAdditionalNics(List additionalNics) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withAdditionalNics(additionalNics); + return this; + } + + /** + * Get the internetIngressPublicIps property: List of Resource Uri of Public IPs for Internet Ingress Scenario. + * + * @return the internetIngressPublicIps value. + */ + public List internetIngressPublicIps() { + return this.innerProperties() == null ? null : this.innerProperties().internetIngressPublicIps(); + } + + /** + * Set the internetIngressPublicIps property: List of Resource Uri of Public IPs for Internet Ingress Scenario. + * + * @param internetIngressPublicIps the internetIngressPublicIps value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner + withInternetIngressPublicIps(List internetIngressPublicIps) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withInternetIngressPublicIps(internetIngressPublicIps); + return this; + } + + /** + * Get the virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + public List virtualApplianceSites() { + return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceSites(); + } + + /** + * Get the virtualApplianceConnections property: List of references to VirtualApplianceConnections. + * + * @return the virtualApplianceConnections value. + */ + public List virtualApplianceConnections() { + return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceConnections(); + } + + /** + * Get the inboundSecurityRules property: List of references to InboundSecurityRules. + * + * @return the inboundSecurityRules value. + */ + public List inboundSecurityRules() { + return this.innerProperties() == null ? null : this.innerProperties().inboundSecurityRules(); + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentType property: The deployment type. PartnerManaged for the SaaS NVA. + * + * @return the deploymentType value. + */ + public String deploymentType() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentType(); + } + + /** + * Get the delegation property: The delegation for the Virtual Appliance. + * + * @return the delegation value. + */ + public DelegationProperties delegation() { + return this.innerProperties() == null ? null : this.innerProperties().delegation(); + } + + /** + * Set the delegation property: The delegation for the Virtual Appliance. + * + * @param delegation the delegation value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner withDelegation(DelegationProperties delegation) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withDelegation(delegation); + return this; + } + + /** + * Get the partnerManagedResource property: The delegation for the Virtual Appliance. + * + * @return the partnerManagedResource value. + */ + public PartnerManagedResourceProperties partnerManagedResource() { + return this.innerProperties() == null ? null : this.innerProperties().partnerManagedResource(); + } + + /** + * Set the partnerManagedResource property: The delegation for the Virtual Appliance. + * + * @param partnerManagedResource the partnerManagedResource value to set. + * @return the NetworkVirtualApplianceInner object itself. + */ + public NetworkVirtualApplianceInner + withPartnerManagedResource(PartnerManagedResourceProperties partnerManagedResource) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualAppliancePropertiesFormat(); + } + this.innerProperties().withPartnerManagedResource(partnerManagedResource); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceInner. + */ + public static NetworkVirtualApplianceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceInner deserializedNetworkVirtualApplianceInner = new NetworkVirtualApplianceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkVirtualApplianceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkVirtualApplianceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkVirtualApplianceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkVirtualApplianceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkVirtualApplianceInner.innerProperties + = NetworkVirtualAppliancePropertiesFormat.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedNetworkVirtualApplianceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedNetworkVirtualApplianceInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedNetworkVirtualApplianceInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInstanceIdsInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInstanceIdsInner.java new file mode 100644 index 0000000000000..932c4ae443e3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceInstanceIdsInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ +@Fluent +public final class NetworkVirtualApplianceInstanceIdsInner + implements JsonSerializable { + /* + * The network virtual appliance instance ids. Omitting the network virtual appliance instance ids will result in + * the operation being performed on all virtual machines belonging to the network virtual appliance. + */ + private List instanceIds; + + /** + * Creates an instance of NetworkVirtualApplianceInstanceIdsInner class. + */ + public NetworkVirtualApplianceInstanceIdsInner() { + } + + /** + * Get the instanceIds property: The network virtual appliance instance ids. Omitting the network virtual appliance + * instance ids will result in the operation being performed on all virtual machines belonging to the network + * virtual appliance. + * + * @return the instanceIds value. + */ + public List instanceIds() { + return this.instanceIds; + } + + /** + * Set the instanceIds property: The network virtual appliance instance ids. Omitting the network virtual appliance + * instance ids will result in the operation being performed on all virtual machines belonging to the network + * virtual appliance. + * + * @param instanceIds the instanceIds value to set. + * @return the NetworkVirtualApplianceInstanceIdsInner object itself. + */ + public NetworkVirtualApplianceInstanceIdsInner withInstanceIds(List instanceIds) { + this.instanceIds = instanceIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("instanceIds", this.instanceIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceInstanceIdsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceInstanceIdsInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceInstanceIdsInner. + */ + public static NetworkVirtualApplianceInstanceIdsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceInstanceIdsInner deserializedNetworkVirtualApplianceInstanceIdsInner + = new NetworkVirtualApplianceInstanceIdsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("instanceIds".equals(fieldName)) { + List instanceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkVirtualApplianceInstanceIdsInner.instanceIds = instanceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceInstanceIdsInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualAppliancePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualAppliancePropertiesFormat.java new file mode 100644 index 0000000000000..75d85715b8502 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualAppliancePropertiesFormat.java @@ -0,0 +1,581 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.InternetIngressPublicIpsProperties; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliancePropertiesFormatNetworkProfile; +import com.azure.resourcemanager.network.generated.models.PartnerManagedResourceProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceAdditionalNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import java.io.IOException; +import java.util.List; + +/** + * Network Virtual Appliance definition. + */ +@Fluent +public final class NetworkVirtualAppliancePropertiesFormat + implements JsonSerializable { + /* + * Network Virtual Appliance SKU. + */ + private VirtualApplianceSkuProperties nvaSku; + + /* + * Address Prefix. + */ + private String addressPrefix; + + /* + * BootStrapConfigurationBlobs storage URLs. + */ + private List bootStrapConfigurationBlobs; + + /* + * The Virtual Hub where Network Virtual Appliance is being deployed. + */ + private SubResource virtualHub; + + /* + * CloudInitConfigurationBlob storage URLs. + */ + private List cloudInitConfigurationBlobs; + + /* + * CloudInitConfiguration string in plain text. + */ + private String cloudInitConfiguration; + + /* + * VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not supported. + */ + private Long virtualApplianceAsn; + + /* + * Public key for SSH login. + */ + private String sshPublicKey; + + /* + * List of Virtual Appliance Network Interfaces. + */ + private List virtualApplianceNics; + + /* + * Network Profile containing configurations for Public and Private NIC. + */ + private NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile; + + /* + * Details required for Additional Network Interface. + */ + private List additionalNics; + + /* + * List of Resource Uri of Public IPs for Internet Ingress Scenario. + */ + private List internetIngressPublicIps; + + /* + * List of references to VirtualApplianceSite. + */ + private List virtualApplianceSites; + + /* + * List of references to VirtualApplianceConnections. + */ + private List virtualApplianceConnections; + + /* + * List of references to InboundSecurityRules. + */ + private List inboundSecurityRules; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * The deployment type. PartnerManaged for the SaaS NVA + */ + private String deploymentType; + + /* + * The delegation for the Virtual Appliance + */ + private DelegationProperties delegation; + + /* + * The delegation for the Virtual Appliance + */ + private PartnerManagedResourceProperties partnerManagedResource; + + /** + * Creates an instance of NetworkVirtualAppliancePropertiesFormat class. + */ + public NetworkVirtualAppliancePropertiesFormat() { + } + + /** + * 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 NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat 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 NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat + 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 NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat 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 NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat + 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 NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat withCloudInitConfiguration(String cloudInitConfiguration) { + this.cloudInitConfiguration = cloudInitConfiguration; + return this; + } + + /** + * Get the virtualApplianceAsn property: VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are + * not supported. + * + * @return the virtualApplianceAsn value. + */ + public Long virtualApplianceAsn() { + return this.virtualApplianceAsn; + } + + /** + * Set the virtualApplianceAsn property: VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are + * not supported. + * + * @param virtualApplianceAsn the virtualApplianceAsn value to set. + * @return the NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat withVirtualApplianceAsn(Long virtualApplianceAsn) { + this.virtualApplianceAsn = virtualApplianceAsn; + return this; + } + + /** + * Get the sshPublicKey property: Public key for SSH login. + * + * @return the sshPublicKey value. + */ + public String sshPublicKey() { + return this.sshPublicKey; + } + + /** + * Set the sshPublicKey property: Public key for SSH login. + * + * @param sshPublicKey the sshPublicKey value to set. + * @return the NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat withSshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + return this; + } + + /** + * Get the virtualApplianceNics property: List of Virtual Appliance Network Interfaces. + * + * @return the virtualApplianceNics value. + */ + public List virtualApplianceNics() { + return this.virtualApplianceNics; + } + + /** + * Get the networkProfile property: Network Profile containing configurations for Public and Private NIC. + * + * @return the networkProfile value. + */ + public NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network Profile containing configurations for Public and Private NIC. + * + * @param networkProfile the networkProfile value to set. + * @return the NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat + withNetworkProfile(NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the additionalNics property: Details required for Additional Network Interface. + * + * @return the additionalNics value. + */ + public List additionalNics() { + return this.additionalNics; + } + + /** + * Set the additionalNics property: Details required for Additional Network Interface. + * + * @param additionalNics the additionalNics value to set. + * @return the NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat + withAdditionalNics(List additionalNics) { + this.additionalNics = additionalNics; + return this; + } + + /** + * Get the internetIngressPublicIps property: List of Resource Uri of Public IPs for Internet Ingress Scenario. + * + * @return the internetIngressPublicIps value. + */ + public List internetIngressPublicIps() { + return this.internetIngressPublicIps; + } + + /** + * Set the internetIngressPublicIps property: List of Resource Uri of Public IPs for Internet Ingress Scenario. + * + * @param internetIngressPublicIps the internetIngressPublicIps value to set. + * @return the NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat + withInternetIngressPublicIps(List internetIngressPublicIps) { + this.internetIngressPublicIps = internetIngressPublicIps; + return this; + } + + /** + * Get the virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + public List virtualApplianceSites() { + return this.virtualApplianceSites; + } + + /** + * Get the virtualApplianceConnections property: List of references to VirtualApplianceConnections. + * + * @return the virtualApplianceConnections value. + */ + public List virtualApplianceConnections() { + return this.virtualApplianceConnections; + } + + /** + * 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 deploymentType property: The deployment type. PartnerManaged for the SaaS NVA. + * + * @return the deploymentType value. + */ + public String deploymentType() { + return this.deploymentType; + } + + /** + * Get the delegation property: The delegation for the Virtual Appliance. + * + * @return the delegation value. + */ + public DelegationProperties delegation() { + return this.delegation; + } + + /** + * Set the delegation property: The delegation for the Virtual Appliance. + * + * @param delegation the delegation value to set. + * @return the NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat withDelegation(DelegationProperties delegation) { + this.delegation = delegation; + return this; + } + + /** + * Get the partnerManagedResource property: The delegation for the Virtual Appliance. + * + * @return the partnerManagedResource value. + */ + public PartnerManagedResourceProperties partnerManagedResource() { + return this.partnerManagedResource; + } + + /** + * Set the partnerManagedResource property: The delegation for the Virtual Appliance. + * + * @param partnerManagedResource the partnerManagedResource value to set. + * @return the NetworkVirtualAppliancePropertiesFormat object itself. + */ + public NetworkVirtualAppliancePropertiesFormat + withPartnerManagedResource(PartnerManagedResourceProperties partnerManagedResource) { + this.partnerManagedResource = partnerManagedResource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nvaSku() != null) { + nvaSku().validate(); + } + if (virtualApplianceNics() != null) { + virtualApplianceNics().forEach(e -> e.validate()); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (additionalNics() != null) { + additionalNics().forEach(e -> e.validate()); + } + if (internetIngressPublicIps() != null) { + internetIngressPublicIps().forEach(e -> e.validate()); + } + if (delegation() != null) { + delegation().validate(); + } + if (partnerManagedResource() != null) { + partnerManagedResource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("nvaSku", this.nvaSku); + jsonWriter.writeArrayField("bootStrapConfigurationBlobs", this.bootStrapConfigurationBlobs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("virtualHub", this.virtualHub); + jsonWriter.writeArrayField("cloudInitConfigurationBlobs", this.cloudInitConfigurationBlobs, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("cloudInitConfiguration", this.cloudInitConfiguration); + jsonWriter.writeNumberField("virtualApplianceAsn", this.virtualApplianceAsn); + jsonWriter.writeStringField("sshPublicKey", this.sshPublicKey); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeArrayField("additionalNics", this.additionalNics, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("internetIngressPublicIps", this.internetIngressPublicIps, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("delegation", this.delegation); + jsonWriter.writeJsonField("partnerManagedResource", this.partnerManagedResource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualAppliancePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualAppliancePropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualAppliancePropertiesFormat. + */ + public static NetworkVirtualAppliancePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualAppliancePropertiesFormat deserializedNetworkVirtualAppliancePropertiesFormat + = new NetworkVirtualAppliancePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nvaSku".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.nvaSku + = VirtualApplianceSkuProperties.fromJson(reader); + } else if ("addressPrefix".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.addressPrefix = reader.getString(); + } else if ("bootStrapConfigurationBlobs".equals(fieldName)) { + List bootStrapConfigurationBlobs = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkVirtualAppliancePropertiesFormat.bootStrapConfigurationBlobs + = bootStrapConfigurationBlobs; + } else if ("virtualHub".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.virtualHub = SubResource.fromJson(reader); + } else if ("cloudInitConfigurationBlobs".equals(fieldName)) { + List cloudInitConfigurationBlobs = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkVirtualAppliancePropertiesFormat.cloudInitConfigurationBlobs + = cloudInitConfigurationBlobs; + } else if ("cloudInitConfiguration".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.cloudInitConfiguration = reader.getString(); + } else if ("virtualApplianceAsn".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.virtualApplianceAsn + = reader.getNullable(JsonReader::getLong); + } else if ("sshPublicKey".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.sshPublicKey = reader.getString(); + } else if ("virtualApplianceNics".equals(fieldName)) { + List virtualApplianceNics + = reader.readArray(reader1 -> VirtualApplianceNicProperties.fromJson(reader1)); + deserializedNetworkVirtualAppliancePropertiesFormat.virtualApplianceNics = virtualApplianceNics; + } else if ("networkProfile".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.networkProfile + = NetworkVirtualAppliancePropertiesFormatNetworkProfile.fromJson(reader); + } else if ("additionalNics".equals(fieldName)) { + List additionalNics + = reader.readArray(reader1 -> VirtualApplianceAdditionalNicProperties.fromJson(reader1)); + deserializedNetworkVirtualAppliancePropertiesFormat.additionalNics = additionalNics; + } else if ("internetIngressPublicIps".equals(fieldName)) { + List internetIngressPublicIps + = reader.readArray(reader1 -> InternetIngressPublicIpsProperties.fromJson(reader1)); + deserializedNetworkVirtualAppliancePropertiesFormat.internetIngressPublicIps + = internetIngressPublicIps; + } else if ("virtualApplianceSites".equals(fieldName)) { + List virtualApplianceSites + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedNetworkVirtualAppliancePropertiesFormat.virtualApplianceSites = virtualApplianceSites; + } else if ("virtualApplianceConnections".equals(fieldName)) { + List virtualApplianceConnections + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedNetworkVirtualAppliancePropertiesFormat.virtualApplianceConnections + = virtualApplianceConnections; + } else if ("inboundSecurityRules".equals(fieldName)) { + List inboundSecurityRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedNetworkVirtualAppliancePropertiesFormat.inboundSecurityRules = inboundSecurityRules; + } else if ("provisioningState".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("deploymentType".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.deploymentType = reader.getString(); + } else if ("delegation".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.delegation + = DelegationProperties.fromJson(reader); + } else if ("partnerManagedResource".equals(fieldName)) { + deserializedNetworkVirtualAppliancePropertiesFormat.partnerManagedResource + = PartnerManagedResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualAppliancePropertiesFormat; + }); + } +} 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..f29820334ac1f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Available NetworkVirtualApplianceSkus + * + * Definition of the NetworkVirtualApplianceSkus resource. + */ +@Fluent +public final class NetworkVirtualApplianceSkuInner extends Resource { + /* + * NetworkVirtualApplianceSku properties. + */ + private NetworkVirtualApplianceSkuPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkVirtualApplianceSkuInner class. + */ + public NetworkVirtualApplianceSkuInner() { + } + + /** + * Get the innerProperties property: NetworkVirtualApplianceSku properties. + * + * @return the innerProperties value. + */ + private NetworkVirtualApplianceSkuPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 NetworkVirtualApplianceSkuInner object itself. + */ + public NetworkVirtualApplianceSkuInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkVirtualApplianceSkuInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkVirtualApplianceSkuInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the vendor property: Network Virtual Appliance Sku vendor. + * + * @return the vendor value. + */ + public String vendor() { + return this.innerProperties() == null ? null : this.innerProperties().vendor(); + } + + /** + * Get the availableVersions property: Available Network Virtual Appliance versions. + * + * @return the availableVersions value. + */ + public List availableVersions() { + return this.innerProperties() == null ? null : this.innerProperties().availableVersions(); + } + + /** + * Get the availableScaleUnits property: The list of scale units available. + * + * @return the availableScaleUnits value. + */ + public List availableScaleUnits() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkVirtualApplianceSkuPropertiesFormat(); + } + this.innerProperties().withAvailableScaleUnits(availableScaleUnits); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceSkuInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceSkuInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceSkuInner. + */ + public static NetworkVirtualApplianceSkuInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceSkuInner deserializedNetworkVirtualApplianceSkuInner + = new NetworkVirtualApplianceSkuInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkVirtualApplianceSkuInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInner.innerProperties + = NetworkVirtualApplianceSkuPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceSkuInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuPropertiesFormat.java new file mode 100644 index 0000000000000..7bfa303139ea9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkVirtualApplianceSkuPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceSkuInstances; +import java.io.IOException; +import java.util.List; + +/** + * Network Virtual Appliance Sku Properties + * + * Properties specific to NetworkVirtualApplianceSkus. + */ +@Fluent +public final class NetworkVirtualApplianceSkuPropertiesFormat + implements JsonSerializable { + /* + * Network Virtual Appliance Sku vendor. + */ + private String vendor; + + /* + * Available Network Virtual Appliance versions. + */ + private List availableVersions; + + /* + * The list of scale units available. + */ + private List availableScaleUnits; + + /** + * Creates an instance of NetworkVirtualApplianceSkuPropertiesFormat class. + */ + public NetworkVirtualApplianceSkuPropertiesFormat() { + } + + /** + * 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 NetworkVirtualApplianceSkuPropertiesFormat object itself. + */ + public NetworkVirtualApplianceSkuPropertiesFormat + withAvailableScaleUnits(List availableScaleUnits) { + this.availableScaleUnits = availableScaleUnits; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("availableScaleUnits", this.availableScaleUnits, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceSkuPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceSkuPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceSkuPropertiesFormat. + */ + public static NetworkVirtualApplianceSkuPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceSkuPropertiesFormat deserializedNetworkVirtualApplianceSkuPropertiesFormat + = new NetworkVirtualApplianceSkuPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vendor".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuPropertiesFormat.vendor = reader.getString(); + } else if ("availableVersions".equals(fieldName)) { + List availableVersions = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkVirtualApplianceSkuPropertiesFormat.availableVersions = availableVersions; + } else if ("availableScaleUnits".equals(fieldName)) { + List availableScaleUnits + = reader.readArray(reader1 -> NetworkVirtualApplianceSkuInstances.fromJson(reader1)); + deserializedNetworkVirtualApplianceSkuPropertiesFormat.availableScaleUnits = availableScaleUnits; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceSkuPropertiesFormat; + }); + } +} 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..c956394783749 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherInner.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.Map; + +/** + * Network watcher in a resource group. + */ +@Fluent +public final class NetworkWatcherInner extends Resource { + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Properties of the network watcher. + */ + private NetworkWatcherPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkWatcherInner class. + */ + public NetworkWatcherInner() { + } + + /** + * 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 innerProperties property: Properties of the network watcher. + * + * @return the innerProperties value. + */ + private NetworkWatcherPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkWatcherInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public NetworkWatcherInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the network watcher resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkWatcherInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkWatcherInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkWatcherInner. + */ + public static NetworkWatcherInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkWatcherInner deserializedNetworkWatcherInner = new NetworkWatcherInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkWatcherInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkWatcherInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkWatcherInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkWatcherInner.withTags(tags); + } else if ("etag".equals(fieldName)) { + deserializedNetworkWatcherInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkWatcherInner.innerProperties = NetworkWatcherPropertiesFormat.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedNetworkWatcherInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkWatcherInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherPropertiesFormat.java new file mode 100644 index 0000000000000..64603c98bf8b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NetworkWatcherPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * The network watcher properties. + */ +@Immutable +public final class NetworkWatcherPropertiesFormat implements JsonSerializable { + /* + * The provisioning state of the network watcher resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of NetworkWatcherPropertiesFormat class. + */ + public NetworkWatcherPropertiesFormat() { + } + + /** + * Get the provisioningState property: The provisioning state of the network watcher 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkWatcherPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkWatcherPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkWatcherPropertiesFormat. + */ + public static NetworkWatcherPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkWatcherPropertiesFormat deserializedNetworkWatcherPropertiesFormat + = new NetworkWatcherPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNetworkWatcherPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkWatcherPropertiesFormat; + }); + } +} 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..74c39dc79fddc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/NextHopResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NextHopType; +import java.io.IOException; + +/** + * The information about next hop from the specified VM. + */ +@Fluent +public final class NextHopResultInner implements JsonSerializable { + /* + * Next hop type. + */ + private NextHopType nextHopType; + + /* + * Next hop IP Address. + */ + 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'. + */ + private String routeTableId; + + /** + * Creates an instance of NextHopResultInner class. + */ + public NextHopResultInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextHopType", this.nextHopType == null ? null : this.nextHopType.toString()); + jsonWriter.writeStringField("nextHopIpAddress", this.nextHopIpAddress); + jsonWriter.writeStringField("routeTableId", this.routeTableId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NextHopResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NextHopResultInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NextHopResultInner. + */ + public static NextHopResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NextHopResultInner deserializedNextHopResultInner = new NextHopResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextHopType".equals(fieldName)) { + deserializedNextHopResultInner.nextHopType = NextHopType.fromString(reader.getString()); + } else if ("nextHopIpAddress".equals(fieldName)) { + deserializedNextHopResultInner.nextHopIpAddress = reader.getString(); + } else if ("routeTableId".equals(fieldName)) { + deserializedNextHopResultInner.routeTableId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNextHopResultInner; + }); + } +} 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..93ac7b26727ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.OperationDisplay; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; +import java.io.IOException; + +/** + * Network REST API operation definition. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * Operation name: {provider}/{resource}/{operation}. + */ + private String name; + + /* + * Display metadata associated with the operation. + */ + private OperationDisplay display; + + /* + * Origin of the operation. + */ + private String origin; + + /* + * Operation properties format. + */ + private OperationPropertiesFormat innerProperties; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * 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 innerProperties property: Operation properties format. + * + * @return the innerProperties value. + */ + private OperationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the serviceSpecification property: Specification of the service. + * + * @return the serviceSpecification value. + */ + public OperationPropertiesFormatServiceSpecification serviceSpecification() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OperationPropertiesFormat(); + } + this.innerProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOperationInner.innerProperties = OperationPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationPropertiesFormat.java new file mode 100644 index 0000000000000..e6b14fa1a4ea8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OperationPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.OperationPropertiesFormatServiceSpecification; +import java.io.IOException; + +/** + * Description of operation properties format. + */ +@Fluent +public final class OperationPropertiesFormat implements JsonSerializable { + /* + * Specification of the service. + */ + private OperationPropertiesFormatServiceSpecification serviceSpecification; + + /** + * Creates an instance of OperationPropertiesFormat class. + */ + public OperationPropertiesFormat() { + } + + /** + * 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 OperationPropertiesFormat object itself. + */ + public OperationPropertiesFormat + withServiceSpecification(OperationPropertiesFormatServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationPropertiesFormat if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationPropertiesFormat. + */ + public static OperationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationPropertiesFormat deserializedOperationPropertiesFormat = new OperationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationPropertiesFormat.serviceSpecification + = OperationPropertiesFormatServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationPropertiesFormat; + }); + } +} 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..da890575940e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRuleInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Outbound rule of the load balancer. + */ +@Fluent +public final class OutboundRuleInner extends SubResource { + /* + * Properties of load balancer outbound rule. + */ + private OutboundRulePropertiesFormat innerProperties; + + /* + * 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. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of OutboundRuleInner class. + */ + public OutboundRuleInner() { + } + + /** + * Get the innerProperties property: Properties of load balancer outbound rule. + * + * @return the innerProperties value. + */ + private OutboundRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public OutboundRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the allocatedOutboundPorts property: The number of outbound ports to be used for NAT. + * + * @return the allocatedOutboundPorts value. + */ + public Integer allocatedOutboundPorts() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OutboundRulePropertiesFormat(); + } + this.innerProperties().withAllocatedOutboundPorts(allocatedOutboundPorts); + return this; + } + + /** + * Get the frontendIpConfigurations property: The Frontend IP addresses of the load balancer. + * + * @return the frontendIpConfigurations value. + */ + public List frontendIpConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OutboundRulePropertiesFormat(); + } + this.innerProperties().withFrontendIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OutboundRulePropertiesFormat(); + } + this.innerProperties().withBackendAddressPool(backendAddressPool); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the outbound rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the protocol property: The protocol for the outbound rule in load balancer. + * + * @return the protocol value. + */ + public LoadBalancerOutboundRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OutboundRulePropertiesFormat(); + } + this.innerProperties().withProtocol(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OutboundRulePropertiesFormat(); + } + this.innerProperties().withEnableTcpReset(enableTcpReset); + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The timeout for the TCP idle connection. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OutboundRulePropertiesFormat(); + } + this.innerProperties().withIdleTimeoutInMinutes(idleTimeoutInMinutes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRuleInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OutboundRuleInner. + */ + public static OutboundRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRuleInner deserializedOutboundRuleInner = new OutboundRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOutboundRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedOutboundRuleInner.innerProperties = OutboundRulePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedOutboundRuleInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedOutboundRuleInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOutboundRuleInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRulePropertiesFormat.java new file mode 100644 index 0000000000000..bd7705bcf9699 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/OutboundRulePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Outbound rule of the load balancer. + */ +@Fluent +public final class OutboundRulePropertiesFormat implements JsonSerializable { + /* + * The number of outbound ports to be used for NAT. + */ + private Integer allocatedOutboundPorts; + + /* + * The Frontend IP addresses of the load balancer. + */ + private List frontendIpConfigurations; + + /* + * A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. + */ + private SubResource backendAddressPool; + + /* + * The provisioning state of the outbound rule resource. + */ + private ProvisioningState provisioningState; + + /* + * The protocol for the outbound rule in load balancer. + */ + 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. + */ + private Boolean enableTcpReset; + + /* + * The timeout for the TCP idle connection. + */ + private Integer idleTimeoutInMinutes; + + /** + * Creates an instance of OutboundRulePropertiesFormat class. + */ + public OutboundRulePropertiesFormat() { + } + + /** + * 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 OutboundRulePropertiesFormat object itself. + */ + public OutboundRulePropertiesFormat 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 OutboundRulePropertiesFormat object itself. + */ + public OutboundRulePropertiesFormat 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 OutboundRulePropertiesFormat object itself. + */ + public OutboundRulePropertiesFormat 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 OutboundRulePropertiesFormat object itself. + */ + public OutboundRulePropertiesFormat 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 OutboundRulePropertiesFormat object itself. + */ + public OutboundRulePropertiesFormat 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 OutboundRulePropertiesFormat object itself. + */ + public OutboundRulePropertiesFormat withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (frontendIpConfigurations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property frontendIpConfigurations in model OutboundRulePropertiesFormat")); + } + if (backendAddressPool() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property backendAddressPool in model OutboundRulePropertiesFormat")); + } + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocol in model OutboundRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OutboundRulePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("frontendIPConfigurations", this.frontendIpConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeNumberField("allocatedOutboundPorts", this.allocatedOutboundPorts); + jsonWriter.writeBooleanField("enableTcpReset", this.enableTcpReset); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRulePropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OutboundRulePropertiesFormat. + */ + public static OutboundRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRulePropertiesFormat deserializedOutboundRulePropertiesFormat = new OutboundRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frontendIPConfigurations".equals(fieldName)) { + List frontendIpConfigurations + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedOutboundRulePropertiesFormat.frontendIpConfigurations = frontendIpConfigurations; + } else if ("backendAddressPool".equals(fieldName)) { + deserializedOutboundRulePropertiesFormat.backendAddressPool = SubResource.fromJson(reader); + } else if ("protocol".equals(fieldName)) { + deserializedOutboundRulePropertiesFormat.protocol + = LoadBalancerOutboundRuleProtocol.fromString(reader.getString()); + } else if ("allocatedOutboundPorts".equals(fieldName)) { + deserializedOutboundRulePropertiesFormat.allocatedOutboundPorts + = reader.getNullable(JsonReader::getInt); + } else if ("provisioningState".equals(fieldName)) { + deserializedOutboundRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("enableTcpReset".equals(fieldName)) { + deserializedOutboundRulePropertiesFormat.enableTcpReset + = reader.getNullable(JsonReader::getBoolean); + } else if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedOutboundRulePropertiesFormat.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRulePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SConnectionConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SConnectionConfigurationProperties.java new file mode 100644 index 0000000000000..5dd2dfcadbbd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SConnectionConfigurationProperties.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for P2SConnectionConfiguration. + */ +@Fluent +public final class P2SConnectionConfigurationProperties + implements JsonSerializable { + /* + * The reference to the address space resource which represents Address space for P2S VpnClient. + */ + private AddressSpace vpnClientAddressPool; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + private RoutingConfiguration routingConfiguration; + + /* + * Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. + */ + private Boolean enableInternetSecurity; + + /* + * List of Configuration Policy Groups that this P2SConnectionConfiguration is attached to. + */ + private List configurationPolicyGroupAssociations; + + /* + * List of previous Configuration Policy Groups that this P2SConnectionConfiguration was attached to. + */ + private List previousConfigurationPolicyGroupAssociations; + + /* + * The provisioning state of the P2SConnectionConfiguration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of P2SConnectionConfigurationProperties class. + */ + public P2SConnectionConfigurationProperties() { + } + + /** + * 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 P2SConnectionConfigurationProperties object itself. + */ + public P2SConnectionConfigurationProperties 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 P2SConnectionConfigurationProperties object itself. + */ + public P2SConnectionConfigurationProperties 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 P2SConnectionConfigurationProperties object itself. + */ + public P2SConnectionConfigurationProperties withEnableInternetSecurity(Boolean enableInternetSecurity) { + this.enableInternetSecurity = enableInternetSecurity; + return this; + } + + /** + * Get the configurationPolicyGroupAssociations property: List of Configuration Policy Groups that this + * P2SConnectionConfiguration is attached to. + * + * @return the configurationPolicyGroupAssociations value. + */ + public List configurationPolicyGroupAssociations() { + return this.configurationPolicyGroupAssociations; + } + + /** + * Get the previousConfigurationPolicyGroupAssociations property: List of previous Configuration Policy Groups that + * this P2SConnectionConfiguration was attached to. + * + * @return the previousConfigurationPolicyGroupAssociations value. + */ + public List previousConfigurationPolicyGroupAssociations() { + return this.previousConfigurationPolicyGroupAssociations; + } + + /** + * Get the provisioningState property: The provisioning state of the P2SConnectionConfiguration 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() { + if (vpnClientAddressPool() != null) { + vpnClientAddressPool().validate(); + } + if (routingConfiguration() != null) { + routingConfiguration().validate(); + } + if (previousConfigurationPolicyGroupAssociations() != null) { + previousConfigurationPolicyGroupAssociations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vpnClientAddressPool", this.vpnClientAddressPool); + jsonWriter.writeJsonField("routingConfiguration", this.routingConfiguration); + jsonWriter.writeBooleanField("enableInternetSecurity", this.enableInternetSecurity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SConnectionConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SConnectionConfigurationProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the P2SConnectionConfigurationProperties. + */ + public static P2SConnectionConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SConnectionConfigurationProperties deserializedP2SConnectionConfigurationProperties + = new P2SConnectionConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnClientAddressPool".equals(fieldName)) { + deserializedP2SConnectionConfigurationProperties.vpnClientAddressPool + = AddressSpace.fromJson(reader); + } else if ("routingConfiguration".equals(fieldName)) { + deserializedP2SConnectionConfigurationProperties.routingConfiguration + = RoutingConfiguration.fromJson(reader); + } else if ("enableInternetSecurity".equals(fieldName)) { + deserializedP2SConnectionConfigurationProperties.enableInternetSecurity + = reader.getNullable(JsonReader::getBoolean); + } else if ("configurationPolicyGroupAssociations".equals(fieldName)) { + List configurationPolicyGroupAssociations + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedP2SConnectionConfigurationProperties.configurationPolicyGroupAssociations + = configurationPolicyGroupAssociations; + } else if ("previousConfigurationPolicyGroupAssociations".equals(fieldName)) { + List previousConfigurationPolicyGroupAssociations + = reader.readArray(reader1 -> VpnServerConfigurationPolicyGroupInner.fromJson(reader1)); + deserializedP2SConnectionConfigurationProperties.previousConfigurationPolicyGroupAssociations + = previousConfigurationPolicyGroupAssociations; + } else if ("provisioningState".equals(fieldName)) { + deserializedP2SConnectionConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedP2SConnectionConfigurationProperties; + }); + } +} 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..b4f85c974c6a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnConnectionHealthInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * P2S Vpn connection detailed health written to sas url. + */ +@Fluent +public final class P2SVpnConnectionHealthInner implements JsonSerializable { + /* + * Returned sas url of the blob to which the p2s vpn connection detailed health will be written. + */ + private String sasUrl; + + /** + * Creates an instance of P2SVpnConnectionHealthInner class. + */ + public P2SVpnConnectionHealthInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sasUrl", this.sasUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SVpnConnectionHealthInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SVpnConnectionHealthInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the P2SVpnConnectionHealthInner. + */ + public static P2SVpnConnectionHealthInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SVpnConnectionHealthInner deserializedP2SVpnConnectionHealthInner = new P2SVpnConnectionHealthInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasUrl".equals(fieldName)) { + deserializedP2SVpnConnectionHealthInner.sasUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedP2SVpnConnectionHealthInner; + }); + } +} 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..a6fad566b3ca2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayInner.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.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * P2SVpnGateway Resource. + */ +@Fluent +public final class P2SVpnGatewayInner extends Resource { + /* + * Properties of the P2SVpnGateway. + */ + private P2SVpnGatewayProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of P2SVpnGatewayInner class. + */ + public P2SVpnGatewayInner() { + } + + /** + * Get the innerProperties property: Properties of the P2SVpnGateway. + * + * @return the innerProperties value. + */ + private P2SVpnGatewayProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 P2SVpnGatewayInner object itself. + */ + public P2SVpnGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public P2SVpnGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public P2SVpnGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SVpnGatewayProperties(); + } + this.innerProperties().withVirtualHub(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SVpnGatewayProperties(); + } + this.innerProperties().withP2SConnectionConfigurations(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vpnGatewayScaleUnit property: The scale unit for this p2s vpn gateway. + * + * @return the vpnGatewayScaleUnit value. + */ + public Integer vpnGatewayScaleUnit() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SVpnGatewayProperties(); + } + this.innerProperties().withVpnGatewayScaleUnit(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SVpnGatewayProperties(); + } + this.innerProperties().withVpnServerConfiguration(vpnServerConfiguration); + return this; + } + + /** + * Get the vpnClientConnectionHealth property: All P2S VPN clients' connection health status. + * + * @return the vpnClientConnectionHealth value. + */ + public VpnClientConnectionHealth vpnClientConnectionHealth() { + return this.innerProperties() == null ? null : this.innerProperties().vpnClientConnectionHealth(); + } + + /** + * Get the customDnsServers property: List of all customer specified DNS servers IP addresses. + * + * @return the customDnsServers value. + */ + public List customDnsServers() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SVpnGatewayProperties(); + } + this.innerProperties().withCustomDnsServers(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SVpnGatewayProperties(); + } + this.innerProperties().withIsRoutingPreferenceInternet(isRoutingPreferenceInternet); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SVpnGatewayInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SVpnGatewayInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the P2SVpnGatewayInner. + */ + public static P2SVpnGatewayInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SVpnGatewayInner deserializedP2SVpnGatewayInner = new P2SVpnGatewayInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedP2SVpnGatewayInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedP2SVpnGatewayInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedP2SVpnGatewayInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedP2SVpnGatewayInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedP2SVpnGatewayInner.innerProperties = P2SVpnGatewayProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedP2SVpnGatewayInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedP2SVpnGatewayInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedP2SVpnGatewayInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayProperties.java new file mode 100644 index 0000000000000..48b7ab3e77d37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/P2SVpnGatewayProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for P2SVpnGateway. + */ +@Fluent +public final class P2SVpnGatewayProperties implements JsonSerializable { + /* + * The VirtualHub to which the gateway belongs. + */ + private SubResource virtualHub; + + /* + * List of all p2s connection configurations of the gateway. + */ + private List p2SConnectionConfigurations; + + /* + * The provisioning state of the P2S VPN gateway resource. + */ + private ProvisioningState provisioningState; + + /* + * The scale unit for this p2s vpn gateway. + */ + private Integer vpnGatewayScaleUnit; + + /* + * The VpnServerConfiguration to which the p2sVpnGateway is attached to. + */ + private SubResource vpnServerConfiguration; + + /* + * All P2S VPN clients' connection health status. + */ + private VpnClientConnectionHealth vpnClientConnectionHealth; + + /* + * List of all customer specified DNS servers IP addresses. + */ + private List customDnsServers; + + /* + * Enable Routing Preference property for the Public IP Interface of the P2SVpnGateway. + */ + private Boolean isRoutingPreferenceInternet; + + /** + * Creates an instance of P2SVpnGatewayProperties class. + */ + public P2SVpnGatewayProperties() { + } + + /** + * 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 P2SVpnGatewayProperties object itself. + */ + public P2SVpnGatewayProperties 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 P2SVpnGatewayProperties object itself. + */ + public P2SVpnGatewayProperties + 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 P2SVpnGatewayProperties object itself. + */ + public P2SVpnGatewayProperties 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 P2SVpnGatewayProperties object itself. + */ + public P2SVpnGatewayProperties 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 P2SVpnGatewayProperties object itself. + */ + public P2SVpnGatewayProperties 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 P2SVpnGatewayProperties object itself. + */ + public P2SVpnGatewayProperties withIsRoutingPreferenceInternet(Boolean isRoutingPreferenceInternet) { + this.isRoutingPreferenceInternet = isRoutingPreferenceInternet; + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualHub", this.virtualHub); + jsonWriter.writeArrayField("p2SConnectionConfigurations", this.p2SConnectionConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("vpnGatewayScaleUnit", this.vpnGatewayScaleUnit); + jsonWriter.writeJsonField("vpnServerConfiguration", this.vpnServerConfiguration); + jsonWriter.writeArrayField("customDnsServers", this.customDnsServers, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isRoutingPreferenceInternet", this.isRoutingPreferenceInternet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SVpnGatewayProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SVpnGatewayProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the P2SVpnGatewayProperties. + */ + public static P2SVpnGatewayProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SVpnGatewayProperties deserializedP2SVpnGatewayProperties = new P2SVpnGatewayProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualHub".equals(fieldName)) { + deserializedP2SVpnGatewayProperties.virtualHub = SubResource.fromJson(reader); + } else if ("p2SConnectionConfigurations".equals(fieldName)) { + List p2SConnectionConfigurations + = reader.readArray(reader1 -> P2SConnectionConfiguration.fromJson(reader1)); + deserializedP2SVpnGatewayProperties.p2SConnectionConfigurations = p2SConnectionConfigurations; + } else if ("provisioningState".equals(fieldName)) { + deserializedP2SVpnGatewayProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("vpnGatewayScaleUnit".equals(fieldName)) { + deserializedP2SVpnGatewayProperties.vpnGatewayScaleUnit = reader.getNullable(JsonReader::getInt); + } else if ("vpnServerConfiguration".equals(fieldName)) { + deserializedP2SVpnGatewayProperties.vpnServerConfiguration = SubResource.fromJson(reader); + } else if ("vpnClientConnectionHealth".equals(fieldName)) { + deserializedP2SVpnGatewayProperties.vpnClientConnectionHealth + = VpnClientConnectionHealth.fromJson(reader); + } else if ("customDnsServers".equals(fieldName)) { + List customDnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedP2SVpnGatewayProperties.customDnsServers = customDnsServers; + } else if ("isRoutingPreferenceInternet".equals(fieldName)) { + deserializedP2SVpnGatewayProperties.isRoutingPreferenceInternet + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedP2SVpnGatewayProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureParameters.java new file mode 100644 index 0000000000000..8feabdae38787 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureParameters.java @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureMachineScope; +import com.azure.resourcemanager.network.generated.models.PacketCaptureSettings; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.PacketCaptureTargetType; +import java.io.IOException; +import java.util.List; + +/** + * Parameters that define the create packet capture operation. + */ +@Fluent +public class PacketCaptureParameters implements JsonSerializable { + /* + * The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. + */ + private String target; + + /* + * A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and + * excluded are empty, then the packet capture will run on all instances of AzureVMSS. + */ + private PacketCaptureMachineScope scope; + + /* + * Target type of the resource provided. + */ + private PacketCaptureTargetType targetType; + + /* + * Number of bytes captured per packet, the remaining bytes are truncated. + */ + private Long bytesToCapturePerPacket; + + /* + * Maximum size of the capture output. + */ + private Long totalBytesPerSession; + + /* + * Maximum duration of the capture session in seconds. + */ + private Integer timeLimitInSeconds; + + /* + * The storage location for a packet capture session. + */ + private PacketCaptureStorageLocation storageLocation; + + /* + * A list of packet capture filters. + */ + private List filters; + + /* + * This continuous capture is a nullable boolean, which can hold 'null', 'true' or 'false' value. If we do not pass + * this parameter, it would be consider as 'null', default value is 'null'. + */ + private Boolean continuousCapture; + + /* + * The capture setting holds the 'FileCount', 'FileSizeInBytes', 'SessionTimeLimitInSeconds' values. + */ + private PacketCaptureSettings captureSettings; + + /** + * Creates an instance of PacketCaptureParameters class. + */ + public PacketCaptureParameters() { + } + + /** + * Get the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently + * supported. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are 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 scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If + * both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + * + * @return the scope value. + */ + public PacketCaptureMachineScope scope() { + return this.scope; + } + + /** + * Set the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If + * both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + * + * @param scope the scope value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withScope(PacketCaptureMachineScope scope) { + this.scope = scope; + return this; + } + + /** + * Get the targetType property: Target type of the resource provided. + * + * @return the targetType value. + */ + public PacketCaptureTargetType targetType() { + return this.targetType; + } + + /** + * Set the targetType property: Target type of the resource provided. + * + * @param targetType the targetType value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withTargetType(PacketCaptureTargetType targetType) { + this.targetType = targetType; + 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; + } + + /** + * Get the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true' + * or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. + * + * @return the continuousCapture value. + */ + public Boolean continuousCapture() { + return this.continuousCapture; + } + + /** + * Set the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true' + * or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. + * + * @param continuousCapture the continuousCapture value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withContinuousCapture(Boolean continuousCapture) { + this.continuousCapture = continuousCapture; + return this; + } + + /** + * Get the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes', + * 'SessionTimeLimitInSeconds' values. + * + * @return the captureSettings value. + */ + public PacketCaptureSettings captureSettings() { + return this.captureSettings; + } + + /** + * Set the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes', + * 'SessionTimeLimitInSeconds' values. + * + * @param captureSettings the captureSettings value to set. + * @return the PacketCaptureParameters object itself. + */ + public PacketCaptureParameters withCaptureSettings(PacketCaptureSettings captureSettings) { + this.captureSettings = captureSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property target in model PacketCaptureParameters")); + } + if (scope() != null) { + scope().validate(); + } + if (storageLocation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageLocation in model PacketCaptureParameters")); + } else { + storageLocation().validate(); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + if (captureSettings() != null) { + captureSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PacketCaptureParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeJsonField("storageLocation", this.storageLocation); + jsonWriter.writeJsonField("scope", this.scope); + jsonWriter.writeStringField("targetType", this.targetType == null ? null : this.targetType.toString()); + jsonWriter.writeNumberField("bytesToCapturePerPacket", this.bytesToCapturePerPacket); + jsonWriter.writeNumberField("totalBytesPerSession", this.totalBytesPerSession); + jsonWriter.writeNumberField("timeLimitInSeconds", this.timeLimitInSeconds); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("continuousCapture", this.continuousCapture); + jsonWriter.writeJsonField("captureSettings", this.captureSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PacketCaptureParameters. + */ + public static PacketCaptureParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureParameters deserializedPacketCaptureParameters = new PacketCaptureParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("target".equals(fieldName)) { + deserializedPacketCaptureParameters.target = reader.getString(); + } else if ("storageLocation".equals(fieldName)) { + deserializedPacketCaptureParameters.storageLocation = PacketCaptureStorageLocation.fromJson(reader); + } else if ("scope".equals(fieldName)) { + deserializedPacketCaptureParameters.scope = PacketCaptureMachineScope.fromJson(reader); + } else if ("targetType".equals(fieldName)) { + deserializedPacketCaptureParameters.targetType + = PacketCaptureTargetType.fromString(reader.getString()); + } else if ("bytesToCapturePerPacket".equals(fieldName)) { + deserializedPacketCaptureParameters.bytesToCapturePerPacket + = reader.getNullable(JsonReader::getLong); + } else if ("totalBytesPerSession".equals(fieldName)) { + deserializedPacketCaptureParameters.totalBytesPerSession = reader.getNullable(JsonReader::getLong); + } else if ("timeLimitInSeconds".equals(fieldName)) { + deserializedPacketCaptureParameters.timeLimitInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("filters".equals(fieldName)) { + List filters + = reader.readArray(reader1 -> PacketCaptureFilter.fromJson(reader1)); + deserializedPacketCaptureParameters.filters = filters; + } else if ("continuousCapture".equals(fieldName)) { + deserializedPacketCaptureParameters.continuousCapture = reader.getNullable(JsonReader::getBoolean); + } else if ("captureSettings".equals(fieldName)) { + deserializedPacketCaptureParameters.captureSettings = PacketCaptureSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureParameters; + }); + } +} 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..af25d07d2b81e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureQueryStatusResultInner.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.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PcError; +import com.azure.resourcemanager.network.generated.models.PcStatus; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Status of packet capture session. + */ +@Fluent +public final class PacketCaptureQueryStatusResultInner + implements JsonSerializable { + /* + * The name of the packet capture resource. + */ + private String name; + + /* + * The ID of the packet capture resource. + */ + private String id; + + /* + * The start time of the packet capture session. + */ + private OffsetDateTime captureStartTime; + + /* + * The status of the packet capture session. + */ + private PcStatus packetCaptureStatus; + + /* + * The reason the current packet capture session was stopped. + */ + private String stopReason; + + /* + * List of errors of packet capture session. + */ + private List packetCaptureError; + + /** + * Creates an instance of PacketCaptureQueryStatusResultInner class. + */ + public PacketCaptureQueryStatusResultInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("captureStartTime", + this.captureStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.captureStartTime)); + jsonWriter.writeStringField("packetCaptureStatus", + this.packetCaptureStatus == null ? null : this.packetCaptureStatus.toString()); + jsonWriter.writeStringField("stopReason", this.stopReason); + jsonWriter.writeArrayField("packetCaptureError", this.packetCaptureError, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureQueryStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureQueryStatusResultInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PacketCaptureQueryStatusResultInner. + */ + public static PacketCaptureQueryStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureQueryStatusResultInner deserializedPacketCaptureQueryStatusResultInner + = new PacketCaptureQueryStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPacketCaptureQueryStatusResultInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedPacketCaptureQueryStatusResultInner.id = reader.getString(); + } else if ("captureStartTime".equals(fieldName)) { + deserializedPacketCaptureQueryStatusResultInner.captureStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("packetCaptureStatus".equals(fieldName)) { + deserializedPacketCaptureQueryStatusResultInner.packetCaptureStatus + = PcStatus.fromString(reader.getString()); + } else if ("stopReason".equals(fieldName)) { + deserializedPacketCaptureQueryStatusResultInner.stopReason = reader.getString(); + } else if ("packetCaptureError".equals(fieldName)) { + List packetCaptureError + = reader.readArray(reader1 -> PcError.fromString(reader1.getString())); + deserializedPacketCaptureQueryStatusResultInner.packetCaptureError = packetCaptureError; + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureQueryStatusResultInner; + }); + } +} 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..344d92b9f3522 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultInner.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureMachineScope; +import com.azure.resourcemanager.network.generated.models.PacketCaptureSettings; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.PacketCaptureTargetType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Information about packet capture session. + */ +@Fluent +public final class PacketCaptureResultInner implements JsonSerializable { + /* + * Name of the packet capture session. + */ + private String name; + + /* + * ID of the packet capture operation. + */ + private String id; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Properties of the packet capture result. + */ + private PacketCaptureResultProperties innerProperties; + + /** + * Creates an instance of PacketCaptureResultInner class. + */ + public PacketCaptureResultInner() { + } + + /** + * 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 innerProperties property: Properties of the packet capture result. + * + * @return the innerProperties value. + */ + private PacketCaptureResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: The provisioning state of the packet capture session. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently + * supported. + * + * @return the target value. + */ + public String target() { + return this.innerProperties() == null ? null : this.innerProperties().target(); + } + + /** + * Set the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently + * supported. + * + * @param target the target value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTarget(String target) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withTarget(target); + return this; + } + + /** + * Get the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If + * both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + * + * @return the scope value. + */ + public PacketCaptureMachineScope scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If + * both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + * + * @param scope the scope value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withScope(PacketCaptureMachineScope scope) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the targetType property: Target type of the resource provided. + * + * @return the targetType value. + */ + public PacketCaptureTargetType targetType() { + return this.innerProperties() == null ? null : this.innerProperties().targetType(); + } + + /** + * Set the targetType property: Target type of the resource provided. + * + * @param targetType the targetType value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withTargetType(PacketCaptureTargetType targetType) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withTargetType(targetType); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + /** + * Get the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + public Long totalBytesPerSession() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withTotalBytesPerSession(totalBytesPerSession); + return this; + } + + /** + * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + public Integer timeLimitInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + /** + * Get the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + public PacketCaptureStorageLocation storageLocation() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withStorageLocation(storageLocation); + return this; + } + + /** + * Get the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + public List filters() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withFilters(filters); + return this; + } + + /** + * Get the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true' + * or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. + * + * @return the continuousCapture value. + */ + public Boolean continuousCapture() { + return this.innerProperties() == null ? null : this.innerProperties().continuousCapture(); + } + + /** + * Set the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true' + * or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. + * + * @param continuousCapture the continuousCapture value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withContinuousCapture(Boolean continuousCapture) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withContinuousCapture(continuousCapture); + return this; + } + + /** + * Get the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes', + * 'SessionTimeLimitInSeconds' values. + * + * @return the captureSettings value. + */ + public PacketCaptureSettings captureSettings() { + return this.innerProperties() == null ? null : this.innerProperties().captureSettings(); + } + + /** + * Set the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes', + * 'SessionTimeLimitInSeconds' values. + * + * @param captureSettings the captureSettings value to set. + * @return the PacketCaptureResultInner object itself. + */ + public PacketCaptureResultInner withCaptureSettings(PacketCaptureSettings captureSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureResultProperties(); + } + this.innerProperties().withCaptureSettings(captureSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PacketCaptureResultInner. + */ + public static PacketCaptureResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureResultInner deserializedPacketCaptureResultInner = new PacketCaptureResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPacketCaptureResultInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedPacketCaptureResultInner.id = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPacketCaptureResultInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPacketCaptureResultInner.innerProperties + = PacketCaptureResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultProperties.java new file mode 100644 index 0000000000000..93a85d0b7ef30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PacketCaptureResultProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureMachineScope; +import com.azure.resourcemanager.network.generated.models.PacketCaptureSettings; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.PacketCaptureTargetType; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * The properties of a packet capture session. + */ +@Fluent +public final class PacketCaptureResultProperties extends PacketCaptureParameters { + /* + * The provisioning state of the packet capture session. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of PacketCaptureResultProperties class. + */ + public PacketCaptureResultProperties() { + } + + /** + * 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 withScope(PacketCaptureMachineScope scope) { + super.withScope(scope); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PacketCaptureResultProperties withTargetType(PacketCaptureTargetType targetType) { + super.withTargetType(targetType); + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public PacketCaptureResultProperties withContinuousCapture(Boolean continuousCapture) { + super.withContinuousCapture(continuousCapture); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PacketCaptureResultProperties withCaptureSettings(PacketCaptureSettings captureSettings) { + super.withCaptureSettings(captureSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (target() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property target in model PacketCaptureResultProperties")); + } + if (scope() != null) { + scope().validate(); + } + if (storageLocation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageLocation in model PacketCaptureResultProperties")); + } else { + storageLocation().validate(); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + if (captureSettings() != null) { + captureSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PacketCaptureResultProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("target", target()); + jsonWriter.writeJsonField("storageLocation", storageLocation()); + jsonWriter.writeJsonField("scope", scope()); + jsonWriter.writeStringField("targetType", targetType() == null ? null : targetType().toString()); + jsonWriter.writeNumberField("bytesToCapturePerPacket", bytesToCapturePerPacket()); + jsonWriter.writeNumberField("totalBytesPerSession", totalBytesPerSession()); + jsonWriter.writeNumberField("timeLimitInSeconds", timeLimitInSeconds()); + jsonWriter.writeArrayField("filters", filters(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("continuousCapture", continuousCapture()); + jsonWriter.writeJsonField("captureSettings", captureSettings()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureResultProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PacketCaptureResultProperties. + */ + public static PacketCaptureResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureResultProperties deserializedPacketCaptureResultProperties + = new PacketCaptureResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("target".equals(fieldName)) { + deserializedPacketCaptureResultProperties.withTarget(reader.getString()); + } else if ("storageLocation".equals(fieldName)) { + deserializedPacketCaptureResultProperties + .withStorageLocation(PacketCaptureStorageLocation.fromJson(reader)); + } else if ("scope".equals(fieldName)) { + deserializedPacketCaptureResultProperties.withScope(PacketCaptureMachineScope.fromJson(reader)); + } else if ("targetType".equals(fieldName)) { + deserializedPacketCaptureResultProperties + .withTargetType(PacketCaptureTargetType.fromString(reader.getString())); + } else if ("bytesToCapturePerPacket".equals(fieldName)) { + deserializedPacketCaptureResultProperties + .withBytesToCapturePerPacket(reader.getNullable(JsonReader::getLong)); + } else if ("totalBytesPerSession".equals(fieldName)) { + deserializedPacketCaptureResultProperties + .withTotalBytesPerSession(reader.getNullable(JsonReader::getLong)); + } else if ("timeLimitInSeconds".equals(fieldName)) { + deserializedPacketCaptureResultProperties + .withTimeLimitInSeconds(reader.getNullable(JsonReader::getInt)); + } else if ("filters".equals(fieldName)) { + List filters + = reader.readArray(reader1 -> PacketCaptureFilter.fromJson(reader1)); + deserializedPacketCaptureResultProperties.withFilters(filters); + } else if ("continuousCapture".equals(fieldName)) { + deserializedPacketCaptureResultProperties + .withContinuousCapture(reader.getNullable(JsonReader::getBoolean)); + } else if ("captureSettings".equals(fieldName)) { + deserializedPacketCaptureResultProperties + .withCaptureSettings(PacketCaptureSettings.fromJson(reader)); + } else if ("provisioningState".equals(fieldName)) { + deserializedPacketCaptureResultProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureResultProperties; + }); + } +} 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..d1f8d7103b46c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering resource. + */ +@Fluent +public final class PeerExpressRouteCircuitConnectionInner extends SubResource { + /* + * Properties of the peer express route circuit connection. + */ + private PeerExpressRouteCircuitConnectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of PeerExpressRouteCircuitConnectionInner class. + */ + public PeerExpressRouteCircuitConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the peer express route circuit connection. + * + * @return the innerProperties value. + */ + private PeerExpressRouteCircuitConnectionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public PeerExpressRouteCircuitConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the expressRouteCircuitPeering property: Reference to Express Route Circuit Private Peering Resource of the + * circuit. + * + * @return the expressRouteCircuitPeering value. + */ + public SubResource expressRouteCircuitPeering() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeerExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withExpressRouteCircuitPeering(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeerExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withPeerExpressRouteCircuitPeering(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeerExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the circuitConnectionStatus property: Express Route Circuit connection state. + * + * @return the circuitConnectionStatus value. + */ + public CircuitConnectionStatus circuitConnectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().circuitConnectionStatus(); + } + + /** + * Get the connectionName property: The name of the express route circuit connection resource. + * + * @return the connectionName value. + */ + public String connectionName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeerExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withConnectionName(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeerExpressRouteCircuitConnectionPropertiesFormat(); + } + this.innerProperties().withAuthResourceGuid(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PeerExpressRouteCircuitConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PeerExpressRouteCircuitConnectionInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PeerExpressRouteCircuitConnectionInner. + */ + public static PeerExpressRouteCircuitConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PeerExpressRouteCircuitConnectionInner deserializedPeerExpressRouteCircuitConnectionInner + = new PeerExpressRouteCircuitConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionInner.innerProperties + = PeerExpressRouteCircuitConnectionPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPeerExpressRouteCircuitConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionPropertiesFormat.java new file mode 100644 index 0000000000000..5140c1715f244 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PeerExpressRouteCircuitConnectionPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.CircuitConnectionStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the peer express route circuit connection. + */ +@Fluent +public final class PeerExpressRouteCircuitConnectionPropertiesFormat + implements JsonSerializable { + /* + * Reference to Express Route Circuit Private Peering Resource of the circuit. + */ + private SubResource expressRouteCircuitPeering; + + /* + * Reference to Express Route Circuit Private Peering Resource of the peered circuit. + */ + private SubResource peerExpressRouteCircuitPeering; + + /* + * /29 IP address space to carve out Customer addresses for tunnels. + */ + private String addressPrefix; + + /* + * Express Route Circuit connection state. + */ + private CircuitConnectionStatus circuitConnectionStatus; + + /* + * The name of the express route circuit connection resource. + */ + private String connectionName; + + /* + * The resource guid of the authorization used for the express route circuit connection. + */ + private String authResourceGuid; + + /* + * The provisioning state of the peer express route circuit connection resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of PeerExpressRouteCircuitConnectionPropertiesFormat class. + */ + public PeerExpressRouteCircuitConnectionPropertiesFormat() { + } + + /** + * 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 PeerExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public PeerExpressRouteCircuitConnectionPropertiesFormat + 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 PeerExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public PeerExpressRouteCircuitConnectionPropertiesFormat + 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 PeerExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public PeerExpressRouteCircuitConnectionPropertiesFormat 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 PeerExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public PeerExpressRouteCircuitConnectionPropertiesFormat 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 PeerExpressRouteCircuitConnectionPropertiesFormat object itself. + */ + public PeerExpressRouteCircuitConnectionPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("expressRouteCircuitPeering", this.expressRouteCircuitPeering); + jsonWriter.writeJsonField("peerExpressRouteCircuitPeering", this.peerExpressRouteCircuitPeering); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeStringField("connectionName", this.connectionName); + jsonWriter.writeStringField("authResourceGuid", this.authResourceGuid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PeerExpressRouteCircuitConnectionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PeerExpressRouteCircuitConnectionPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PeerExpressRouteCircuitConnectionPropertiesFormat. + */ + public static PeerExpressRouteCircuitConnectionPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PeerExpressRouteCircuitConnectionPropertiesFormat deserializedPeerExpressRouteCircuitConnectionPropertiesFormat + = new PeerExpressRouteCircuitConnectionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("expressRouteCircuitPeering".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionPropertiesFormat.expressRouteCircuitPeering + = SubResource.fromJson(reader); + } else if ("peerExpressRouteCircuitPeering".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionPropertiesFormat.peerExpressRouteCircuitPeering + = SubResource.fromJson(reader); + } else if ("addressPrefix".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionPropertiesFormat.addressPrefix = reader.getString(); + } else if ("circuitConnectionStatus".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionPropertiesFormat.circuitConnectionStatus + = CircuitConnectionStatus.fromString(reader.getString()); + } else if ("connectionName".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionPropertiesFormat.connectionName = reader.getString(); + } else if ("authResourceGuid".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionPropertiesFormat.authResourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPeerExpressRouteCircuitConnectionPropertiesFormat; + }); + } +} 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..12f203deca327 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Private dns zone group resource. + */ +@Fluent +public final class PrivateDnsZoneGroupInner extends SubResource { + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Properties of the private dns zone group. + */ + private PrivateDnsZoneGroupPropertiesFormat innerProperties; + + /** + * Creates an instance of PrivateDnsZoneGroupInner class. + */ + public PrivateDnsZoneGroupInner() { + } + + /** + * 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 innerProperties property: Properties of the private dns zone group. + * + * @return the innerProperties value. + */ + private PrivateDnsZoneGroupPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateDnsZoneGroupInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private dns zone group resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateDnsZoneGroupPropertiesFormat(); + } + this.innerProperties().withPrivateDnsZoneConfigs(privateDnsZoneConfigs); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateDnsZoneGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateDnsZoneGroupInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateDnsZoneGroupInner. + */ + public static PrivateDnsZoneGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateDnsZoneGroupInner deserializedPrivateDnsZoneGroupInner = new PrivateDnsZoneGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateDnsZoneGroupInner.withId(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedPrivateDnsZoneGroupInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPrivateDnsZoneGroupInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateDnsZoneGroupInner.innerProperties + = PrivateDnsZoneGroupPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateDnsZoneGroupInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupPropertiesFormat.java new file mode 100644 index 0000000000000..e6bc23e23f5f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZoneGroupPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private dns zone group. + */ +@Fluent +public final class PrivateDnsZoneGroupPropertiesFormat + implements JsonSerializable { + /* + * The provisioning state of the private dns zone group resource. + */ + private ProvisioningState provisioningState; + + /* + * A collection of private dns zone configurations of the private dns zone group. + */ + private List privateDnsZoneConfigs; + + /** + * Creates an instance of PrivateDnsZoneGroupPropertiesFormat class. + */ + public PrivateDnsZoneGroupPropertiesFormat() { + } + + /** + * 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 PrivateDnsZoneGroupPropertiesFormat object itself. + */ + public PrivateDnsZoneGroupPropertiesFormat + withPrivateDnsZoneConfigs(List privateDnsZoneConfigs) { + this.privateDnsZoneConfigs = privateDnsZoneConfigs; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("privateDnsZoneConfigs", this.privateDnsZoneConfigs, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateDnsZoneGroupPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateDnsZoneGroupPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateDnsZoneGroupPropertiesFormat. + */ + public static PrivateDnsZoneGroupPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateDnsZoneGroupPropertiesFormat deserializedPrivateDnsZoneGroupPropertiesFormat + = new PrivateDnsZoneGroupPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedPrivateDnsZoneGroupPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateDnsZoneConfigs".equals(fieldName)) { + List privateDnsZoneConfigs + = reader.readArray(reader1 -> PrivateDnsZoneConfig.fromJson(reader1)); + deserializedPrivateDnsZoneGroupPropertiesFormat.privateDnsZoneConfigs = privateDnsZoneConfigs; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateDnsZoneGroupPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZonePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZonePropertiesFormat.java new file mode 100644 index 0000000000000..4e48686000160 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateDnsZonePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.RecordSet; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private dns zone configuration resource. + */ +@Fluent +public final class PrivateDnsZonePropertiesFormat implements JsonSerializable { + /* + * The resource id of the private dns zone. + */ + private String privateDnsZoneId; + + /* + * A collection of information regarding a recordSet, holding information to identify private resources. + */ + private List recordSets; + + /** + * Creates an instance of PrivateDnsZonePropertiesFormat class. + */ + public PrivateDnsZonePropertiesFormat() { + } + + /** + * 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 PrivateDnsZonePropertiesFormat object itself. + */ + public PrivateDnsZonePropertiesFormat 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateDnsZoneId", this.privateDnsZoneId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateDnsZonePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateDnsZonePropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateDnsZonePropertiesFormat. + */ + public static PrivateDnsZonePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateDnsZonePropertiesFormat deserializedPrivateDnsZonePropertiesFormat + = new PrivateDnsZonePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateDnsZoneId".equals(fieldName)) { + deserializedPrivateDnsZonePropertiesFormat.privateDnsZoneId = reader.getString(); + } else if ("recordSets".equals(fieldName)) { + List recordSets = reader.readArray(reader1 -> RecordSet.fromJson(reader1)); + deserializedPrivateDnsZonePropertiesFormat.recordSets = recordSets; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateDnsZonePropertiesFormat; + }); + } +} 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..7f3609e9f1e7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * PrivateEndpointConnection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends SubResource { + /* + * Properties of the private end point connection. + */ + private PrivateEndpointConnectionPropertiesInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * The resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the private end point connection. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateEndpointConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpointInner privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionPropertiesInner(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the linkIdentifier property: The consumer link id. + * + * @return the linkIdentifier value. + */ + public String linkIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().linkIdentifier(); + } + + /** + * Get the privateEndpointLocation property: The location of the private endpoint. + * + * @return the privateEndpointLocation value. + */ + public String privateEndpointLocation() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointLocation(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionPropertiesInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionPropertiesInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionPropertiesInner.java new file mode 100644 index 0000000000000..e691df7f62f07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointConnectionPropertiesInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the PrivateEndpointConnectProperties. + */ +@Fluent +public final class PrivateEndpointConnectionPropertiesInner + implements JsonSerializable { + /* + * The resource of private end point. + */ + private PrivateEndpointInner privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private ProvisioningState provisioningState; + + /* + * The consumer link id. + */ + private String linkIdentifier; + + /* + * The location of the private endpoint. + */ + private String privateEndpointLocation; + + /** + * Creates an instance of PrivateEndpointConnectionPropertiesInner class. + */ + public PrivateEndpointConnectionPropertiesInner() { + } + + /** + * 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 PrivateEndpointConnectionPropertiesInner object itself. + */ + public PrivateEndpointConnectionPropertiesInner + 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; + } + + /** + * Get the privateEndpointLocation property: The location of the private endpoint. + * + * @return the privateEndpointLocation value. + */ + public String privateEndpointLocation() { + return this.privateEndpointLocation; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionPropertiesInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionPropertiesInner. + */ + public static PrivateEndpointConnectionPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionPropertiesInner deserializedPrivateEndpointConnectionPropertiesInner + = new PrivateEndpointConnectionPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionPropertiesInner.privateEndpoint + = PrivateEndpointInner.fromJson(reader); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionPropertiesInner.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("linkIdentifier".equals(fieldName)) { + deserializedPrivateEndpointConnectionPropertiesInner.linkIdentifier = reader.getString(); + } else if ("privateEndpointLocation".equals(fieldName)) { + deserializedPrivateEndpointConnectionPropertiesInner.privateEndpointLocation = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionPropertiesInner; + }); + } +} 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..28ffc30dbad66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointInner.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.CustomDnsConfigPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Private endpoint resource. + */ +@Fluent +public final class PrivateEndpointInner extends Resource { + /* + * The extended location of the load balancer. + */ + private ExtendedLocation extendedLocation; + + /* + * Properties of the private endpoint. + */ + private PrivateEndpointPropertiesInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of PrivateEndpointInner class. + */ + public PrivateEndpointInner() { + } + + /** + * 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 innerProperties property: Properties of the private endpoint. + * + * @return the innerProperties value. + */ + private PrivateEndpointPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateEndpointInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateEndpointInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointPropertiesInner(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().networkInterfaces(); + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointPropertiesInner(); + } + this.innerProperties().withPrivateLinkServiceConnections(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointPropertiesInner(); + } + this.innerProperties().withManualPrivateLinkServiceConnections(manualPrivateLinkServiceConnections); + return this; + } + + /** + * Get the customDnsConfigs property: An array of custom dns configurations. + * + * @return the customDnsConfigs value. + */ + public List customDnsConfigs() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointPropertiesInner(); + } + this.innerProperties().withCustomDnsConfigs(customDnsConfigs); + return this; + } + + /** + * Get the applicationSecurityGroups property: Application security groups in which the private endpoint IP + * configuration is included. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.innerProperties() == null ? null : this.innerProperties().applicationSecurityGroups(); + } + + /** + * Set the applicationSecurityGroups property: Application security groups in which the private endpoint IP + * configuration is included. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner + withApplicationSecurityGroups(List applicationSecurityGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointPropertiesInner(); + } + this.innerProperties().withApplicationSecurityGroups(applicationSecurityGroups); + return this; + } + + /** + * Get the ipConfigurations property: A list of IP configurations of the private endpoint. This will be used to map + * to the First Party Service's endpoints. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Set the ipConfigurations property: A list of IP configurations of the private endpoint. This will be used to map + * to the First Party Service's endpoints. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withIpConfigurations(List ipConfigurations) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointPropertiesInner(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the customNetworkInterfaceName property: The custom name of the network interface attached to the private + * endpoint. + * + * @return the customNetworkInterfaceName value. + */ + public String customNetworkInterfaceName() { + return this.innerProperties() == null ? null : this.innerProperties().customNetworkInterfaceName(); + } + + /** + * Set the customNetworkInterfaceName property: The custom name of the network interface attached to the private + * endpoint. + * + * @param customNetworkInterfaceName the customNetworkInterfaceName value to set. + * @return the PrivateEndpointInner object itself. + */ + public PrivateEndpointInner withCustomNetworkInterfaceName(String customNetworkInterfaceName) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointPropertiesInner(); + } + this.innerProperties().withCustomNetworkInterfaceName(customNetworkInterfaceName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointInner. + */ + public static PrivateEndpointInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointInner deserializedPrivateEndpointInner = new PrivateEndpointInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPrivateEndpointInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPrivateEndpointInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPrivateEndpointInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedPrivateEndpointInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointInner.innerProperties = PrivateEndpointPropertiesInner.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedPrivateEndpointInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedPrivateEndpointInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointIpConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointIpConfigurationProperties.java new file mode 100644 index 0000000000000..73219a0577c44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointIpConfigurationProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of an IP Configuration of the private endpoint. + */ +@Fluent +public final class PrivateEndpointIpConfigurationProperties + implements JsonSerializable { + /* + * The ID of a group obtained from the remote resource that this private endpoint should connect to. + */ + private String groupId; + + /* + * The member name of a group obtained from the remote resource that this private endpoint should connect to. + */ + private String memberName; + + /* + * A private ip address obtained from the private endpoint's subnet. + */ + private String privateIpAddress; + + /** + * Creates an instance of PrivateEndpointIpConfigurationProperties class. + */ + public PrivateEndpointIpConfigurationProperties() { + } + + /** + * Get the groupId property: The ID of a group obtained from the remote resource that this private endpoint should + * connect to. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The ID of a group obtained from the remote resource that this private endpoint should + * connect to. + * + * @param groupId the groupId value to set. + * @return the PrivateEndpointIpConfigurationProperties object itself. + */ + public PrivateEndpointIpConfigurationProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the memberName property: The member name of a group obtained from the remote resource that this private + * endpoint should connect to. + * + * @return the memberName value. + */ + public String memberName() { + return this.memberName; + } + + /** + * Set the memberName property: The member name of a group obtained from the remote resource that this private + * endpoint should connect to. + * + * @param memberName the memberName value to set. + * @return the PrivateEndpointIpConfigurationProperties object itself. + */ + public PrivateEndpointIpConfigurationProperties withMemberName(String memberName) { + this.memberName = memberName; + return this; + } + + /** + * Get the privateIpAddress property: A private ip address obtained from the private endpoint's subnet. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.privateIpAddress; + } + + /** + * Set the privateIpAddress property: A private ip address obtained from the private endpoint's subnet. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the PrivateEndpointIpConfigurationProperties object itself. + */ + public PrivateEndpointIpConfigurationProperties withPrivateIpAddress(String privateIpAddress) { + this.privateIpAddress = privateIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("memberName", this.memberName); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointIpConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointIpConfigurationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointIpConfigurationProperties. + */ + public static PrivateEndpointIpConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointIpConfigurationProperties deserializedPrivateEndpointIpConfigurationProperties + = new PrivateEndpointIpConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateEndpointIpConfigurationProperties.groupId = reader.getString(); + } else if ("memberName".equals(fieldName)) { + deserializedPrivateEndpointIpConfigurationProperties.memberName = reader.getString(); + } else if ("privateIPAddress".equals(fieldName)) { + deserializedPrivateEndpointIpConfigurationProperties.privateIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointIpConfigurationProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointPropertiesInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointPropertiesInner.java new file mode 100644 index 0000000000000..74642e18f1467 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateEndpointPropertiesInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.CustomDnsConfigPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private endpoint. + */ +@Fluent +public final class PrivateEndpointPropertiesInner implements JsonSerializable { + /* + * The ID of the subnet from which the private IP will be allocated. + */ + private SubnetInner subnet; + + /* + * An array of references to the network interfaces created for this private endpoint. + */ + private List networkInterfaces; + + /* + * The provisioning state of the private endpoint resource. + */ + private ProvisioningState provisioningState; + + /* + * A grouping of information about the connection to the remote resource. + */ + 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. + */ + private List manualPrivateLinkServiceConnections; + + /* + * An array of custom dns configurations. + */ + private List customDnsConfigs; + + /* + * Application security groups in which the private endpoint IP configuration is included. + */ + private List applicationSecurityGroups; + + /* + * A list of IP configurations of the private endpoint. This will be used to map to the First Party Service's + * endpoints. + */ + private List ipConfigurations; + + /* + * The custom name of the network interface attached to the private endpoint. + */ + private String customNetworkInterfaceName; + + /** + * Creates an instance of PrivateEndpointPropertiesInner class. + */ + public PrivateEndpointPropertiesInner() { + } + + /** + * 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 PrivateEndpointPropertiesInner object itself. + */ + public PrivateEndpointPropertiesInner 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 PrivateEndpointPropertiesInner object itself. + */ + public PrivateEndpointPropertiesInner + 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 PrivateEndpointPropertiesInner object itself. + */ + public PrivateEndpointPropertiesInner 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 PrivateEndpointPropertiesInner object itself. + */ + public PrivateEndpointPropertiesInner withCustomDnsConfigs(List customDnsConfigs) { + this.customDnsConfigs = customDnsConfigs; + return this; + } + + /** + * Get the applicationSecurityGroups property: Application security groups in which the private endpoint IP + * configuration is included. + * + * @return the applicationSecurityGroups value. + */ + public List applicationSecurityGroups() { + return this.applicationSecurityGroups; + } + + /** + * Set the applicationSecurityGroups property: Application security groups in which the private endpoint IP + * configuration is included. + * + * @param applicationSecurityGroups the applicationSecurityGroups value to set. + * @return the PrivateEndpointPropertiesInner object itself. + */ + public PrivateEndpointPropertiesInner + withApplicationSecurityGroups(List applicationSecurityGroups) { + this.applicationSecurityGroups = applicationSecurityGroups; + return this; + } + + /** + * Get the ipConfigurations property: A list of IP configurations of the private endpoint. This will be used to map + * to the First Party Service's endpoints. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: A list of IP configurations of the private endpoint. This will be used to map + * to the First Party Service's endpoints. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the PrivateEndpointPropertiesInner object itself. + */ + public PrivateEndpointPropertiesInner withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the customNetworkInterfaceName property: The custom name of the network interface attached to the private + * endpoint. + * + * @return the customNetworkInterfaceName value. + */ + public String customNetworkInterfaceName() { + return this.customNetworkInterfaceName; + } + + /** + * Set the customNetworkInterfaceName property: The custom name of the network interface attached to the private + * endpoint. + * + * @param customNetworkInterfaceName the customNetworkInterfaceName value to set. + * @return the PrivateEndpointPropertiesInner object itself. + */ + public PrivateEndpointPropertiesInner withCustomNetworkInterfaceName(String customNetworkInterfaceName) { + this.customNetworkInterfaceName = customNetworkInterfaceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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()); + } + if (applicationSecurityGroups() != null) { + applicationSecurityGroups().forEach(e -> e.validate()); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeArrayField("privateLinkServiceConnections", this.privateLinkServiceConnections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("manualPrivateLinkServiceConnections", this.manualPrivateLinkServiceConnections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("customDnsConfigs", this.customDnsConfigs, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("applicationSecurityGroups", this.applicationSecurityGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("customNetworkInterfaceName", this.customNetworkInterfaceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointPropertiesInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointPropertiesInner. + */ + public static PrivateEndpointPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointPropertiesInner deserializedPrivateEndpointPropertiesInner + = new PrivateEndpointPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnet".equals(fieldName)) { + deserializedPrivateEndpointPropertiesInner.subnet = SubnetInner.fromJson(reader); + } else if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> NetworkInterfaceInner.fromJson(reader1)); + deserializedPrivateEndpointPropertiesInner.networkInterfaces = networkInterfaces; + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateLinkServiceConnections".equals(fieldName)) { + List privateLinkServiceConnections + = reader.readArray(reader1 -> PrivateLinkServiceConnection.fromJson(reader1)); + deserializedPrivateEndpointPropertiesInner.privateLinkServiceConnections + = privateLinkServiceConnections; + } else if ("manualPrivateLinkServiceConnections".equals(fieldName)) { + List manualPrivateLinkServiceConnections + = reader.readArray(reader1 -> PrivateLinkServiceConnection.fromJson(reader1)); + deserializedPrivateEndpointPropertiesInner.manualPrivateLinkServiceConnections + = manualPrivateLinkServiceConnections; + } else if ("customDnsConfigs".equals(fieldName)) { + List customDnsConfigs + = reader.readArray(reader1 -> CustomDnsConfigPropertiesFormat.fromJson(reader1)); + deserializedPrivateEndpointPropertiesInner.customDnsConfigs = customDnsConfigs; + } else if ("applicationSecurityGroups".equals(fieldName)) { + List applicationSecurityGroups + = reader.readArray(reader1 -> ApplicationSecurityGroupInner.fromJson(reader1)); + deserializedPrivateEndpointPropertiesInner.applicationSecurityGroups = applicationSecurityGroups; + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> PrivateEndpointIpConfiguration.fromJson(reader1)); + deserializedPrivateEndpointPropertiesInner.ipConfigurations = ipConfigurations; + } else if ("customNetworkInterfaceName".equals(fieldName)) { + deserializedPrivateEndpointPropertiesInner.customNetworkInterfaceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointPropertiesInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceConnectionProperties.java new file mode 100644 index 0000000000000..161a2c36eb9db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceConnectionProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the PrivateLinkServiceConnection. + */ +@Fluent +public final class PrivateLinkServiceConnectionProperties + implements JsonSerializable { + /* + * The provisioning state of the private link service connection resource. + */ + private ProvisioningState provisioningState; + + /* + * The resource id of private link service. + */ + private String privateLinkServiceId; + + /* + * The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. + */ + private List groupIds; + + /* + * A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars. + */ + private String requestMessage; + + /* + * A collection of read-only information about the state of the connection to the remote resource. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Creates an instance of PrivateLinkServiceConnectionProperties class. + */ + public PrivateLinkServiceConnectionProperties() { + } + + /** + * 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 PrivateLinkServiceConnectionProperties object itself. + */ + public PrivateLinkServiceConnectionProperties 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 PrivateLinkServiceConnectionProperties object itself. + */ + public PrivateLinkServiceConnectionProperties 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 PrivateLinkServiceConnectionProperties object itself. + */ + public PrivateLinkServiceConnectionProperties 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 PrivateLinkServiceConnectionProperties object itself. + */ + public PrivateLinkServiceConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateLinkServiceId", this.privateLinkServiceId); + jsonWriter.writeArrayField("groupIds", this.groupIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("requestMessage", this.requestMessage); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionProperties. + */ + public static PrivateLinkServiceConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionProperties deserializedPrivateLinkServiceConnectionProperties + = new PrivateLinkServiceConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateLinkServiceId".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionProperties.privateLinkServiceId = reader.getString(); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkServiceConnectionProperties.groupIds = groupIds; + } else if ("requestMessage".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionProperties.requestMessage = reader.getString(); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionProperties; + }); + } +} 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..e798a05876ac1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Private link service resource. + */ +@Fluent +public final class PrivateLinkServiceInner extends Resource { + /* + * The extended location of the load balancer. + */ + private ExtendedLocation extendedLocation; + + /* + * Properties of the private link service. + */ + private PrivateLinkServiceProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of PrivateLinkServiceInner class. + */ + public PrivateLinkServiceInner() { + } + + /** + * 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 innerProperties property: Properties of the private link service. + * + * @return the innerProperties value. + */ + private PrivateLinkServiceProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateLinkServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateLinkServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the loadBalancerFrontendIpConfigurations property: An array of references to the load balancer IP + * configurations. + * + * @return the loadBalancerFrontendIpConfigurations value. + */ + public List loadBalancerFrontendIpConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceProperties(); + } + this.innerProperties().withLoadBalancerFrontendIpConfigurations(loadBalancerFrontendIpConfigurations); + return this; + } + + /** + * Get the ipConfigurations property: An array of private link service IP configurations. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceProperties(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the destinationIpAddress property: The destination IP address of the private link service. + * + * @return the destinationIpAddress value. + */ + public String destinationIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().destinationIpAddress(); + } + + /** + * Set the destinationIpAddress property: The destination IP address of the private link service. + * + * @param destinationIpAddress the destinationIpAddress value to set. + * @return the PrivateLinkServiceInner object itself. + */ + public PrivateLinkServiceInner withDestinationIpAddress(String destinationIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceProperties(); + } + this.innerProperties().withDestinationIpAddress(destinationIpAddress); + 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.innerProperties() == null ? null : this.innerProperties().networkInterfaces(); + } + + /** + * Get the provisioningState property: The provisioning state of the private link service resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateEndpointConnections property: An array of list about connections to the private endpoint. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the visibility property: The visibility list of the private link service. + * + * @return the visibility value. + */ + public PrivateLinkServicePropertiesVisibility visibility() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceProperties(); + } + this.innerProperties().withVisibility(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceProperties(); + } + this.innerProperties().withAutoApproval(autoApproval); + return this; + } + + /** + * Get the fqdns property: The list of Fqdn. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceProperties(); + } + this.innerProperties().withFqdns(fqdns); + return this; + } + + /** + * Get the alias property: The alias of the private link service. + * + * @return the alias value. + */ + public String alias() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceProperties(); + } + this.innerProperties().withEnableProxyProtocol(enableProxyProtocol); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkServiceInner. + */ + public static PrivateLinkServiceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceInner deserializedPrivateLinkServiceInner = new PrivateLinkServiceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPrivateLinkServiceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkServiceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPrivateLinkServiceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPrivateLinkServiceInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedPrivateLinkServiceInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkServiceInner.innerProperties = PrivateLinkServiceProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedPrivateLinkServiceInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedPrivateLinkServiceInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceInner; + }); + } +} 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..c4eff04000f79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * The private link service ip configuration. + */ +@Fluent +public final class PrivateLinkServiceIpConfigurationInner extends SubResource { + /* + * Properties of the private link service ip configuration. + */ + private PrivateLinkServiceIpConfigurationPropertiesInner innerProperties; + + /* + * The name of private link service ip configuration. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The resource type. + */ + private String type; + + /** + * Creates an instance of PrivateLinkServiceIpConfigurationInner class. + */ + public PrivateLinkServiceIpConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of the private link service ip configuration. + * + * @return the innerProperties value. + */ + private PrivateLinkServiceIpConfigurationPropertiesInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateLinkServiceIpConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceIpConfigurationPropertiesInner(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceIpConfigurationPropertiesInner(); + } + this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubnetInner subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceIpConfigurationPropertiesInner(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the primary property: Whether the ip configuration is primary or not. + * + * @return the primary value. + */ + public Boolean primary() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceIpConfigurationPropertiesInner(); + } + this.innerProperties().withPrimary(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceIpConfigurationPropertiesInner(); + } + this.innerProperties().withPrivateIpAddressVersion(privateIpAddressVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceIpConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceIpConfigurationInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceIpConfigurationInner. + */ + public static PrivateLinkServiceIpConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceIpConfigurationInner deserializedPrivateLinkServiceIpConfigurationInner + = new PrivateLinkServiceIpConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationInner.innerProperties + = PrivateLinkServiceIpConfigurationPropertiesInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceIpConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationPropertiesInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationPropertiesInner.java new file mode 100644 index 0000000000000..304da1e7cff93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceIpConfigurationPropertiesInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of private link service IP configuration. + */ +@Fluent +public final class PrivateLinkServiceIpConfigurationPropertiesInner + implements JsonSerializable { + /* + * The private IP address of the IP configuration. + */ + private String privateIpAddress; + + /* + * The private IP address allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + private SubnetInner subnet; + + /* + * Whether the ip configuration is primary or not. + */ + private Boolean primary; + + /* + * The provisioning state of the private link service IP configuration resource. + */ + private ProvisioningState provisioningState; + + /* + * Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. + */ + private IpVersion privateIpAddressVersion; + + /** + * Creates an instance of PrivateLinkServiceIpConfigurationPropertiesInner class. + */ + public PrivateLinkServiceIpConfigurationPropertiesInner() { + } + + /** + * 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 PrivateLinkServiceIpConfigurationPropertiesInner object itself. + */ + public PrivateLinkServiceIpConfigurationPropertiesInner 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 PrivateLinkServiceIpConfigurationPropertiesInner object itself. + */ + public PrivateLinkServiceIpConfigurationPropertiesInner + 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 PrivateLinkServiceIpConfigurationPropertiesInner object itself. + */ + public PrivateLinkServiceIpConfigurationPropertiesInner 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 PrivateLinkServiceIpConfigurationPropertiesInner object itself. + */ + public PrivateLinkServiceIpConfigurationPropertiesInner 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 PrivateLinkServiceIpConfigurationPropertiesInner object itself. + */ + public PrivateLinkServiceIpConfigurationPropertiesInner + withPrivateIpAddressVersion(IpVersion privateIpAddressVersion) { + this.privateIpAddressVersion = privateIpAddressVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeBooleanField("primary", this.primary); + jsonWriter.writeStringField("privateIPAddressVersion", + this.privateIpAddressVersion == null ? null : this.privateIpAddressVersion.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceIpConfigurationPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceIpConfigurationPropertiesInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceIpConfigurationPropertiesInner. + */ + public static PrivateLinkServiceIpConfigurationPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceIpConfigurationPropertiesInner deserializedPrivateLinkServiceIpConfigurationPropertiesInner + = new PrivateLinkServiceIpConfigurationPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAddress".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationPropertiesInner.privateIpAddress = reader.getString(); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationPropertiesInner.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationPropertiesInner.subnet = SubnetInner.fromJson(reader); + } else if ("primary".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationPropertiesInner.primary + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateIPAddressVersion".equals(fieldName)) { + deserializedPrivateLinkServiceIpConfigurationPropertiesInner.privateIpAddressVersion + = IpVersion.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceIpConfigurationPropertiesInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceProperties.java new file mode 100644 index 0000000000000..7cd1d3b51d6f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import 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.io.IOException; +import java.util.List; + +/** + * Properties of the private link service. + */ +@Fluent +public final class PrivateLinkServiceProperties implements JsonSerializable { + /* + * An array of references to the load balancer IP configurations. + */ + private List loadBalancerFrontendIpConfigurations; + + /* + * An array of private link service IP configurations. + */ + private List ipConfigurations; + + /* + * The destination IP address of the private link service. + */ + private String destinationIpAddress; + + /* + * An array of references to the network interfaces created for this private link service. + */ + private List networkInterfaces; + + /* + * The provisioning state of the private link service resource. + */ + private ProvisioningState provisioningState; + + /* + * An array of list about connections to the private endpoint. + */ + private List privateEndpointConnections; + + /* + * The visibility list of the private link service. + */ + private PrivateLinkServicePropertiesVisibility visibility; + + /* + * The auto-approval list of the private link service. + */ + private PrivateLinkServicePropertiesAutoApproval autoApproval; + + /* + * The list of Fqdn. + */ + private List fqdns; + + /* + * The alias of the private link service. + */ + private String alias; + + /* + * Whether the private link service is enabled for proxy protocol or not. + */ + private Boolean enableProxyProtocol; + + /** + * Creates an instance of PrivateLinkServiceProperties class. + */ + public PrivateLinkServiceProperties() { + } + + /** + * 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 PrivateLinkServiceProperties object itself. + */ + public PrivateLinkServiceProperties 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 PrivateLinkServiceProperties object itself. + */ + public PrivateLinkServiceProperties + withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + return this; + } + + /** + * Get the destinationIpAddress property: The destination IP address of the private link service. + * + * @return the destinationIpAddress value. + */ + public String destinationIpAddress() { + return this.destinationIpAddress; + } + + /** + * Set the destinationIpAddress property: The destination IP address of the private link service. + * + * @param destinationIpAddress the destinationIpAddress value to set. + * @return the PrivateLinkServiceProperties object itself. + */ + public PrivateLinkServiceProperties withDestinationIpAddress(String destinationIpAddress) { + this.destinationIpAddress = destinationIpAddress; + 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 PrivateLinkServiceProperties object itself. + */ + public PrivateLinkServiceProperties 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 PrivateLinkServiceProperties object itself. + */ + public PrivateLinkServiceProperties 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 PrivateLinkServiceProperties object itself. + */ + public PrivateLinkServiceProperties 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 PrivateLinkServiceProperties object itself. + */ + public PrivateLinkServiceProperties withEnableProxyProtocol(Boolean enableProxyProtocol) { + this.enableProxyProtocol = enableProxyProtocol; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("loadBalancerFrontendIpConfigurations", this.loadBalancerFrontendIpConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("destinationIPAddress", this.destinationIpAddress); + jsonWriter.writeJsonField("visibility", this.visibility); + jsonWriter.writeJsonField("autoApproval", this.autoApproval); + jsonWriter.writeArrayField("fqdns", this.fqdns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableProxyProtocol", this.enableProxyProtocol); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceProperties. + */ + public static PrivateLinkServiceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceProperties deserializedPrivateLinkServiceProperties = new PrivateLinkServiceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("loadBalancerFrontendIpConfigurations".equals(fieldName)) { + List loadBalancerFrontendIpConfigurations + = reader.readArray(reader1 -> FrontendIpConfigurationInner.fromJson(reader1)); + deserializedPrivateLinkServiceProperties.loadBalancerFrontendIpConfigurations + = loadBalancerFrontendIpConfigurations; + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> PrivateLinkServiceIpConfigurationInner.fromJson(reader1)); + deserializedPrivateLinkServiceProperties.ipConfigurations = ipConfigurations; + } else if ("destinationIPAddress".equals(fieldName)) { + deserializedPrivateLinkServiceProperties.destinationIpAddress = reader.getString(); + } else if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> NetworkInterfaceInner.fromJson(reader1)); + deserializedPrivateLinkServiceProperties.networkInterfaces = networkInterfaces; + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateLinkServiceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateLinkServiceProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("visibility".equals(fieldName)) { + deserializedPrivateLinkServiceProperties.visibility + = PrivateLinkServicePropertiesVisibility.fromJson(reader); + } else if ("autoApproval".equals(fieldName)) { + deserializedPrivateLinkServiceProperties.autoApproval + = PrivateLinkServicePropertiesAutoApproval.fromJson(reader); + } else if ("fqdns".equals(fieldName)) { + List fqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkServiceProperties.fqdns = fqdns; + } else if ("alias".equals(fieldName)) { + deserializedPrivateLinkServiceProperties.alias = reader.getString(); + } else if ("enableProxyProtocol".equals(fieldName)) { + deserializedPrivateLinkServiceProperties.enableProxyProtocol + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceProperties; + }); + } +} 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..c7f42bd10907e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PrivateLinkServiceVisibilityInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Response for the CheckPrivateLinkServiceVisibility API service call. + */ +@Fluent +public final class PrivateLinkServiceVisibilityInner implements JsonSerializable { + /* + * Private Link Service Visibility (True/False). + */ + private Boolean visible; + + /** + * Creates an instance of PrivateLinkServiceVisibilityInner class. + */ + public PrivateLinkServiceVisibilityInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("visible", this.visible); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceVisibilityInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceVisibilityInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceVisibilityInner. + */ + public static PrivateLinkServiceVisibilityInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceVisibilityInner deserializedPrivateLinkServiceVisibilityInner + = new PrivateLinkServiceVisibilityInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("visible".equals(fieldName)) { + deserializedPrivateLinkServiceVisibilityInner.visible = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceVisibilityInner; + }); + } +} 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..e626e186667f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbeInner.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProbeNoHealthyBackendsBehavior; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * A load balancer probe. + */ +@Fluent +public final class ProbeInner extends SubResource { + /* + * Properties of load balancer probe. + */ + private ProbePropertiesFormat innerProperties; + + /* + * 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. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ProbeInner class. + */ + public ProbeInner() { + } + + /** + * Get the innerProperties property: Properties of load balancer probe. + * + * @return the innerProperties value. + */ + private ProbePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ProbeInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the loadBalancingRules property: The load balancer rules that use this probe. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ProbePropertiesFormat(); + } + this.innerProperties().withProtocol(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ProbePropertiesFormat(); + } + this.innerProperties().withPort(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ProbePropertiesFormat(); + } + this.innerProperties().withIntervalInSeconds(intervalInSeconds); + return this; + } + + /** + * Get the noHealthyBackendsBehavior property: Determines how new connections are handled by the load balancer when + * all backend instances are probed down. + * + * @return the noHealthyBackendsBehavior value. + */ + public ProbeNoHealthyBackendsBehavior noHealthyBackendsBehavior() { + return this.innerProperties() == null ? null : this.innerProperties().noHealthyBackendsBehavior(); + } + + /** + * Set the noHealthyBackendsBehavior property: Determines how new connections are handled by the load balancer when + * all backend instances are probed down. + * + * @param noHealthyBackendsBehavior the noHealthyBackendsBehavior value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withNoHealthyBackendsBehavior(ProbeNoHealthyBackendsBehavior noHealthyBackendsBehavior) { + if (this.innerProperties() == null) { + this.innerProperties = new ProbePropertiesFormat(); + } + this.innerProperties().withNoHealthyBackendsBehavior(noHealthyBackendsBehavior); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ProbePropertiesFormat(); + } + this.innerProperties().withNumberOfProbes(numberOfProbes); + return this; + } + + /** + * Get the probeThreshold property: The number of consecutive successful or failed probes in order to allow or deny + * traffic from being delivered to this endpoint. After failing the number of consecutive probes equal to this + * value, the endpoint will be taken out of rotation and require the same number of successful consecutive probes to + * be placed back in rotation. + * + * @return the probeThreshold value. + */ + public Integer probeThreshold() { + return this.innerProperties() == null ? null : this.innerProperties().probeThreshold(); + } + + /** + * Set the probeThreshold property: The number of consecutive successful or failed probes in order to allow or deny + * traffic from being delivered to this endpoint. After failing the number of consecutive probes equal to this + * value, the endpoint will be taken out of rotation and require the same number of successful consecutive probes to + * be placed back in rotation. + * + * @param probeThreshold the probeThreshold value to set. + * @return the ProbeInner object itself. + */ + public ProbeInner withProbeThreshold(Integer probeThreshold) { + if (this.innerProperties() == null) { + this.innerProperties = new ProbePropertiesFormat(); + } + this.innerProperties().withProbeThreshold(probeThreshold); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ProbePropertiesFormat(); + } + this.innerProperties().withRequestPath(requestPath); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the probe resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProbeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProbeInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the ProbeInner. + */ + public static ProbeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProbeInner deserializedProbeInner = new ProbeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProbeInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedProbeInner.innerProperties = ProbePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedProbeInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedProbeInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProbeInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProbeInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbePropertiesFormat.java new file mode 100644 index 0000000000000..b8624179625b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ProbePropertiesFormat.java @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProbeNoHealthyBackendsBehavior; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Load balancer probe resource. + */ +@Fluent +public final class ProbePropertiesFormat implements JsonSerializable { + /* + * The load balancer rules that use this probe. + */ + 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. + */ + private ProbeProtocol protocol; + + /* + * The port for communicating the probe. Possible values range from 1 to 65535, inclusive. + */ + private int 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. + */ + private Integer intervalInSeconds; + + /* + * Determines how new connections are handled by the load balancer when all backend instances are probed down. + */ + private ProbeNoHealthyBackendsBehavior noHealthyBackendsBehavior; + + /* + * 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. + */ + private Integer numberOfProbes; + + /* + * The number of consecutive successful or failed probes in order to allow or deny traffic from being delivered to + * this endpoint. After failing the number of consecutive probes equal to this value, the endpoint will be taken out + * of rotation and require the same number of successful consecutive probes to be placed back in rotation. + */ + private Integer probeThreshold; + + /* + * 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. + */ + private String requestPath; + + /* + * The provisioning state of the probe resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ProbePropertiesFormat class. + */ + public ProbePropertiesFormat() { + } + + /** + * 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 ProbePropertiesFormat object itself. + */ + public ProbePropertiesFormat 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 int 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 ProbePropertiesFormat object itself. + */ + public ProbePropertiesFormat withPort(int 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 ProbePropertiesFormat object itself. + */ + public ProbePropertiesFormat withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the noHealthyBackendsBehavior property: Determines how new connections are handled by the load balancer when + * all backend instances are probed down. + * + * @return the noHealthyBackendsBehavior value. + */ + public ProbeNoHealthyBackendsBehavior noHealthyBackendsBehavior() { + return this.noHealthyBackendsBehavior; + } + + /** + * Set the noHealthyBackendsBehavior property: Determines how new connections are handled by the load balancer when + * all backend instances are probed down. + * + * @param noHealthyBackendsBehavior the noHealthyBackendsBehavior value to set. + * @return the ProbePropertiesFormat object itself. + */ + public ProbePropertiesFormat + withNoHealthyBackendsBehavior(ProbeNoHealthyBackendsBehavior noHealthyBackendsBehavior) { + this.noHealthyBackendsBehavior = noHealthyBackendsBehavior; + 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 ProbePropertiesFormat object itself. + */ + public ProbePropertiesFormat withNumberOfProbes(Integer numberOfProbes) { + this.numberOfProbes = numberOfProbes; + return this; + } + + /** + * Get the probeThreshold property: The number of consecutive successful or failed probes in order to allow or deny + * traffic from being delivered to this endpoint. After failing the number of consecutive probes equal to this + * value, the endpoint will be taken out of rotation and require the same number of successful consecutive probes to + * be placed back in rotation. + * + * @return the probeThreshold value. + */ + public Integer probeThreshold() { + return this.probeThreshold; + } + + /** + * Set the probeThreshold property: The number of consecutive successful or failed probes in order to allow or deny + * traffic from being delivered to this endpoint. After failing the number of consecutive probes equal to this + * value, the endpoint will be taken out of rotation and require the same number of successful consecutive probes to + * be placed back in rotation. + * + * @param probeThreshold the probeThreshold value to set. + * @return the ProbePropertiesFormat object itself. + */ + public ProbePropertiesFormat withProbeThreshold(Integer probeThreshold) { + this.probeThreshold = probeThreshold; + 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 ProbePropertiesFormat object itself. + */ + public ProbePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property protocol in model ProbePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ProbePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeIntField("port", this.port); + jsonWriter.writeNumberField("intervalInSeconds", this.intervalInSeconds); + jsonWriter.writeStringField("noHealthyBackendsBehavior", + this.noHealthyBackendsBehavior == null ? null : this.noHealthyBackendsBehavior.toString()); + jsonWriter.writeNumberField("numberOfProbes", this.numberOfProbes); + jsonWriter.writeNumberField("probeThreshold", this.probeThreshold); + jsonWriter.writeStringField("requestPath", this.requestPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProbePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProbePropertiesFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProbePropertiesFormat. + */ + public static ProbePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProbePropertiesFormat deserializedProbePropertiesFormat = new ProbePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedProbePropertiesFormat.protocol = ProbeProtocol.fromString(reader.getString()); + } else if ("port".equals(fieldName)) { + deserializedProbePropertiesFormat.port = reader.getInt(); + } else if ("loadBalancingRules".equals(fieldName)) { + List loadBalancingRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedProbePropertiesFormat.loadBalancingRules = loadBalancingRules; + } else if ("intervalInSeconds".equals(fieldName)) { + deserializedProbePropertiesFormat.intervalInSeconds = reader.getNullable(JsonReader::getInt); + } else if ("noHealthyBackendsBehavior".equals(fieldName)) { + deserializedProbePropertiesFormat.noHealthyBackendsBehavior + = ProbeNoHealthyBackendsBehavior.fromString(reader.getString()); + } else if ("numberOfProbes".equals(fieldName)) { + deserializedProbePropertiesFormat.numberOfProbes = reader.getNullable(JsonReader::getInt); + } else if ("probeThreshold".equals(fieldName)) { + deserializedProbePropertiesFormat.probeThreshold = reader.getNullable(JsonReader::getInt); + } else if ("requestPath".equals(fieldName)) { + deserializedProbePropertiesFormat.requestPath = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedProbePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProbePropertiesFormat; + }); + } +} 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..825a4c6c388e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressInner.java @@ -0,0 +1,622 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Public IP address resource. + */ +@Fluent +public final class PublicIpAddressInner extends Resource { + /* + * The extended location of the public ip address. + */ + private ExtendedLocation extendedLocation; + + /* + * The public IP address SKU. + */ + private PublicIpAddressSku sku; + + /* + * Public IP address properties. + */ + private PublicIpAddressPropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + private List zones; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of PublicIpAddressInner class. + */ + public PublicIpAddressInner() { + } + + /** + * 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 innerProperties property: Public IP address properties. + * + * @return the innerProperties value. + */ + private PublicIpAddressPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public PublicIpAddressInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PublicIpAddressInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the publicIpAllocationMethod property: The public IP address allocation method. + * + * @return the publicIpAllocationMethod value. + */ + public IpAllocationMethod publicIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withPublicIpAllocationMethod(publicIpAllocationMethod); + return this; + } + + /** + * Get the publicIpAddressVersion property: The public IP address version. + * + * @return the publicIpAddressVersion value. + */ + public IpVersion publicIpAddressVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withPublicIpAddressVersion(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withDnsSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withDdosSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withIpTags(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withIpAddress(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withPublicIpPrefix(publicIpPrefix); + return this; + } + + /** + * Get the idleTimeoutInMinutes property: The idle timeout of the public IP address. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withIdleTimeoutInMinutes(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the public IP address resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withServicePublicIpAddress(servicePublicIpAddress); + return this; + } + + /** + * Get the natGateway property: The NatGateway for the Public IP address. + * + * @return the natGateway value. + */ + public NatGatewayInner natGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withNatGateway(natGateway); + return this; + } + + /** + * Get the migrationPhase property: Migration phase of Public IP Address. + * + * @return the migrationPhase value. + */ + public PublicIpAddressMigrationPhase migrationPhase() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withMigrationPhase(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withLinkedPublicIpAddress(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpAddressPropertiesFormatInner(); + } + this.innerProperties().withDeleteOption(deleteOption); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpAddressInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpAddressInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PublicIpAddressInner. + */ + public static PublicIpAddressInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpAddressInner deserializedPublicIpAddressInner = new PublicIpAddressInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPublicIpAddressInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPublicIpAddressInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPublicIpAddressInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPublicIpAddressInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedPublicIpAddressInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedPublicIpAddressInner.sku = PublicIpAddressSku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedPublicIpAddressInner.innerProperties + = PublicIpAddressPropertiesFormatInner.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedPublicIpAddressInner.etag = reader.getString(); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedPublicIpAddressInner.zones = zones; + } else if ("id".equals(fieldName)) { + deserializedPublicIpAddressInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpAddressInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressPropertiesFormatInner.java new file mode 100644 index 0000000000000..f184691501cb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpAddressPropertiesFormatInner.java @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +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 java.io.IOException; +import java.util.List; + +/** + * Public IP address properties. + */ +@Fluent +public final class PublicIpAddressPropertiesFormatInner + implements JsonSerializable { + /* + * The public IP address allocation method. + */ + private IpAllocationMethod publicIpAllocationMethod; + + /* + * The public IP address version. + */ + private IpVersion publicIpAddressVersion; + + /* + * The IP configuration associated with the public IP address. + */ + private IpConfigurationInner ipConfiguration; + + /* + * The FQDN of the DNS record associated with the public IP address. + */ + private PublicIpAddressDnsSettings dnsSettings; + + /* + * The DDoS protection custom policy associated with the public IP address. + */ + private DdosSettings ddosSettings; + + /* + * The list of tags associated with the public IP address. + */ + private List ipTags; + + /* + * The IP address associated with the public IP address resource. + */ + private String ipAddress; + + /* + * The Public IP Prefix this Public IP Address should be allocated from. + */ + private SubResource publicIpPrefix; + + /* + * The idle timeout of the public IP address. + */ + private Integer idleTimeoutInMinutes; + + /* + * The resource GUID property of the public IP address resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the public IP address resource. + */ + private ProvisioningState provisioningState; + + /* + * The service public IP address of the public IP address resource. + */ + private PublicIpAddressInner servicePublicIpAddress; + + /* + * The NatGateway for the Public IP address. + */ + private NatGatewayInner natGateway; + + /* + * Migration phase of Public IP Address. + */ + private PublicIpAddressMigrationPhase migrationPhase; + + /* + * The linked public IP address of the public IP address resource. + */ + private PublicIpAddressInner linkedPublicIpAddress; + + /* + * Specify what happens to the public IP address when the VM using it is deleted + */ + private DeleteOptions deleteOption; + + /** + * Creates an instance of PublicIpAddressPropertiesFormatInner class. + */ + public PublicIpAddressPropertiesFormatInner() { + } + + /** + * 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner + 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner + 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner 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 PublicIpAddressPropertiesFormatInner object itself. + */ + public PublicIpAddressPropertiesFormatInner withDeleteOption(DeleteOptions deleteOption) { + this.deleteOption = deleteOption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicIPAllocationMethod", + this.publicIpAllocationMethod == null ? null : this.publicIpAllocationMethod.toString()); + jsonWriter.writeStringField("publicIPAddressVersion", + this.publicIpAddressVersion == null ? null : this.publicIpAddressVersion.toString()); + jsonWriter.writeJsonField("dnsSettings", this.dnsSettings); + jsonWriter.writeJsonField("ddosSettings", this.ddosSettings); + jsonWriter.writeArrayField("ipTags", this.ipTags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeJsonField("publicIPPrefix", this.publicIpPrefix); + jsonWriter.writeNumberField("idleTimeoutInMinutes", this.idleTimeoutInMinutes); + jsonWriter.writeJsonField("servicePublicIPAddress", this.servicePublicIpAddress); + jsonWriter.writeJsonField("natGateway", this.natGateway); + jsonWriter.writeStringField("migrationPhase", + this.migrationPhase == null ? null : this.migrationPhase.toString()); + jsonWriter.writeJsonField("linkedPublicIPAddress", this.linkedPublicIpAddress); + jsonWriter.writeStringField("deleteOption", this.deleteOption == null ? null : this.deleteOption.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpAddressPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpAddressPropertiesFormatInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpAddressPropertiesFormatInner. + */ + public static PublicIpAddressPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpAddressPropertiesFormatInner deserializedPublicIpAddressPropertiesFormatInner + = new PublicIpAddressPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPAllocationMethod".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.publicIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("publicIPAddressVersion".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.publicIpAddressVersion + = IpVersion.fromString(reader.getString()); + } else if ("ipConfiguration".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.ipConfiguration + = IpConfigurationInner.fromJson(reader); + } else if ("dnsSettings".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.dnsSettings + = PublicIpAddressDnsSettings.fromJson(reader); + } else if ("ddosSettings".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.ddosSettings = DdosSettings.fromJson(reader); + } else if ("ipTags".equals(fieldName)) { + List ipTags = reader.readArray(reader1 -> IpTag.fromJson(reader1)); + deserializedPublicIpAddressPropertiesFormatInner.ipTags = ipTags; + } else if ("ipAddress".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.ipAddress = reader.getString(); + } else if ("publicIPPrefix".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.publicIpPrefix = SubResource.fromJson(reader); + } else if ("idleTimeoutInMinutes".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.idleTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("resourceGuid".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("servicePublicIPAddress".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.servicePublicIpAddress + = PublicIpAddressInner.fromJson(reader); + } else if ("natGateway".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.natGateway = NatGatewayInner.fromJson(reader); + } else if ("migrationPhase".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.migrationPhase + = PublicIpAddressMigrationPhase.fromString(reader.getString()); + } else if ("linkedPublicIPAddress".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.linkedPublicIpAddress + = PublicIpAddressInner.fromJson(reader); + } else if ("deleteOption".equals(fieldName)) { + deserializedPublicIpAddressPropertiesFormatInner.deleteOption + = DeleteOptions.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpAddressPropertiesFormatInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpDdosProtectionStatusResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpDdosProtectionStatusResultInner.java new file mode 100644 index 0000000000000..7c5b0e759531c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpDdosProtectionStatusResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IsWorkloadProtected; +import java.io.IOException; + +/** + * Response for GetPublicIpAddressDdosProtectionStatusOperation API service call. + */ +@Fluent +public final class PublicIpDdosProtectionStatusResultInner + implements JsonSerializable { + /* + * Public IP ARM resource ID + */ + private String publicIpAddressId; + + /* + * IP Address of the Public IP Resource + */ + private String publicIpAddress; + + /* + * Value indicating whether the IP address is DDoS workload protected or not. + */ + private IsWorkloadProtected isWorkloadProtected; + + /* + * DDoS protection plan Resource Id of a if IP address is protected through a plan. + */ + private String ddosProtectionPlanId; + + /** + * Creates an instance of PublicIpDdosProtectionStatusResultInner class. + */ + public PublicIpDdosProtectionStatusResultInner() { + } + + /** + * Get the publicIpAddressId property: Public IP ARM resource ID. + * + * @return the publicIpAddressId value. + */ + public String publicIpAddressId() { + return this.publicIpAddressId; + } + + /** + * Set the publicIpAddressId property: Public IP ARM resource ID. + * + * @param publicIpAddressId the publicIpAddressId value to set. + * @return the PublicIpDdosProtectionStatusResultInner object itself. + */ + public PublicIpDdosProtectionStatusResultInner withPublicIpAddressId(String publicIpAddressId) { + this.publicIpAddressId = publicIpAddressId; + return this; + } + + /** + * Get the publicIpAddress property: IP Address of the Public IP Resource. + * + * @return the publicIpAddress value. + */ + public String publicIpAddress() { + return this.publicIpAddress; + } + + /** + * Set the publicIpAddress property: IP Address of the Public IP Resource. + * + * @param publicIpAddress the publicIpAddress value to set. + * @return the PublicIpDdosProtectionStatusResultInner object itself. + */ + public PublicIpDdosProtectionStatusResultInner withPublicIpAddress(String publicIpAddress) { + this.publicIpAddress = publicIpAddress; + return this; + } + + /** + * Get the isWorkloadProtected property: Value indicating whether the IP address is DDoS workload protected or not. + * + * @return the isWorkloadProtected value. + */ + public IsWorkloadProtected isWorkloadProtected() { + return this.isWorkloadProtected; + } + + /** + * Set the isWorkloadProtected property: Value indicating whether the IP address is DDoS workload protected or not. + * + * @param isWorkloadProtected the isWorkloadProtected value to set. + * @return the PublicIpDdosProtectionStatusResultInner object itself. + */ + public PublicIpDdosProtectionStatusResultInner withIsWorkloadProtected(IsWorkloadProtected isWorkloadProtected) { + this.isWorkloadProtected = isWorkloadProtected; + return this; + } + + /** + * Get the ddosProtectionPlanId property: DDoS protection plan Resource Id of a if IP address is protected through a + * plan. + * + * @return the ddosProtectionPlanId value. + */ + public String ddosProtectionPlanId() { + return this.ddosProtectionPlanId; + } + + /** + * Set the ddosProtectionPlanId property: DDoS protection plan Resource Id of a if IP address is protected through a + * plan. + * + * @param ddosProtectionPlanId the ddosProtectionPlanId value to set. + * @return the PublicIpDdosProtectionStatusResultInner object itself. + */ + public PublicIpDdosProtectionStatusResultInner withDdosProtectionPlanId(String ddosProtectionPlanId) { + this.ddosProtectionPlanId = ddosProtectionPlanId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicIpAddressId", this.publicIpAddressId); + jsonWriter.writeStringField("publicIpAddress", this.publicIpAddress); + jsonWriter.writeStringField("isWorkloadProtected", + this.isWorkloadProtected == null ? null : this.isWorkloadProtected.toString()); + jsonWriter.writeStringField("ddosProtectionPlanId", this.ddosProtectionPlanId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpDdosProtectionStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpDdosProtectionStatusResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpDdosProtectionStatusResultInner. + */ + public static PublicIpDdosProtectionStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpDdosProtectionStatusResultInner deserializedPublicIpDdosProtectionStatusResultInner + = new PublicIpDdosProtectionStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIpAddressId".equals(fieldName)) { + deserializedPublicIpDdosProtectionStatusResultInner.publicIpAddressId = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedPublicIpDdosProtectionStatusResultInner.publicIpAddress = reader.getString(); + } else if ("isWorkloadProtected".equals(fieldName)) { + deserializedPublicIpDdosProtectionStatusResultInner.isWorkloadProtected + = IsWorkloadProtected.fromString(reader.getString()); + } else if ("ddosProtectionPlanId".equals(fieldName)) { + deserializedPublicIpDdosProtectionStatusResultInner.ddosProtectionPlanId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpDdosProtectionStatusResultInner; + }); + } +} 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..db70cb2f1bd22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixInner.java @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Public IP prefix resource. + */ +@Fluent +public final class PublicIpPrefixInner extends Resource { + /* + * The extended location of the public ip address. + */ + private ExtendedLocation extendedLocation; + + /* + * The public IP prefix SKU. + */ + private PublicIpPrefixSku sku; + + /* + * Public IP prefix properties. + */ + private PublicIpPrefixPropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * A list of availability zones denoting the IP allocated for the resource needs to come from. + */ + private List zones; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of PublicIpPrefixInner class. + */ + public PublicIpPrefixInner() { + } + + /** + * 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 innerProperties property: Public IP prefix properties. + * + * @return the innerProperties value. + */ + private PublicIpPrefixPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public PublicIpPrefixInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PublicIpPrefixInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the publicIpAddressVersion property: The public IP address version. + * + * @return the publicIpAddressVersion value. + */ + public IpVersion publicIpAddressVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpPrefixPropertiesFormatInner(); + } + this.innerProperties().withPublicIpAddressVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpPrefixPropertiesFormatInner(); + } + this.innerProperties().withIpTags(ipTags); + return this; + } + + /** + * Get the prefixLength property: The Length of the Public IP Prefix. + * + * @return the prefixLength value. + */ + public Integer prefixLength() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpPrefixPropertiesFormatInner(); + } + this.innerProperties().withPrefixLength(prefixLength); + return this; + } + + /** + * Get the ipPrefix property: The allocated Prefix. + * + * @return the ipPrefix value. + */ + public String ipPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().ipPrefix(); + } + + /** + * Get the publicIpAddresses property: The list of all referenced PublicIPAddresses. + * + * @return the publicIpAddresses value. + */ + public List publicIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().loadBalancerFrontendIpConfiguration(); + } + + /** + * Get the customIpPrefix property: The customIpPrefix that this prefix is associated with. + * + * @return the customIpPrefix value. + */ + public SubResource customIpPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpPrefixPropertiesFormatInner(); + } + this.innerProperties().withCustomIpPrefix(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the public IP prefix resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the natGateway property: NatGateway of Public IP Prefix. + * + * @return the natGateway value. + */ + public NatGatewayInner natGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PublicIpPrefixPropertiesFormatInner(); + } + this.innerProperties().withNatGateway(natGateway); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpPrefixInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpPrefixInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PublicIpPrefixInner. + */ + public static PublicIpPrefixInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpPrefixInner deserializedPublicIpPrefixInner = new PublicIpPrefixInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPublicIpPrefixInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPublicIpPrefixInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPublicIpPrefixInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPublicIpPrefixInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedPublicIpPrefixInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedPublicIpPrefixInner.sku = PublicIpPrefixSku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedPublicIpPrefixInner.innerProperties + = PublicIpPrefixPropertiesFormatInner.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedPublicIpPrefixInner.etag = reader.getString(); + } else if ("zones".equals(fieldName)) { + List zones = reader.readArray(reader1 -> reader1.getString()); + deserializedPublicIpPrefixInner.zones = zones; + } else if ("id".equals(fieldName)) { + deserializedPublicIpPrefixInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpPrefixInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixPropertiesFormatInner.java new file mode 100644 index 0000000000000..27f684f9cbba5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/PublicIpPrefixPropertiesFormatInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.ReferencedPublicIpAddress; +import java.io.IOException; +import java.util.List; + +/** + * Public IP prefix properties. + */ +@Fluent +public final class PublicIpPrefixPropertiesFormatInner + implements JsonSerializable { + /* + * The public IP address version. + */ + private IpVersion publicIpAddressVersion; + + /* + * The list of tags associated with the public IP prefix. + */ + private List ipTags; + + /* + * The Length of the Public IP Prefix. + */ + private Integer prefixLength; + + /* + * The allocated Prefix. + */ + private String ipPrefix; + + /* + * The list of all referenced PublicIPAddresses. + */ + private List publicIpAddresses; + + /* + * The reference to load balancer frontend IP configuration associated with the public IP prefix. + */ + private SubResource loadBalancerFrontendIpConfiguration; + + /* + * The customIpPrefix that this prefix is associated with. + */ + private SubResource customIpPrefix; + + /* + * The resource GUID property of the public IP prefix resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the public IP prefix resource. + */ + private ProvisioningState provisioningState; + + /* + * NatGateway of Public IP Prefix. + */ + private NatGatewayInner natGateway; + + /** + * Creates an instance of PublicIpPrefixPropertiesFormatInner class. + */ + public PublicIpPrefixPropertiesFormatInner() { + } + + /** + * 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 PublicIpPrefixPropertiesFormatInner object itself. + */ + public PublicIpPrefixPropertiesFormatInner 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 PublicIpPrefixPropertiesFormatInner object itself. + */ + public PublicIpPrefixPropertiesFormatInner 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 PublicIpPrefixPropertiesFormatInner object itself. + */ + public PublicIpPrefixPropertiesFormatInner 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 PublicIpPrefixPropertiesFormatInner object itself. + */ + public PublicIpPrefixPropertiesFormatInner 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 PublicIpPrefixPropertiesFormatInner object itself. + */ + public PublicIpPrefixPropertiesFormatInner withNatGateway(NatGatewayInner natGateway) { + this.natGateway = natGateway; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipTags() != null) { + ipTags().forEach(e -> e.validate()); + } + if (publicIpAddresses() != null) { + publicIpAddresses().forEach(e -> e.validate()); + } + if (natGateway() != null) { + natGateway().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicIPAddressVersion", + this.publicIpAddressVersion == null ? null : this.publicIpAddressVersion.toString()); + jsonWriter.writeArrayField("ipTags", this.ipTags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("prefixLength", this.prefixLength); + jsonWriter.writeJsonField("customIPPrefix", this.customIpPrefix); + jsonWriter.writeJsonField("natGateway", this.natGateway); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpPrefixPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpPrefixPropertiesFormatInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpPrefixPropertiesFormatInner. + */ + public static PublicIpPrefixPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpPrefixPropertiesFormatInner deserializedPublicIpPrefixPropertiesFormatInner + = new PublicIpPrefixPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPAddressVersion".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.publicIpAddressVersion + = IpVersion.fromString(reader.getString()); + } else if ("ipTags".equals(fieldName)) { + List ipTags = reader.readArray(reader1 -> IpTag.fromJson(reader1)); + deserializedPublicIpPrefixPropertiesFormatInner.ipTags = ipTags; + } else if ("prefixLength".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.prefixLength + = reader.getNullable(JsonReader::getInt); + } else if ("ipPrefix".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.ipPrefix = reader.getString(); + } else if ("publicIPAddresses".equals(fieldName)) { + List publicIpAddresses + = reader.readArray(reader1 -> ReferencedPublicIpAddress.fromJson(reader1)); + deserializedPublicIpPrefixPropertiesFormatInner.publicIpAddresses = publicIpAddresses; + } else if ("loadBalancerFrontendIpConfiguration".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.loadBalancerFrontendIpConfiguration + = SubResource.fromJson(reader); + } else if ("customIPPrefix".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.customIpPrefix = SubResource.fromJson(reader); + } else if ("resourceGuid".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("natGateway".equals(fieldName)) { + deserializedPublicIpPrefixPropertiesFormatInner.natGateway = NatGatewayInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpPrefixPropertiesFormatInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/QueryResultsInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/QueryResultsInner.java new file mode 100644 index 0000000000000..419ea1a67bb10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/QueryResultsInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.SingleQueryResult; +import java.io.IOException; +import java.util.List; + +/** + * Query result. + */ +@Fluent +public final class QueryResultsInner implements JsonSerializable { + /* + * Number of total records matching the query. + */ + private Long matchingRecordsCount; + + /* + * Array containing the results of the query + */ + private List signatures; + + /** + * Creates an instance of QueryResultsInner class. + */ + public QueryResultsInner() { + } + + /** + * Get the matchingRecordsCount property: Number of total records matching the query. + * + * @return the matchingRecordsCount value. + */ + public Long matchingRecordsCount() { + return this.matchingRecordsCount; + } + + /** + * Set the matchingRecordsCount property: Number of total records matching the query. + * + * @param matchingRecordsCount the matchingRecordsCount value to set. + * @return the QueryResultsInner object itself. + */ + public QueryResultsInner withMatchingRecordsCount(Long matchingRecordsCount) { + this.matchingRecordsCount = matchingRecordsCount; + return this; + } + + /** + * Get the signatures property: Array containing the results of the query. + * + * @return the signatures value. + */ + public List signatures() { + return this.signatures; + } + + /** + * Set the signatures property: Array containing the results of the query. + * + * @param signatures the signatures value to set. + * @return the QueryResultsInner object itself. + */ + public QueryResultsInner withSignatures(List signatures) { + this.signatures = signatures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (signatures() != null) { + signatures().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("matchingRecordsCount", this.matchingRecordsCount); + jsonWriter.writeArrayField("signatures", this.signatures, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryResultsInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryResultsInner. + */ + public static QueryResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryResultsInner deserializedQueryResultsInner = new QueryResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchingRecordsCount".equals(fieldName)) { + deserializedQueryResultsInner.matchingRecordsCount = reader.getNullable(JsonReader::getLong); + } else if ("signatures".equals(fieldName)) { + List signatures + = reader.readArray(reader1 -> SingleQueryResult.fromJson(reader1)); + deserializedQueryResultsInner.signatures = signatures; + } else { + reader.skipChildren(); + } + } + + return deserializedQueryResultsInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinkFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinkFormat.java new file mode 100644 index 0000000000000..9c17c59425669 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinkFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of ResourceNavigationLink. + */ +@Fluent +public final class ResourceNavigationLinkFormat implements JsonSerializable { + /* + * Resource type of the linked resource. + */ + private String linkedResourceType; + + /* + * Link to the external resource. + */ + private String link; + + /* + * The provisioning state of the resource navigation link resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ResourceNavigationLinkFormat class. + */ + public ResourceNavigationLinkFormat() { + } + + /** + * 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 ResourceNavigationLinkFormat object itself. + */ + public ResourceNavigationLinkFormat 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 ResourceNavigationLinkFormat object itself. + */ + public ResourceNavigationLinkFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("linkedResourceType", this.linkedResourceType); + jsonWriter.writeStringField("link", this.link); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceNavigationLinkFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceNavigationLinkFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceNavigationLinkFormat. + */ + public static ResourceNavigationLinkFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceNavigationLinkFormat deserializedResourceNavigationLinkFormat = new ResourceNavigationLinkFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("linkedResourceType".equals(fieldName)) { + deserializedResourceNavigationLinkFormat.linkedResourceType = reader.getString(); + } else if ("link".equals(fieldName)) { + deserializedResourceNavigationLinkFormat.link = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedResourceNavigationLinkFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceNavigationLinkFormat; + }); + } +} 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..ca127d5f801df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ResourceNavigationLinksListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ResourceNavigationLink; +import java.io.IOException; +import java.util.List; + +/** + * Response for ResourceNavigationLinks_List operation. + */ +@Fluent +public final class ResourceNavigationLinksListResultInner + implements JsonSerializable { + /* + * The resource navigation links in a subnet. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ResourceNavigationLinksListResultInner class. + */ + public ResourceNavigationLinksListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceNavigationLinksListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceNavigationLinksListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceNavigationLinksListResultInner. + */ + public static ResourceNavigationLinksListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceNavigationLinksListResultInner deserializedResourceNavigationLinksListResultInner + = new ResourceNavigationLinksListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ResourceNavigationLink.fromJson(reader1)); + deserializedResourceNavigationLinksListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedResourceNavigationLinksListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceNavigationLinksListResultInner; + }); + } +} 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..faccb3095a752 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Route Filter Resource. + */ +@Fluent +public final class RouteFilterInner extends Resource { + /* + * Properties of the route filter. + */ + private RouteFilterPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of RouteFilterInner class. + */ + public RouteFilterInner() { + } + + /** + * Get the innerProperties property: Properties of the route filter. + * + * @return the innerProperties value. + */ + private RouteFilterPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 RouteFilterInner object itself. + */ + public RouteFilterInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteFilterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteFilterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the rules property: Collection of RouteFilterRules contained within a route filter. + * + * @return the rules value. + */ + public List rules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteFilterPropertiesFormat(); + } + this.innerProperties().withRules(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.innerProperties() == null ? null : this.innerProperties().peerings(); + } + + /** + * Get the ipv6Peerings property: A collection of references to express route circuit ipv6 peerings. + * + * @return the ipv6Peerings value. + */ + public List ipv6Peerings() { + return this.innerProperties() == null ? null : this.innerProperties().ipv6Peerings(); + } + + /** + * Get the provisioningState property: The provisioning state of the route filter resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteFilterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteFilterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RouteFilterInner. + */ + public static RouteFilterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteFilterInner deserializedRouteFilterInner = new RouteFilterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRouteFilterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRouteFilterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRouteFilterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRouteFilterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRouteFilterInner.innerProperties = RouteFilterPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedRouteFilterInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedRouteFilterInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteFilterInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterPropertiesFormat.java new file mode 100644 index 0000000000000..54aa50f59bab8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Route Filter Resource. + */ +@Fluent +public final class RouteFilterPropertiesFormat implements JsonSerializable { + /* + * Collection of RouteFilterRules contained within a route filter. + */ + private List rules; + + /* + * A collection of references to express route circuit peerings. + */ + private List peerings; + + /* + * A collection of references to express route circuit ipv6 peerings. + */ + private List ipv6Peerings; + + /* + * The provisioning state of the route filter resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RouteFilterPropertiesFormat class. + */ + public RouteFilterPropertiesFormat() { + } + + /** + * 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 RouteFilterPropertiesFormat object itself. + */ + public RouteFilterPropertiesFormat 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteFilterPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteFilterPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteFilterPropertiesFormat. + */ + public static RouteFilterPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteFilterPropertiesFormat deserializedRouteFilterPropertiesFormat = new RouteFilterPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> RouteFilterRuleInner.fromJson(reader1)); + deserializedRouteFilterPropertiesFormat.rules = rules; + } else if ("peerings".equals(fieldName)) { + List peerings + = reader.readArray(reader1 -> ExpressRouteCircuitPeeringInner.fromJson(reader1)); + deserializedRouteFilterPropertiesFormat.peerings = peerings; + } else if ("ipv6Peerings".equals(fieldName)) { + List ipv6Peerings + = reader.readArray(reader1 -> ExpressRouteCircuitPeeringInner.fromJson(reader1)); + deserializedRouteFilterPropertiesFormat.ipv6Peerings = ipv6Peerings; + } else if ("provisioningState".equals(fieldName)) { + deserializedRouteFilterPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteFilterPropertiesFormat; + }); + } +} 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..d68ba17e6f35e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRuleInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Route Filter Rule Resource. + */ +@Fluent +public final class RouteFilterRuleInner extends SubResource { + /* + * Properties of the route filter rule. + */ + private RouteFilterRulePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * Resource location. + */ + private String location; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of RouteFilterRuleInner class. + */ + public RouteFilterRuleInner() { + } + + /** + * Get the innerProperties property: Properties of the route filter rule. + * + * @return the innerProperties value. + */ + private RouteFilterRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteFilterRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the access property: The access type of the rule. + * + * @return the access value. + */ + public Access access() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteFilterRulePropertiesFormat(); + } + this.innerProperties().withAccess(access); + return this; + } + + /** + * Get the routeFilterRuleType property: The rule type of the rule. + * + * @return the routeFilterRuleType value. + */ + public RouteFilterRuleType routeFilterRuleType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteFilterRulePropertiesFormat(); + } + this.innerProperties().withRouteFilterRuleType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteFilterRulePropertiesFormat(); + } + this.innerProperties().withCommunities(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteFilterRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteFilterRuleInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteFilterRuleInner. + */ + public static RouteFilterRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteFilterRuleInner deserializedRouteFilterRuleInner = new RouteFilterRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRouteFilterRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedRouteFilterRuleInner.innerProperties = RouteFilterRulePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedRouteFilterRuleInner.name = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRouteFilterRuleInner.location = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRouteFilterRuleInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteFilterRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRulePropertiesFormat.java new file mode 100644 index 0000000000000..89c0ad21e9f6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteFilterRulePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Route Filter Rule Resource. + */ +@Fluent +public final class RouteFilterRulePropertiesFormat implements JsonSerializable { + /* + * The access type of the rule. + */ + private Access access; + + /* + * The rule type of the rule. + */ + private RouteFilterRuleType routeFilterRuleType; + + /* + * The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. + */ + private List communities; + + /* + * The provisioning state of the route filter rule resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RouteFilterRulePropertiesFormat class. + */ + public RouteFilterRulePropertiesFormat() { + } + + /** + * 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 RouteFilterRulePropertiesFormat object itself. + */ + public RouteFilterRulePropertiesFormat 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 RouteFilterRulePropertiesFormat object itself. + */ + public RouteFilterRulePropertiesFormat 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 RouteFilterRulePropertiesFormat object itself. + */ + public RouteFilterRulePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (access() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property access in model RouteFilterRulePropertiesFormat")); + } + if (routeFilterRuleType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property routeFilterRuleType in model RouteFilterRulePropertiesFormat")); + } + if (communities() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property communities in model RouteFilterRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RouteFilterRulePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("access", this.access == null ? null : this.access.toString()); + jsonWriter.writeStringField("routeFilterRuleType", + this.routeFilterRuleType == null ? null : this.routeFilterRuleType.toString()); + jsonWriter.writeArrayField("communities", this.communities, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteFilterRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteFilterRulePropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RouteFilterRulePropertiesFormat. + */ + public static RouteFilterRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteFilterRulePropertiesFormat deserializedRouteFilterRulePropertiesFormat + = new RouteFilterRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("access".equals(fieldName)) { + deserializedRouteFilterRulePropertiesFormat.access = Access.fromString(reader.getString()); + } else if ("routeFilterRuleType".equals(fieldName)) { + deserializedRouteFilterRulePropertiesFormat.routeFilterRuleType + = RouteFilterRuleType.fromString(reader.getString()); + } else if ("communities".equals(fieldName)) { + List communities = reader.readArray(reader1 -> reader1.getString()); + deserializedRouteFilterRulePropertiesFormat.communities = communities; + } else if ("provisioningState".equals(fieldName)) { + deserializedRouteFilterRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteFilterRulePropertiesFormat; + }); + } +} 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..c07c4b29b4475 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteInner.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import java.io.IOException; + +/** + * Route resource. + */ +@Fluent +public final class RouteInner extends SubResource { + /* + * Properties of the route. + */ + private RoutePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of RouteInner class. + */ + public RouteInner() { + } + + /** + * Get the innerProperties property: Properties of the route. + * + * @return the innerProperties value. + */ + private RoutePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the addressPrefix property: The destination CIDR to which the route applies. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePropertiesFormat(); + } + this.innerProperties().withAddressPrefix(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePropertiesFormat(); + } + this.innerProperties().withNextHopType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutePropertiesFormat(); + } + this.innerProperties().withNextHopIpAddress(nextHopIpAddress); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the route resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().hasBgpOverride(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the RouteInner. + */ + public static RouteInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteInner deserializedRouteInner = new RouteInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRouteInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedRouteInner.innerProperties = RoutePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedRouteInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRouteInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRouteInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapInner.java new file mode 100644 index 0000000000000..fef2667802ceb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteMapRule; +import java.io.IOException; +import java.util.List; + +/** + * The RouteMap child resource of a Virtual hub. + */ +@Fluent +public final class RouteMapInner extends SubResource { + /* + * Properties of the RouteMap resource. + */ + private RouteMapProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of RouteMapInner class. + */ + public RouteMapInner() { + } + + /** + * Get the innerProperties property: Properties of the RouteMap resource. + * + * @return the innerProperties value. + */ + private RouteMapProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteMapInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the associatedInboundConnections property: List of connections which have this RoutMap associated for inbound + * traffic. + * + * @return the associatedInboundConnections value. + */ + public List associatedInboundConnections() { + return this.innerProperties() == null ? null : this.innerProperties().associatedInboundConnections(); + } + + /** + * Set the associatedInboundConnections property: List of connections which have this RoutMap associated for inbound + * traffic. + * + * @param associatedInboundConnections the associatedInboundConnections value to set. + * @return the RouteMapInner object itself. + */ + public RouteMapInner withAssociatedInboundConnections(List associatedInboundConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteMapProperties(); + } + this.innerProperties().withAssociatedInboundConnections(associatedInboundConnections); + return this; + } + + /** + * Get the associatedOutboundConnections property: List of connections which have this RoutMap associated for + * outbound traffic. + * + * @return the associatedOutboundConnections value. + */ + public List associatedOutboundConnections() { + return this.innerProperties() == null ? null : this.innerProperties().associatedOutboundConnections(); + } + + /** + * Set the associatedOutboundConnections property: List of connections which have this RoutMap associated for + * outbound traffic. + * + * @param associatedOutboundConnections the associatedOutboundConnections value to set. + * @return the RouteMapInner object itself. + */ + public RouteMapInner withAssociatedOutboundConnections(List associatedOutboundConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteMapProperties(); + } + this.innerProperties().withAssociatedOutboundConnections(associatedOutboundConnections); + return this; + } + + /** + * Get the rules property: List of RouteMap rules to be applied. + * + * @return the rules value. + */ + public List rules() { + return this.innerProperties() == null ? null : this.innerProperties().rules(); + } + + /** + * Set the rules property: List of RouteMap rules to be applied. + * + * @param rules the rules value to set. + * @return the RouteMapInner object itself. + */ + public RouteMapInner withRules(List rules) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteMapProperties(); + } + this.innerProperties().withRules(rules); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the RouteMap resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteMapInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteMapInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteMapInner. + */ + public static RouteMapInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteMapInner deserializedRouteMapInner = new RouteMapInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRouteMapInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedRouteMapInner.innerProperties = RouteMapProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedRouteMapInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRouteMapInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRouteMapInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteMapInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapProperties.java new file mode 100644 index 0000000000000..54570af1b9706 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteMapProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteMapRule; +import java.io.IOException; +import java.util.List; + +/** + * Properties of RouteMap resource. + */ +@Fluent +public final class RouteMapProperties implements JsonSerializable { + /* + * List of connections which have this RoutMap associated for inbound traffic. + */ + private List associatedInboundConnections; + + /* + * List of connections which have this RoutMap associated for outbound traffic. + */ + private List associatedOutboundConnections; + + /* + * List of RouteMap rules to be applied. + */ + private List rules; + + /* + * The provisioning state of the RouteMap resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RouteMapProperties class. + */ + public RouteMapProperties() { + } + + /** + * Get the associatedInboundConnections property: List of connections which have this RoutMap associated for inbound + * traffic. + * + * @return the associatedInboundConnections value. + */ + public List associatedInboundConnections() { + return this.associatedInboundConnections; + } + + /** + * Set the associatedInboundConnections property: List of connections which have this RoutMap associated for inbound + * traffic. + * + * @param associatedInboundConnections the associatedInboundConnections value to set. + * @return the RouteMapProperties object itself. + */ + public RouteMapProperties withAssociatedInboundConnections(List associatedInboundConnections) { + this.associatedInboundConnections = associatedInboundConnections; + return this; + } + + /** + * Get the associatedOutboundConnections property: List of connections which have this RoutMap associated for + * outbound traffic. + * + * @return the associatedOutboundConnections value. + */ + public List associatedOutboundConnections() { + return this.associatedOutboundConnections; + } + + /** + * Set the associatedOutboundConnections property: List of connections which have this RoutMap associated for + * outbound traffic. + * + * @param associatedOutboundConnections the associatedOutboundConnections value to set. + * @return the RouteMapProperties object itself. + */ + public RouteMapProperties withAssociatedOutboundConnections(List associatedOutboundConnections) { + this.associatedOutboundConnections = associatedOutboundConnections; + return this; + } + + /** + * Get the rules property: List of RouteMap rules to be applied. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of RouteMap rules to be applied. + * + * @param rules the rules value to set. + * @return the RouteMapProperties object itself. + */ + public RouteMapProperties withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the RouteMap 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() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("associatedInboundConnections", this.associatedInboundConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("associatedOutboundConnections", this.associatedOutboundConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteMapProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteMapProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteMapProperties. + */ + public static RouteMapProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteMapProperties deserializedRouteMapProperties = new RouteMapProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("associatedInboundConnections".equals(fieldName)) { + List associatedInboundConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedRouteMapProperties.associatedInboundConnections = associatedInboundConnections; + } else if ("associatedOutboundConnections".equals(fieldName)) { + List associatedOutboundConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedRouteMapProperties.associatedOutboundConnections = associatedOutboundConnections; + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> RouteMapRule.fromJson(reader1)); + deserializedRouteMapProperties.rules = rules; + } else if ("provisioningState".equals(fieldName)) { + deserializedRouteMapProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteMapProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutePropertiesFormat.java new file mode 100644 index 0000000000000..f546bc5356497 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutePropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import java.io.IOException; + +/** + * Route resource. + */ +@Fluent +public final class RoutePropertiesFormat implements JsonSerializable { + /* + * The destination CIDR to which the route applies. + */ + private String addressPrefix; + + /* + * The type of Azure hop the packet should be sent to. + */ + 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. + */ + private String nextHopIpAddress; + + /* + * The provisioning state of the route resource. + */ + private ProvisioningState provisioningState; + + /* + * A value indicating whether this route overrides overlapping BGP routes regardless of LPM. + */ + private Boolean hasBgpOverride; + + /** + * Creates an instance of RoutePropertiesFormat class. + */ + public RoutePropertiesFormat() { + } + + /** + * 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 RoutePropertiesFormat object itself. + */ + public RoutePropertiesFormat 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 RoutePropertiesFormat object itself. + */ + public RoutePropertiesFormat 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 RoutePropertiesFormat object itself. + */ + public RoutePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nextHopType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property nextHopType in model RoutePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextHopType", this.nextHopType == null ? null : this.nextHopType.toString()); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeStringField("nextHopIpAddress", this.nextHopIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutePropertiesFormat if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutePropertiesFormat. + */ + public static RoutePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutePropertiesFormat deserializedRoutePropertiesFormat = new RoutePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextHopType".equals(fieldName)) { + deserializedRoutePropertiesFormat.nextHopType = RouteNextHopType.fromString(reader.getString()); + } else if ("addressPrefix".equals(fieldName)) { + deserializedRoutePropertiesFormat.addressPrefix = reader.getString(); + } else if ("nextHopIpAddress".equals(fieldName)) { + deserializedRoutePropertiesFormat.nextHopIpAddress = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedRoutePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("hasBgpOverride".equals(fieldName)) { + deserializedRoutePropertiesFormat.hasBgpOverride = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutePropertiesFormat; + }); + } +} 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..f9d3a19bf0c34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTableInner.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Route table resource. + */ +@Fluent +public final class RouteTableInner extends Resource { + /* + * Properties of the route table. + */ + private RouteTablePropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of RouteTableInner class. + */ + public RouteTableInner() { + } + + /** + * Get the innerProperties property: Properties of the route table. + * + * @return the innerProperties value. + */ + private RouteTablePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 RouteTableInner object itself. + */ + public RouteTableInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteTableInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RouteTableInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the routes property: Collection of routes contained within a route table. + * + * @return the routes value. + */ + public List routes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteTablePropertiesFormat(); + } + this.innerProperties().withRoutes(routes); + return this; + } + + /** + * Get the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + public List subnets() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RouteTablePropertiesFormat(); + } + this.innerProperties().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the route table resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the route table. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteTableInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteTableInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RouteTableInner. + */ + public static RouteTableInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteTableInner deserializedRouteTableInner = new RouteTableInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRouteTableInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRouteTableInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRouteTableInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRouteTableInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedRouteTableInner.innerProperties = RouteTablePropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedRouteTableInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedRouteTableInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteTableInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTablePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTablePropertiesFormat.java new file mode 100644 index 0000000000000..bd83c57de2339 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RouteTablePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Route Table resource. + */ +@Fluent +public final class RouteTablePropertiesFormat implements JsonSerializable { + /* + * Collection of routes contained within a route table. + */ + private List routes; + + /* + * A collection of references to subnets. + */ + private List subnets; + + /* + * Whether to disable the routes learned by BGP on that route table. True means disable. + */ + private Boolean disableBgpRoutePropagation; + + /* + * The provisioning state of the route table resource. + */ + private ProvisioningState provisioningState; + + /* + * The resource GUID property of the route table. + */ + private String resourceGuid; + + /** + * Creates an instance of RouteTablePropertiesFormat class. + */ + public RouteTablePropertiesFormat() { + } + + /** + * 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 RouteTablePropertiesFormat object itself. + */ + public RouteTablePropertiesFormat 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 RouteTablePropertiesFormat object itself. + */ + public RouteTablePropertiesFormat 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routes", this.routes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("disableBgpRoutePropagation", this.disableBgpRoutePropagation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteTablePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteTablePropertiesFormat if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteTablePropertiesFormat. + */ + public static RouteTablePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteTablePropertiesFormat deserializedRouteTablePropertiesFormat = new RouteTablePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routes".equals(fieldName)) { + List routes = reader.readArray(reader1 -> RouteInner.fromJson(reader1)); + deserializedRouteTablePropertiesFormat.routes = routes; + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> SubnetInner.fromJson(reader1)); + deserializedRouteTablePropertiesFormat.subnets = subnets; + } else if ("disableBgpRoutePropagation".equals(fieldName)) { + deserializedRouteTablePropertiesFormat.disableBgpRoutePropagation + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedRouteTablePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedRouteTablePropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteTablePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentInner.java new file mode 100644 index 0000000000000..00144b7af8b35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import java.io.IOException; +import java.util.List; + +/** + * The routing intent child resource of a Virtual hub. + */ +@Fluent +public final class RoutingIntentInner extends SubResource { + /* + * Properties of the RoutingIntent resource. + */ + private RoutingIntentProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of RoutingIntentInner class. + */ + public RoutingIntentInner() { + } + + /** + * Get the innerProperties property: Properties of the RoutingIntent resource. + * + * @return the innerProperties value. + */ + private RoutingIntentProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 RoutingIntentInner object itself. + */ + public RoutingIntentInner 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; + } + + /** + * {@inheritDoc} + */ + @Override + public RoutingIntentInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the routingPolicies property: List of routing policies. + * + * @return the routingPolicies value. + */ + public List routingPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().routingPolicies(); + } + + /** + * Set the routingPolicies property: List of routing policies. + * + * @param routingPolicies the routingPolicies value to set. + * @return the RoutingIntentInner object itself. + */ + public RoutingIntentInner withRoutingPolicies(List routingPolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutingIntentProperties(); + } + this.innerProperties().withRoutingPolicies(routingPolicies); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the RoutingIntent resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingIntentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingIntentInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutingIntentInner. + */ + public static RoutingIntentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingIntentInner deserializedRoutingIntentInner = new RoutingIntentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRoutingIntentInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedRoutingIntentInner.innerProperties = RoutingIntentProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedRoutingIntentInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRoutingIntentInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRoutingIntentInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingIntentInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentProperties.java new file mode 100644 index 0000000000000..63456da0518d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingIntentProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import java.io.IOException; +import java.util.List; + +/** + * The properties of a RoutingIntent resource. + */ +@Fluent +public final class RoutingIntentProperties implements JsonSerializable { + /* + * List of routing policies. + */ + private List routingPolicies; + + /* + * The provisioning state of the RoutingIntent resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of RoutingIntentProperties class. + */ + public RoutingIntentProperties() { + } + + /** + * Get the routingPolicies property: List of routing policies. + * + * @return the routingPolicies value. + */ + public List routingPolicies() { + return this.routingPolicies; + } + + /** + * Set the routingPolicies property: List of routing policies. + * + * @param routingPolicies the routingPolicies value to set. + * @return the RoutingIntentProperties object itself. + */ + public RoutingIntentProperties withRoutingPolicies(List routingPolicies) { + this.routingPolicies = routingPolicies; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the RoutingIntent 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() { + if (routingPolicies() != null) { + routingPolicies().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routingPolicies", this.routingPolicies, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingIntentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingIntentProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutingIntentProperties. + */ + public static RoutingIntentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingIntentProperties deserializedRoutingIntentProperties = new RoutingIntentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routingPolicies".equals(fieldName)) { + List routingPolicies = reader.readArray(reader1 -> RoutingPolicy.fromJson(reader1)); + deserializedRoutingIntentProperties.routingPolicies = routingPolicies; + } else if ("provisioningState".equals(fieldName)) { + deserializedRoutingIntentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingIntentProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionInner.java new file mode 100644 index 0000000000000..17c7f705d4a37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionInner.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.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.DisableBgpRoutePropagation; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingGroupItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Defines the routing rule collection. + */ +@Fluent +public final class RoutingRuleCollectionInner extends ChildResource { + /* + * Indicates the properties for the network manager routing rule collection. + */ + private RoutingRuleCollectionPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RoutingRuleCollectionInner class. + */ + public RoutingRuleCollectionInner() { + } + + /** + * Get the innerProperties property: Indicates the properties for the network manager routing rule collection. + * + * @return the innerProperties value. + */ + private RoutingRuleCollectionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the routing rule collection. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the routing rule collection. + * + * @param description the description value to set. + * @return the RoutingRuleCollectionInner object itself. + */ + public RoutingRuleCollectionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutingRuleCollectionPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the appliesTo property: Groups for configuration. + * + * @return the appliesTo value. + */ + public List appliesTo() { + return this.innerProperties() == null ? null : this.innerProperties().appliesTo(); + } + + /** + * Set the appliesTo property: Groups for configuration. + * + * @param appliesTo the appliesTo value to set. + * @return the RoutingRuleCollectionInner object itself. + */ + public RoutingRuleCollectionInner withAppliesTo(List appliesTo) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutingRuleCollectionPropertiesFormat(); + } + this.innerProperties().withAppliesTo(appliesTo); + return this; + } + + /** + * Get the disableBgpRoutePropagation property: Determines whether BGP route propagation is enabled. Defaults to + * true. + * + * @return the disableBgpRoutePropagation value. + */ + public DisableBgpRoutePropagation disableBgpRoutePropagation() { + return this.innerProperties() == null ? null : this.innerProperties().disableBgpRoutePropagation(); + } + + /** + * Set the disableBgpRoutePropagation property: Determines whether BGP route propagation is enabled. Defaults to + * true. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set. + * @return the RoutingRuleCollectionInner object itself. + */ + public RoutingRuleCollectionInner + withDisableBgpRoutePropagation(DisableBgpRoutePropagation disableBgpRoutePropagation) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutingRuleCollectionPropertiesFormat(); + } + this.innerProperties().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleCollectionInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutingRuleCollectionInner. + */ + public static RoutingRuleCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleCollectionInner deserializedRoutingRuleCollectionInner = new RoutingRuleCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRoutingRuleCollectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRoutingRuleCollectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRoutingRuleCollectionInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRoutingRuleCollectionInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRoutingRuleCollectionInner.innerProperties + = RoutingRuleCollectionPropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRoutingRuleCollectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleCollectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionPropertiesFormat.java new file mode 100644 index 0000000000000..7b75f56e38b25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleCollectionPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.DisableBgpRoutePropagation; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingGroupItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Defines the routing rule collection properties. + */ +@Fluent +public final class RoutingRuleCollectionPropertiesFormat + implements JsonSerializable { + /* + * A description of the routing rule collection. + */ + private String description; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /* + * Groups for configuration + */ + private List appliesTo; + + /* + * Determines whether BGP route propagation is enabled. Defaults to true. + */ + private DisableBgpRoutePropagation disableBgpRoutePropagation; + + /** + * Creates an instance of RoutingRuleCollectionPropertiesFormat class. + */ + public RoutingRuleCollectionPropertiesFormat() { + } + + /** + * Get the description property: A description of the routing rule collection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the routing rule collection. + * + * @param description the description value to set. + * @return the RoutingRuleCollectionPropertiesFormat object itself. + */ + public RoutingRuleCollectionPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the appliesTo property: Groups for configuration. + * + * @return the appliesTo value. + */ + public List appliesTo() { + return this.appliesTo; + } + + /** + * Set the appliesTo property: Groups for configuration. + * + * @param appliesTo the appliesTo value to set. + * @return the RoutingRuleCollectionPropertiesFormat object itself. + */ + public RoutingRuleCollectionPropertiesFormat withAppliesTo(List appliesTo) { + this.appliesTo = appliesTo; + return this; + } + + /** + * Get the disableBgpRoutePropagation property: Determines whether BGP route propagation is enabled. Defaults to + * true. + * + * @return the disableBgpRoutePropagation value. + */ + public DisableBgpRoutePropagation disableBgpRoutePropagation() { + return this.disableBgpRoutePropagation; + } + + /** + * Set the disableBgpRoutePropagation property: Determines whether BGP route propagation is enabled. Defaults to + * true. + * + * @param disableBgpRoutePropagation the disableBgpRoutePropagation value to set. + * @return the RoutingRuleCollectionPropertiesFormat object itself. + */ + public RoutingRuleCollectionPropertiesFormat + withDisableBgpRoutePropagation(DisableBgpRoutePropagation disableBgpRoutePropagation) { + this.disableBgpRoutePropagation = disableBgpRoutePropagation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appliesTo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appliesTo in model RoutingRuleCollectionPropertiesFormat")); + } else { + appliesTo().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutingRuleCollectionPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("appliesTo", this.appliesTo, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("disableBgpRoutePropagation", + this.disableBgpRoutePropagation == null ? null : this.disableBgpRoutePropagation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleCollectionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleCollectionPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutingRuleCollectionPropertiesFormat. + */ + public static RoutingRuleCollectionPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleCollectionPropertiesFormat deserializedRoutingRuleCollectionPropertiesFormat + = new RoutingRuleCollectionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appliesTo".equals(fieldName)) { + List appliesTo + = reader.readArray(reader1 -> NetworkManagerRoutingGroupItem.fromJson(reader1)); + deserializedRoutingRuleCollectionPropertiesFormat.appliesTo = appliesTo; + } else if ("description".equals(fieldName)) { + deserializedRoutingRuleCollectionPropertiesFormat.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedRoutingRuleCollectionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedRoutingRuleCollectionPropertiesFormat.resourceGuid = reader.getString(); + } else if ("disableBgpRoutePropagation".equals(fieldName)) { + deserializedRoutingRuleCollectionPropertiesFormat.disableBgpRoutePropagation + = DisableBgpRoutePropagation.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleCollectionPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleInner.java new file mode 100644 index 0000000000000..9949f0b8f0b39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRuleInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingRuleNextHop; +import com.azure.resourcemanager.network.generated.models.RoutingRuleRouteDestination; +import java.io.IOException; + +/** + * Network routing rule. + */ +@Fluent +public final class RoutingRuleInner extends ChildResource { + /* + * Indicates the properties of the routing rule + */ + private RoutingRulePropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RoutingRuleInner class. + */ + public RoutingRuleInner() { + } + + /** + * Get the innerProperties property: Indicates the properties of the routing rule. + * + * @return the innerProperties value. + */ + private RoutingRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description for this rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description for this rule. + * + * @param description the description value to set. + * @return the RoutingRuleInner object itself. + */ + public RoutingRuleInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutingRulePropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the destination property: Indicates the destination for this particular rule. + * + * @return the destination value. + */ + public RoutingRuleRouteDestination destination() { + return this.innerProperties() == null ? null : this.innerProperties().destination(); + } + + /** + * Set the destination property: Indicates the destination for this particular rule. + * + * @param destination the destination value to set. + * @return the RoutingRuleInner object itself. + */ + public RoutingRuleInner withDestination(RoutingRuleRouteDestination destination) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutingRulePropertiesFormat(); + } + this.innerProperties().withDestination(destination); + return this; + } + + /** + * Get the nextHop property: Indicates the next hop for this particular rule. + * + * @return the nextHop value. + */ + public RoutingRuleNextHop nextHop() { + return this.innerProperties() == null ? null : this.innerProperties().nextHop(); + } + + /** + * Set the nextHop property: Indicates the next hop for this particular rule. + * + * @param nextHop the nextHop value to set. + * @return the RoutingRuleInner object itself. + */ + public RoutingRuleInner withNextHop(RoutingRuleNextHop nextHop) { + if (this.innerProperties() == null) { + this.innerProperties = new RoutingRulePropertiesFormat(); + } + this.innerProperties().withNextHop(nextHop); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutingRuleInner. + */ + public static RoutingRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleInner deserializedRoutingRuleInner = new RoutingRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRoutingRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRoutingRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRoutingRuleInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRoutingRuleInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRoutingRuleInner.innerProperties = RoutingRulePropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRoutingRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRulePropertiesFormat.java new file mode 100644 index 0000000000000..bbcbc6da94e8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/RoutingRulePropertiesFormat.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingRuleNextHop; +import com.azure.resourcemanager.network.generated.models.RoutingRuleRouteDestination; +import java.io.IOException; + +/** + * Routing rule resource. + */ +@Fluent +public final class RoutingRulePropertiesFormat implements JsonSerializable { + /* + * A description for this rule. + */ + private String description; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /* + * Indicates the destination for this particular rule. + */ + private RoutingRuleRouteDestination destination; + + /* + * Indicates the next hop for this particular rule. + */ + private RoutingRuleNextHop nextHop; + + /** + * Creates an instance of RoutingRulePropertiesFormat class. + */ + public RoutingRulePropertiesFormat() { + } + + /** + * Get the description property: A description for this rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description for this rule. + * + * @param description the description value to set. + * @return the RoutingRulePropertiesFormat object itself. + */ + public RoutingRulePropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the destination property: Indicates the destination for this particular rule. + * + * @return the destination value. + */ + public RoutingRuleRouteDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Indicates the destination for this particular rule. + * + * @param destination the destination value to set. + * @return the RoutingRulePropertiesFormat object itself. + */ + public RoutingRulePropertiesFormat withDestination(RoutingRuleRouteDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the nextHop property: Indicates the next hop for this particular rule. + * + * @return the nextHop value. + */ + public RoutingRuleNextHop nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: Indicates the next hop for this particular rule. + * + * @param nextHop the nextHop value to set. + * @return the RoutingRulePropertiesFormat object itself. + */ + public RoutingRulePropertiesFormat withNextHop(RoutingRuleNextHop nextHop) { + this.nextHop = nextHop; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model RoutingRulePropertiesFormat")); + } else { + destination().validate(); + } + if (nextHop() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property nextHop in model RoutingRulePropertiesFormat")); + } else { + nextHop().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutingRulePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeJsonField("nextHop", this.nextHop); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRulePropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutingRulePropertiesFormat. + */ + public static RoutingRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRulePropertiesFormat deserializedRoutingRulePropertiesFormat = new RoutingRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destination".equals(fieldName)) { + deserializedRoutingRulePropertiesFormat.destination = RoutingRuleRouteDestination.fromJson(reader); + } else if ("nextHop".equals(fieldName)) { + deserializedRoutingRulePropertiesFormat.nextHop = RoutingRuleNextHop.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedRoutingRulePropertiesFormat.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedRoutingRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedRoutingRulePropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRulePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionInner.java new file mode 100644 index 0000000000000..7363bf79000bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionInner.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.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; +import java.io.IOException; + +/** + * The Scope Connections resource. + */ +@Fluent +public final class ScopeConnectionInner extends ChildResource { + /* + * The scope connection properties + */ + private ScopeConnectionProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ScopeConnectionInner class. + */ + public ScopeConnectionInner() { + } + + /** + * Get the innerProperties property: The scope connection properties. + * + * @return the innerProperties value. + */ + private ScopeConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the tenantId property: Tenant ID. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Set the tenantId property: Tenant ID. + * + * @param tenantId the tenantId value to set. + * @return the ScopeConnectionInner object itself. + */ + public ScopeConnectionInner withTenantId(String tenantId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeConnectionProperties(); + } + this.innerProperties().withTenantId(tenantId); + return this; + } + + /** + * Get the resourceId property: Resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); + } + + /** + * Set the resourceId property: Resource ID. + * + * @param resourceId the resourceId value to set. + * @return the ScopeConnectionInner object itself. + */ + public ScopeConnectionInner withResourceId(String resourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeConnectionProperties(); + } + this.innerProperties().withResourceId(resourceId); + return this; + } + + /** + * Get the connectionState property: Connection State. + * + * @return the connectionState value. + */ + public ScopeConnectionState connectionState() { + return this.innerProperties() == null ? null : this.innerProperties().connectionState(); + } + + /** + * Get the description property: A description of the scope connection. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the scope connection. + * + * @param description the description value to set. + * @return the ScopeConnectionInner object itself. + */ + public ScopeConnectionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeConnectionProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScopeConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScopeConnectionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScopeConnectionInner. + */ + public static ScopeConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScopeConnectionInner deserializedScopeConnectionInner = new ScopeConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedScopeConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedScopeConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedScopeConnectionInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedScopeConnectionInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedScopeConnectionInner.innerProperties = ScopeConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedScopeConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScopeConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionProperties.java new file mode 100644 index 0000000000000..98bd38b8f0379 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ScopeConnectionProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; +import java.io.IOException; + +/** + * Scope connection. + */ +@Fluent +public final class ScopeConnectionProperties implements JsonSerializable { + /* + * Tenant ID. + */ + private String tenantId; + + /* + * Resource ID. + */ + private String resourceId; + + /* + * Connection State + */ + private ScopeConnectionState connectionState; + + /* + * A description of the scope connection. + */ + private String description; + + /** + * Creates an instance of ScopeConnectionProperties class. + */ + public ScopeConnectionProperties() { + } + + /** + * Get the tenantId property: Tenant ID. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant ID. + * + * @param tenantId the tenantId value to set. + * @return the ScopeConnectionProperties object itself. + */ + public ScopeConnectionProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the resourceId property: Resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID. + * + * @param resourceId the resourceId value to set. + * @return the ScopeConnectionProperties object itself. + */ + public ScopeConnectionProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the connectionState property: Connection State. + * + * @return the connectionState value. + */ + public ScopeConnectionState connectionState() { + return this.connectionState; + } + + /** + * Get the description property: A description of the scope connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the scope connection. + * + * @param description the description value to set. + * @return the ScopeConnectionProperties object itself. + */ + public ScopeConnectionProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScopeConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScopeConnectionProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScopeConnectionProperties. + */ + public static ScopeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScopeConnectionProperties deserializedScopeConnectionProperties = new ScopeConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedScopeConnectionProperties.tenantId = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedScopeConnectionProperties.resourceId = reader.getString(); + } else if ("connectionState".equals(fieldName)) { + deserializedScopeConnectionProperties.connectionState + = ScopeConnectionState.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedScopeConnectionProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScopeConnectionProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationInner.java new file mode 100644 index 0000000000000..f39990cfa39c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.NetworkIntentPolicyBasedService; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Defines the security admin configuration. + */ +@Fluent +public final class SecurityAdminConfigurationInner extends ChildResource { + /* + * Indicates the properties for the network manager security admin configuration. + */ + private SecurityAdminConfigurationPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecurityAdminConfigurationInner class. + */ + public SecurityAdminConfigurationInner() { + } + + /** + * Get the innerProperties property: Indicates the properties for the network manager security admin configuration. + * + * @return the innerProperties value. + */ + private SecurityAdminConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the security configuration. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the security configuration. + * + * @param description the description value to set. + * @return the SecurityAdminConfigurationInner object itself. + */ + public SecurityAdminConfigurationInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAdminConfigurationPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the applyOnNetworkIntentPolicyBasedServices property: Enum list of network intent policy based services. + * + * @return the applyOnNetworkIntentPolicyBasedServices value. + */ + public List applyOnNetworkIntentPolicyBasedServices() { + return this.innerProperties() == null ? null : this.innerProperties().applyOnNetworkIntentPolicyBasedServices(); + } + + /** + * Set the applyOnNetworkIntentPolicyBasedServices property: Enum list of network intent policy based services. + * + * @param applyOnNetworkIntentPolicyBasedServices the applyOnNetworkIntentPolicyBasedServices value to set. + * @return the SecurityAdminConfigurationInner object itself. + */ + public SecurityAdminConfigurationInner withApplyOnNetworkIntentPolicyBasedServices( + List applyOnNetworkIntentPolicyBasedServices) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityAdminConfigurationPropertiesFormat(); + } + this.innerProperties().withApplyOnNetworkIntentPolicyBasedServices(applyOnNetworkIntentPolicyBasedServices); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityAdminConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityAdminConfigurationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityAdminConfigurationInner. + */ + public static SecurityAdminConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityAdminConfigurationInner deserializedSecurityAdminConfigurationInner + = new SecurityAdminConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecurityAdminConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecurityAdminConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecurityAdminConfigurationInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedSecurityAdminConfigurationInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSecurityAdminConfigurationInner.innerProperties + = SecurityAdminConfigurationPropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecurityAdminConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityAdminConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..6266a692e3df2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityAdminConfigurationPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.NetworkIntentPolicyBasedService; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Defines the security admin configuration properties. + */ +@Fluent +public final class SecurityAdminConfigurationPropertiesFormat + implements JsonSerializable { + /* + * A description of the security configuration. + */ + private String description; + + /* + * Enum list of network intent policy based services. + */ + private List applyOnNetworkIntentPolicyBasedServices; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of SecurityAdminConfigurationPropertiesFormat class. + */ + public SecurityAdminConfigurationPropertiesFormat() { + } + + /** + * Get the description property: A description of the security configuration. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the security configuration. + * + * @param description the description value to set. + * @return the SecurityAdminConfigurationPropertiesFormat object itself. + */ + public SecurityAdminConfigurationPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the applyOnNetworkIntentPolicyBasedServices property: Enum list of network intent policy based services. + * + * @return the applyOnNetworkIntentPolicyBasedServices value. + */ + public List applyOnNetworkIntentPolicyBasedServices() { + return this.applyOnNetworkIntentPolicyBasedServices; + } + + /** + * Set the applyOnNetworkIntentPolicyBasedServices property: Enum list of network intent policy based services. + * + * @param applyOnNetworkIntentPolicyBasedServices the applyOnNetworkIntentPolicyBasedServices value to set. + * @return the SecurityAdminConfigurationPropertiesFormat object itself. + */ + public SecurityAdminConfigurationPropertiesFormat withApplyOnNetworkIntentPolicyBasedServices( + List applyOnNetworkIntentPolicyBasedServices) { + this.applyOnNetworkIntentPolicyBasedServices = applyOnNetworkIntentPolicyBasedServices; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("applyOnNetworkIntentPolicyBasedServices", + this.applyOnNetworkIntentPolicyBasedServices, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityAdminConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityAdminConfigurationPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityAdminConfigurationPropertiesFormat. + */ + public static SecurityAdminConfigurationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityAdminConfigurationPropertiesFormat deserializedSecurityAdminConfigurationPropertiesFormat + = new SecurityAdminConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedSecurityAdminConfigurationPropertiesFormat.description = reader.getString(); + } else if ("applyOnNetworkIntentPolicyBasedServices".equals(fieldName)) { + List applyOnNetworkIntentPolicyBasedServices + = reader.readArray(reader1 -> NetworkIntentPolicyBasedService.fromString(reader1.getString())); + deserializedSecurityAdminConfigurationPropertiesFormat.applyOnNetworkIntentPolicyBasedServices + = applyOnNetworkIntentPolicyBasedServices; + } else if ("provisioningState".equals(fieldName)) { + deserializedSecurityAdminConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedSecurityAdminConfigurationPropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityAdminConfigurationPropertiesFormat; + }); + } +} 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..a9276162c74c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityGroupViewResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.SecurityGroupNetworkInterface; +import java.io.IOException; +import java.util.List; + +/** + * The information about security rules applied to the specified VM. + */ +@Fluent +public final class SecurityGroupViewResultInner implements JsonSerializable { + /* + * List of network interfaces on the specified VM. + */ + private List networkInterfaces; + + /** + * Creates an instance of SecurityGroupViewResultInner class. + */ + public SecurityGroupViewResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("networkInterfaces", this.networkInterfaces, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityGroupViewResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityGroupViewResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityGroupViewResultInner. + */ + public static SecurityGroupViewResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityGroupViewResultInner deserializedSecurityGroupViewResultInner = new SecurityGroupViewResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaces".equals(fieldName)) { + List networkInterfaces + = reader.readArray(reader1 -> SecurityGroupNetworkInterface.fromJson(reader1)); + deserializedSecurityGroupViewResultInner.networkInterfaces = networkInterfaces; + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityGroupViewResultInner; + }); + } +} 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..f6b537b2c3a25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.Map; + +/** + * Security Partner Provider resource. + */ +@Fluent +public final class SecurityPartnerProviderInner extends Resource { + /* + * Properties of the Security Partner Provider. + */ + private SecurityPartnerProviderPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of SecurityPartnerProviderInner class. + */ + public SecurityPartnerProviderInner() { + } + + /** + * Get the innerProperties property: Properties of the Security Partner Provider. + * + * @return the innerProperties value. + */ + private SecurityPartnerProviderPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 SecurityPartnerProviderInner object itself. + */ + public SecurityPartnerProviderInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public SecurityPartnerProviderInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SecurityPartnerProviderInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Security Partner Provider resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the securityProviderName property: The security provider name. + * + * @return the securityProviderName value. + */ + public SecurityProviderName securityProviderName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityPartnerProviderPropertiesFormat(); + } + this.innerProperties().withSecurityProviderName(securityProviderName); + return this; + } + + /** + * Get the connectionStatus property: The connection status with the Security Partner Provider. + * + * @return the connectionStatus value. + */ + public SecurityPartnerProviderConnectionStatus connectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); + } + + /** + * Get the virtualHub property: The virtualHub to which the Security Partner Provider belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityPartnerProviderPropertiesFormat(); + } + this.innerProperties().withVirtualHub(virtualHub); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPartnerProviderInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPartnerProviderInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityPartnerProviderInner. + */ + public static SecurityPartnerProviderInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPartnerProviderInner deserializedSecurityPartnerProviderInner = new SecurityPartnerProviderInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSecurityPartnerProviderInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecurityPartnerProviderInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSecurityPartnerProviderInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecurityPartnerProviderInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSecurityPartnerProviderInner.innerProperties + = SecurityPartnerProviderPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedSecurityPartnerProviderInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSecurityPartnerProviderInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPartnerProviderInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderPropertiesFormat.java new file mode 100644 index 0000000000000..29f67c1de74a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityPartnerProviderPropertiesFormat.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * Properties of the Security Partner Provider. + */ +@Fluent +public final class SecurityPartnerProviderPropertiesFormat + implements JsonSerializable { + /* + * The provisioning state of the Security Partner Provider resource. + */ + private ProvisioningState provisioningState; + + /* + * The security provider name. + */ + private SecurityProviderName securityProviderName; + + /* + * The connection status with the Security Partner Provider. + */ + private SecurityPartnerProviderConnectionStatus connectionStatus; + + /* + * The virtualHub to which the Security Partner Provider belongs. + */ + private SubResource virtualHub; + + /** + * Creates an instance of SecurityPartnerProviderPropertiesFormat class. + */ + public SecurityPartnerProviderPropertiesFormat() { + } + + /** + * 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 SecurityPartnerProviderPropertiesFormat object itself. + */ + public SecurityPartnerProviderPropertiesFormat 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 SecurityPartnerProviderPropertiesFormat object itself. + */ + public SecurityPartnerProviderPropertiesFormat withVirtualHub(SubResource virtualHub) { + this.virtualHub = virtualHub; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("securityProviderName", + this.securityProviderName == null ? null : this.securityProviderName.toString()); + jsonWriter.writeJsonField("virtualHub", this.virtualHub); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPartnerProviderPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPartnerProviderPropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPartnerProviderPropertiesFormat. + */ + public static SecurityPartnerProviderPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPartnerProviderPropertiesFormat deserializedSecurityPartnerProviderPropertiesFormat + = new SecurityPartnerProviderPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSecurityPartnerProviderPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("securityProviderName".equals(fieldName)) { + deserializedSecurityPartnerProviderPropertiesFormat.securityProviderName + = SecurityProviderName.fromString(reader.getString()); + } else if ("connectionStatus".equals(fieldName)) { + deserializedSecurityPartnerProviderPropertiesFormat.connectionStatus + = SecurityPartnerProviderConnectionStatus.fromString(reader.getString()); + } else if ("virtualHub".equals(fieldName)) { + deserializedSecurityPartnerProviderPropertiesFormat.virtualHub = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPartnerProviderPropertiesFormat; + }); + } +} 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..a0f8e10d5d60c --- /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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Network security rule. + */ +@Fluent +public final class SecurityRuleInner extends SubResource { + /* + * Properties of the security rule. + */ + private SecurityRulePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of SecurityRuleInner class. + */ + public SecurityRuleInner() { + } + + /** + * Get the innerProperties property: Properties of the security rule. + * + * @return the innerProperties value. + */ + private SecurityRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public SecurityRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withProtocol(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withSourcePortRange(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withDestinationPortRange(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withSourceAddressPrefix(sourceAddressPrefix); + return this; + } + + /** + * Get the sourceAddressPrefixes property: The CIDR or source IP ranges. + * + * @return the sourceAddressPrefixes value. + */ + public List sourceAddressPrefixes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withSourceAddressPrefixes(sourceAddressPrefixes); + return this; + } + + /** + * Get the sourceApplicationSecurityGroups property: The application security group specified as source. + * + * @return the sourceApplicationSecurityGroups value. + */ + public List sourceApplicationSecurityGroups() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withSourceApplicationSecurityGroups(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withDestinationAddressPrefix(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withDestinationAddressPrefixes(destinationAddressPrefixes); + return this; + } + + /** + * Get the destinationApplicationSecurityGroups property: The application security group specified as destination. + * + * @return the destinationApplicationSecurityGroups value. + */ + public List destinationApplicationSecurityGroups() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withDestinationApplicationSecurityGroups(destinationApplicationSecurityGroups); + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withSourcePortRanges(sourcePortRanges); + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withDestinationPortRanges(destinationPortRanges); + return this; + } + + /** + * Get the access property: The network traffic is allowed or denied. + * + * @return the access value. + */ + public SecurityRuleAccess access() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withAccess(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withPriority(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityRulePropertiesFormat(); + } + this.innerProperties().withDirection(direction); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the security rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityRuleInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityRuleInner. + */ + public static SecurityRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityRuleInner deserializedSecurityRuleInner = new SecurityRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecurityRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedSecurityRuleInner.innerProperties = SecurityRulePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedSecurityRuleInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedSecurityRuleInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecurityRuleInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRulePropertiesFormat.java new file mode 100644 index 0000000000000..af6880160c819 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityRulePropertiesFormat.java @@ -0,0 +1,575 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Security rule resource. + */ +@Fluent +public final class SecurityRulePropertiesFormat implements JsonSerializable { + /* + * A description for this rule. Restricted to 140 chars. + */ + private String description; + + /* + * Network protocol this rule applies to. + */ + private SecurityRuleProtocol protocol; + + /* + * The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. + */ + private String sourcePortRange; + + /* + * The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all + * ports. + */ + 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. + */ + private String sourceAddressPrefix; + + /* + * The CIDR or source IP ranges. + */ + private List sourceAddressPrefixes; + + /* + * The application security group specified as source. + */ + 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. + */ + private String destinationAddressPrefix; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + private List destinationAddressPrefixes; + + /* + * The application security group specified as destination. + */ + private List destinationApplicationSecurityGroups; + + /* + * The source port ranges. + */ + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + private List destinationPortRanges; + + /* + * The network traffic is allowed or denied. + */ + 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. + */ + private int priority; + + /* + * The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. + */ + private SecurityRuleDirection direction; + + /* + * The provisioning state of the security rule resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SecurityRulePropertiesFormat class. + */ + public SecurityRulePropertiesFormat() { + } + + /** + * 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat + 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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 int 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat withPriority(int 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 SecurityRulePropertiesFormat object itself. + */ + public SecurityRulePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocol in model SecurityRulePropertiesFormat")); + } + if (sourceApplicationSecurityGroups() != null) { + sourceApplicationSecurityGroups().forEach(e -> e.validate()); + } + if (destinationApplicationSecurityGroups() != null) { + destinationApplicationSecurityGroups().forEach(e -> e.validate()); + } + if (access() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property access in model SecurityRulePropertiesFormat")); + } + if (direction() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property direction in model SecurityRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityRulePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("access", this.access == null ? null : this.access.toString()); + jsonWriter.writeIntField("priority", this.priority); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("sourcePortRange", this.sourcePortRange); + jsonWriter.writeStringField("destinationPortRange", this.destinationPortRange); + jsonWriter.writeStringField("sourceAddressPrefix", this.sourceAddressPrefix); + jsonWriter.writeArrayField("sourceAddressPrefixes", this.sourceAddressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sourceApplicationSecurityGroups", this.sourceApplicationSecurityGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("destinationAddressPrefix", this.destinationAddressPrefix); + jsonWriter.writeArrayField("destinationAddressPrefixes", this.destinationAddressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationApplicationSecurityGroups", this.destinationApplicationSecurityGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sourcePortRanges", this.sourcePortRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPortRanges", this.destinationPortRanges, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityRulePropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityRulePropertiesFormat. + */ + public static SecurityRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityRulePropertiesFormat deserializedSecurityRulePropertiesFormat = new SecurityRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.protocol + = SecurityRuleProtocol.fromString(reader.getString()); + } else if ("access".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.access = SecurityRuleAccess.fromString(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.priority = reader.getInt(); + } else if ("direction".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.direction + = SecurityRuleDirection.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.description = reader.getString(); + } else if ("sourcePortRange".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.sourcePortRange = reader.getString(); + } else if ("destinationPortRange".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.destinationPortRange = reader.getString(); + } else if ("sourceAddressPrefix".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.sourceAddressPrefix = reader.getString(); + } else if ("sourceAddressPrefixes".equals(fieldName)) { + List sourceAddressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityRulePropertiesFormat.sourceAddressPrefixes = sourceAddressPrefixes; + } else if ("sourceApplicationSecurityGroups".equals(fieldName)) { + List sourceApplicationSecurityGroups + = reader.readArray(reader1 -> ApplicationSecurityGroupInner.fromJson(reader1)); + deserializedSecurityRulePropertiesFormat.sourceApplicationSecurityGroups + = sourceApplicationSecurityGroups; + } else if ("destinationAddressPrefix".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.destinationAddressPrefix = reader.getString(); + } else if ("destinationAddressPrefixes".equals(fieldName)) { + List destinationAddressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityRulePropertiesFormat.destinationAddressPrefixes = destinationAddressPrefixes; + } else if ("destinationApplicationSecurityGroups".equals(fieldName)) { + List destinationApplicationSecurityGroups + = reader.readArray(reader1 -> ApplicationSecurityGroupInner.fromJson(reader1)); + deserializedSecurityRulePropertiesFormat.destinationApplicationSecurityGroups + = destinationApplicationSecurityGroups; + } else if ("sourcePortRanges".equals(fieldName)) { + List sourcePortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityRulePropertiesFormat.sourcePortRanges = sourcePortRanges; + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityRulePropertiesFormat.destinationPortRanges = destinationPortRanges; + } else if ("provisioningState".equals(fieldName)) { + deserializedSecurityRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityRulePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationInner.java new file mode 100644 index 0000000000000..483a9d13006f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationInner.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.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Defines the security user configuration. + */ +@Fluent +public final class SecurityUserConfigurationInner extends ChildResource { + /* + * Indicates the properties for the network manager security user configuration. + */ + private SecurityUserConfigurationPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecurityUserConfigurationInner class. + */ + public SecurityUserConfigurationInner() { + } + + /** + * Get the innerProperties property: Indicates the properties for the network manager security user configuration. + * + * @return the innerProperties value. + */ + private SecurityUserConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the security user configuration. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the security user configuration. + * + * @param description the description value to set. + * @return the SecurityUserConfigurationInner object itself. + */ + public SecurityUserConfigurationInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserConfigurationPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserConfigurationInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityUserConfigurationInner. + */ + public static SecurityUserConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserConfigurationInner deserializedSecurityUserConfigurationInner + = new SecurityUserConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecurityUserConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecurityUserConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecurityUserConfigurationInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedSecurityUserConfigurationInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSecurityUserConfigurationInner.innerProperties + = SecurityUserConfigurationPropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecurityUserConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..7a357dda121ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserConfigurationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Defines the security user configuration properties. + */ +@Fluent +public final class SecurityUserConfigurationPropertiesFormat + implements JsonSerializable { + /* + * A description of the security user configuration. + */ + private String description; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of SecurityUserConfigurationPropertiesFormat class. + */ + public SecurityUserConfigurationPropertiesFormat() { + } + + /** + * Get the description property: A description of the security user configuration. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the security user configuration. + * + * @param description the description value to set. + * @return the SecurityUserConfigurationPropertiesFormat object itself. + */ + public SecurityUserConfigurationPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserConfigurationPropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityUserConfigurationPropertiesFormat. + */ + public static SecurityUserConfigurationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserConfigurationPropertiesFormat deserializedSecurityUserConfigurationPropertiesFormat + = new SecurityUserConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedSecurityUserConfigurationPropertiesFormat.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSecurityUserConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedSecurityUserConfigurationPropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserConfigurationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionInner.java new file mode 100644 index 0000000000000..7cfc0354d293a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft 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.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityUserGroupItem; +import java.io.IOException; +import java.util.List; + +/** + * Defines the security user rule collection. + */ +@Fluent +public final class SecurityUserRuleCollectionInner extends ChildResource { + /* + * Indicates the properties for the network manager security user rule collection. + */ + private SecurityUserRuleCollectionPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecurityUserRuleCollectionInner class. + */ + public SecurityUserRuleCollectionInner() { + } + + /** + * Get the innerProperties property: Indicates the properties for the network manager security user rule collection. + * + * @return the innerProperties value. + */ + private SecurityUserRuleCollectionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description of the security user rule collection. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the security user rule collection. + * + * @param description the description value to set. + * @return the SecurityUserRuleCollectionInner object itself. + */ + public SecurityUserRuleCollectionInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRuleCollectionPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.innerProperties() == null ? null : this.innerProperties().appliesToGroups(); + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the SecurityUserRuleCollectionInner object itself. + */ + public SecurityUserRuleCollectionInner withAppliesToGroups(List appliesToGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRuleCollectionPropertiesFormat(); + } + this.innerProperties().withAppliesToGroups(appliesToGroups); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserRuleCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserRuleCollectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityUserRuleCollectionInner. + */ + public static SecurityUserRuleCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserRuleCollectionInner deserializedSecurityUserRuleCollectionInner + = new SecurityUserRuleCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecurityUserRuleCollectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecurityUserRuleCollectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecurityUserRuleCollectionInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedSecurityUserRuleCollectionInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSecurityUserRuleCollectionInner.innerProperties + = SecurityUserRuleCollectionPropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecurityUserRuleCollectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserRuleCollectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionPropertiesFormat.java new file mode 100644 index 0000000000000..0db095c6fca40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleCollectionPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityUserGroupItem; +import java.io.IOException; +import java.util.List; + +/** + * Defines the security user rule collection properties. + */ +@Fluent +public final class SecurityUserRuleCollectionPropertiesFormat + implements JsonSerializable { + /* + * A description of the security user rule collection. + */ + private String description; + + /* + * Groups for configuration + */ + private List appliesToGroups; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of SecurityUserRuleCollectionPropertiesFormat class. + */ + public SecurityUserRuleCollectionPropertiesFormat() { + } + + /** + * Get the description property: A description of the security user rule collection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description of the security user rule collection. + * + * @param description the description value to set. + * @return the SecurityUserRuleCollectionPropertiesFormat object itself. + */ + public SecurityUserRuleCollectionPropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.appliesToGroups; + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the SecurityUserRuleCollectionPropertiesFormat object itself. + */ + public SecurityUserRuleCollectionPropertiesFormat withAppliesToGroups(List appliesToGroups) { + this.appliesToGroups = appliesToGroups; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appliesToGroups() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property appliesToGroups in model SecurityUserRuleCollectionPropertiesFormat")); + } else { + appliesToGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityUserRuleCollectionPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("appliesToGroups", this.appliesToGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserRuleCollectionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserRuleCollectionPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityUserRuleCollectionPropertiesFormat. + */ + public static SecurityUserRuleCollectionPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserRuleCollectionPropertiesFormat deserializedSecurityUserRuleCollectionPropertiesFormat + = new SecurityUserRuleCollectionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appliesToGroups".equals(fieldName)) { + List appliesToGroups + = reader.readArray(reader1 -> SecurityUserGroupItem.fromJson(reader1)); + deserializedSecurityUserRuleCollectionPropertiesFormat.appliesToGroups = appliesToGroups; + } else if ("description".equals(fieldName)) { + deserializedSecurityUserRuleCollectionPropertiesFormat.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSecurityUserRuleCollectionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedSecurityUserRuleCollectionPropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserRuleCollectionPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleInner.java new file mode 100644 index 0000000000000..7671ecb155d11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRuleInner.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft 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.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.io.IOException; +import java.util.List; + +/** + * Network security user rule. + */ +@Fluent +public final class SecurityUserRuleInner extends ChildResource { + /* + * Indicates the properties of the security user rule + */ + private SecurityUserRulePropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SecurityUserRuleInner class. + */ + public SecurityUserRuleInner() { + } + + /** + * Get the innerProperties property: Indicates the properties of the security user rule. + * + * @return the innerProperties value. + */ + private SecurityUserRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description for this rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description for this rule. + * + * @param description the description value to set. + * @return the SecurityUserRuleInner object itself. + */ + public SecurityUserRuleInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRulePropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Set the protocol property: Network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the SecurityUserRuleInner object itself. + */ + public SecurityUserRuleInner withProtocol(SecurityConfigurationRuleProtocol protocol) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRulePropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.innerProperties() == null ? null : this.innerProperties().sources(); + } + + /** + * Set the sources property: The CIDR or source IP ranges. + * + * @param sources the sources value to set. + * @return the SecurityUserRuleInner object itself. + */ + public SecurityUserRuleInner withSources(List sources) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRulePropertiesFormat(); + } + this.innerProperties().withSources(sources); + return this; + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.innerProperties() == null ? null : this.innerProperties().destinations(); + } + + /** + * Set the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @param destinations the destinations value to set. + * @return the SecurityUserRuleInner object itself. + */ + public SecurityUserRuleInner withDestinations(List destinations) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRulePropertiesFormat(); + } + this.innerProperties().withDestinations(destinations); + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); + } + + /** + * Set the sourcePortRanges property: The source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the SecurityUserRuleInner object itself. + */ + public SecurityUserRuleInner withSourcePortRanges(List sourcePortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRulePropertiesFormat(); + } + this.innerProperties().withSourcePortRanges(sourcePortRanges); + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); + } + + /** + * Set the destinationPortRanges property: The destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the SecurityUserRuleInner object itself. + */ + public SecurityUserRuleInner withDestinationPortRanges(List destinationPortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRulePropertiesFormat(); + } + this.innerProperties().withDestinationPortRanges(destinationPortRanges); + return this; + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.innerProperties() == null ? null : this.innerProperties().direction(); + } + + /** + * Set the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @param direction the direction value to set. + * @return the SecurityUserRuleInner object itself. + */ + public SecurityUserRuleInner withDirection(SecurityConfigurationRuleDirection direction) { + if (this.innerProperties() == null) { + this.innerProperties = new SecurityUserRulePropertiesFormat(); + } + this.innerProperties().withDirection(direction); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the security configuration user rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserRuleInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityUserRuleInner. + */ + public static SecurityUserRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserRuleInner deserializedSecurityUserRuleInner = new SecurityUserRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecurityUserRuleInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecurityUserRuleInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecurityUserRuleInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedSecurityUserRuleInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSecurityUserRuleInner.innerProperties + = SecurityUserRulePropertiesFormat.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSecurityUserRuleInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRulePropertiesFormat.java new file mode 100644 index 0000000000000..ab1accf36703f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SecurityUserRulePropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.io.IOException; +import java.util.List; + +/** + * Security rule resource. + */ +@Fluent +public final class SecurityUserRulePropertiesFormat implements JsonSerializable { + /* + * A description for this rule. + */ + private String description; + + /* + * Network protocol this rule applies to. + */ + private SecurityConfigurationRuleProtocol protocol; + + /* + * The CIDR or source IP ranges. + */ + private List sources; + + /* + * The destination address prefixes. CIDR or destination IP ranges. + */ + private List destinations; + + /* + * The source port ranges. + */ + private List sourcePortRanges; + + /* + * The destination port ranges. + */ + private List destinationPortRanges; + + /* + * Indicates if the traffic matched against the rule in inbound or outbound. + */ + private SecurityConfigurationRuleDirection direction; + + /* + * The provisioning state of the security configuration user rule resource. + */ + private ProvisioningState provisioningState; + + /* + * Unique identifier for this resource. + */ + private String resourceGuid; + + /** + * Creates an instance of SecurityUserRulePropertiesFormat class. + */ + public SecurityUserRulePropertiesFormat() { + } + + /** + * Get the description property: A description for this rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description for this rule. + * + * @param description the description value to set. + * @return the SecurityUserRulePropertiesFormat object itself. + */ + public SecurityUserRulePropertiesFormat withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the SecurityUserRulePropertiesFormat object itself. + */ + public SecurityUserRulePropertiesFormat withProtocol(SecurityConfigurationRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Set the sources property: The CIDR or source IP ranges. + * + * @param sources the sources value to set. + * @return the SecurityUserRulePropertiesFormat object itself. + */ + public SecurityUserRulePropertiesFormat withSources(List sources) { + this.sources = sources; + return this; + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @param destinations the destinations value to set. + * @return the SecurityUserRulePropertiesFormat object itself. + */ + public SecurityUserRulePropertiesFormat withDestinations(List destinations) { + this.destinations = destinations; + 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 SecurityUserRulePropertiesFormat object itself. + */ + public SecurityUserRulePropertiesFormat 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 SecurityUserRulePropertiesFormat object itself. + */ + public SecurityUserRulePropertiesFormat withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @param direction the direction value to set. + * @return the SecurityUserRulePropertiesFormat object itself. + */ + public SecurityUserRulePropertiesFormat withDirection(SecurityConfigurationRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the security configuration user rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocol in model SecurityUserRulePropertiesFormat")); + } + if (sources() != null) { + sources().forEach(e -> e.validate()); + } + if (destinations() != null) { + destinations().forEach(e -> e.validate()); + } + if (direction() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property direction in model SecurityUserRulePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityUserRulePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sourcePortRanges", this.sourcePortRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPortRanges", this.destinationPortRanges, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserRulePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserRulePropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityUserRulePropertiesFormat. + */ + public static SecurityUserRulePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserRulePropertiesFormat deserializedSecurityUserRulePropertiesFormat + = new SecurityUserRulePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedSecurityUserRulePropertiesFormat.protocol + = SecurityConfigurationRuleProtocol.fromString(reader.getString()); + } else if ("direction".equals(fieldName)) { + deserializedSecurityUserRulePropertiesFormat.direction + = SecurityConfigurationRuleDirection.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedSecurityUserRulePropertiesFormat.description = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> AddressPrefixItem.fromJson(reader1)); + deserializedSecurityUserRulePropertiesFormat.sources = sources; + } else if ("destinations".equals(fieldName)) { + List destinations + = reader.readArray(reader1 -> AddressPrefixItem.fromJson(reader1)); + deserializedSecurityUserRulePropertiesFormat.destinations = destinations; + } else if ("sourcePortRanges".equals(fieldName)) { + List sourcePortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityUserRulePropertiesFormat.sourcePortRanges = sourcePortRanges; + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedSecurityUserRulePropertiesFormat.destinationPortRanges = destinationPortRanges; + } else if ("provisioningState".equals(fieldName)) { + deserializedSecurityUserRulePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceGuid".equals(fieldName)) { + deserializedSecurityUserRulePropertiesFormat.resourceGuid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserRulePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinkPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinkPropertiesFormat.java new file mode 100644 index 0000000000000..006b4460396f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinkPropertiesFormat.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of ServiceAssociationLink. + */ +@Fluent +public final class ServiceAssociationLinkPropertiesFormat + implements JsonSerializable { + /* + * Resource type of the linked resource. + */ + private String linkedResourceType; + + /* + * Link to the external resource. + */ + private String link; + + /* + * The provisioning state of the service association link resource. + */ + private ProvisioningState provisioningState; + + /* + * If true, the resource can be deleted. + */ + private Boolean allowDelete; + + /* + * A list of locations. + */ + private List locations; + + /** + * Creates an instance of ServiceAssociationLinkPropertiesFormat class. + */ + public ServiceAssociationLinkPropertiesFormat() { + } + + /** + * 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 ServiceAssociationLinkPropertiesFormat object itself. + */ + public ServiceAssociationLinkPropertiesFormat 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 ServiceAssociationLinkPropertiesFormat object itself. + */ + public ServiceAssociationLinkPropertiesFormat 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 ServiceAssociationLinkPropertiesFormat object itself. + */ + public ServiceAssociationLinkPropertiesFormat 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 ServiceAssociationLinkPropertiesFormat object itself. + */ + public ServiceAssociationLinkPropertiesFormat withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("linkedResourceType", this.linkedResourceType); + jsonWriter.writeStringField("link", this.link); + jsonWriter.writeBooleanField("allowDelete", this.allowDelete); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceAssociationLinkPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceAssociationLinkPropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceAssociationLinkPropertiesFormat. + */ + public static ServiceAssociationLinkPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceAssociationLinkPropertiesFormat deserializedServiceAssociationLinkPropertiesFormat + = new ServiceAssociationLinkPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("linkedResourceType".equals(fieldName)) { + deserializedServiceAssociationLinkPropertiesFormat.linkedResourceType = reader.getString(); + } else if ("link".equals(fieldName)) { + deserializedServiceAssociationLinkPropertiesFormat.link = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedServiceAssociationLinkPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("allowDelete".equals(fieldName)) { + deserializedServiceAssociationLinkPropertiesFormat.allowDelete + = reader.getNullable(JsonReader::getBoolean); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceAssociationLinkPropertiesFormat.locations = locations; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceAssociationLinkPropertiesFormat; + }); + } +} 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..57e5f8a5e01e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceAssociationLinksListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ServiceAssociationLink; +import java.io.IOException; +import java.util.List; + +/** + * Response for ServiceAssociationLinks_List operation. + */ +@Fluent +public final class ServiceAssociationLinksListResultInner + implements JsonSerializable { + /* + * The service association links in a subnet. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ServiceAssociationLinksListResultInner class. + */ + public ServiceAssociationLinksListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceAssociationLinksListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceAssociationLinksListResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceAssociationLinksListResultInner. + */ + public static ServiceAssociationLinksListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceAssociationLinksListResultInner deserializedServiceAssociationLinksListResultInner + = new ServiceAssociationLinksListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServiceAssociationLink.fromJson(reader1)); + deserializedServiceAssociationLinksListResultInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServiceAssociationLinksListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceAssociationLinksListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceDelegationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceDelegationPropertiesFormat.java new file mode 100644 index 0000000000000..0b62e70df80c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceDelegationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a service delegation. + */ +@Fluent +public final class ServiceDelegationPropertiesFormat implements JsonSerializable { + /* + * The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). + */ + private String serviceName; + + /* + * The actions permitted to the service upon delegation. + */ + private List actions; + + /* + * The provisioning state of the service delegation resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ServiceDelegationPropertiesFormat class. + */ + public ServiceDelegationPropertiesFormat() { + } + + /** + * 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 ServiceDelegationPropertiesFormat object itself. + */ + public ServiceDelegationPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceName", this.serviceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceDelegationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceDelegationPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceDelegationPropertiesFormat. + */ + public static ServiceDelegationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceDelegationPropertiesFormat deserializedServiceDelegationPropertiesFormat + = new ServiceDelegationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedServiceDelegationPropertiesFormat.serviceName = reader.getString(); + } else if ("actions".equals(fieldName)) { + List actions = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceDelegationPropertiesFormat.actions = actions; + } else if ("provisioningState".equals(fieldName)) { + deserializedServiceDelegationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceDelegationPropertiesFormat; + }); + } +} 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..2cb0acff6996e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Service Endpoint policy definitions. + */ +@Fluent +public final class ServiceEndpointPolicyDefinitionInner extends SubResource { + /* + * Properties of the service endpoint policy definition. + */ + private ServiceEndpointPolicyDefinitionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /** + * Creates an instance of ServiceEndpointPolicyDefinitionInner class. + */ + public ServiceEndpointPolicyDefinitionInner() { + } + + /** + * Get the innerProperties property: Properties of the service endpoint policy definition. + * + * @return the innerProperties value. + */ + private ServiceEndpointPolicyDefinitionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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 ServiceEndpointPolicyDefinitionInner object itself. + */ + public ServiceEndpointPolicyDefinitionInner withType(String type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceEndpointPolicyDefinitionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceEndpointPolicyDefinitionPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the service property: Service endpoint name. + * + * @return the service value. + */ + public String service() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceEndpointPolicyDefinitionPropertiesFormat(); + } + this.innerProperties().withService(service); + return this; + } + + /** + * Get the serviceResources property: A list of service resources. + * + * @return the serviceResources value. + */ + public List serviceResources() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceEndpointPolicyDefinitionPropertiesFormat(); + } + this.innerProperties().withServiceResources(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceEndpointPolicyDefinitionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceEndpointPolicyDefinitionInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceEndpointPolicyDefinitionInner. + */ + public static ServiceEndpointPolicyDefinitionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceEndpointPolicyDefinitionInner deserializedServiceEndpointPolicyDefinitionInner + = new ServiceEndpointPolicyDefinitionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionInner.innerProperties + = ServiceEndpointPolicyDefinitionPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceEndpointPolicyDefinitionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.java new file mode 100644 index 0000000000000..80c4db210a9e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyDefinitionPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Service Endpoint policy definition resource. + */ +@Fluent +public final class ServiceEndpointPolicyDefinitionPropertiesFormat + implements JsonSerializable { + /* + * A description for this rule. Restricted to 140 chars. + */ + private String description; + + /* + * Service endpoint name. + */ + private String service; + + /* + * A list of service resources. + */ + private List serviceResources; + + /* + * The provisioning state of the service endpoint policy definition resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ServiceEndpointPolicyDefinitionPropertiesFormat class. + */ + public ServiceEndpointPolicyDefinitionPropertiesFormat() { + } + + /** + * 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 ServiceEndpointPolicyDefinitionPropertiesFormat object itself. + */ + public ServiceEndpointPolicyDefinitionPropertiesFormat 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 ServiceEndpointPolicyDefinitionPropertiesFormat object itself. + */ + public ServiceEndpointPolicyDefinitionPropertiesFormat 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 ServiceEndpointPolicyDefinitionPropertiesFormat object itself. + */ + public ServiceEndpointPolicyDefinitionPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("service", this.service); + jsonWriter.writeArrayField("serviceResources", this.serviceResources, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceEndpointPolicyDefinitionPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceEndpointPolicyDefinitionPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceEndpointPolicyDefinitionPropertiesFormat. + */ + public static ServiceEndpointPolicyDefinitionPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceEndpointPolicyDefinitionPropertiesFormat deserializedServiceEndpointPolicyDefinitionPropertiesFormat + = new ServiceEndpointPolicyDefinitionPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionPropertiesFormat.description = reader.getString(); + } else if ("service".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionPropertiesFormat.service = reader.getString(); + } else if ("serviceResources".equals(fieldName)) { + List serviceResources = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceEndpointPolicyDefinitionPropertiesFormat.serviceResources = serviceResources; + } else if ("provisioningState".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceEndpointPolicyDefinitionPropertiesFormat; + }); + } +} 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..04567fa40aacc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Service End point policy resource. + */ +@Fluent +public final class ServiceEndpointPolicyInner extends Resource { + /* + * Properties of the service end point policy. + */ + private ServiceEndpointPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Kind of service endpoint policy. This is metadata used for the Azure portal experience. + */ + private String kind; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ServiceEndpointPolicyInner class. + */ + public ServiceEndpointPolicyInner() { + } + + /** + * Get the innerProperties property: Properties of the service end point policy. + * + * @return the innerProperties value. + */ + private ServiceEndpointPolicyPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceEndpointPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceEndpointPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceEndpointPolicyPropertiesFormat(); + } + this.innerProperties().withServiceEndpointPolicyDefinitions(serviceEndpointPolicyDefinitions); + return this; + } + + /** + * Get the subnets property: A collection of references to subnets. + * + * @return the subnets value. + */ + public List subnets() { + return this.innerProperties() == null ? null : this.innerProperties().subnets(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the service endpoint policy resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the service endpoint policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the serviceAlias property: The alias indicating if the policy belongs to a service. + * + * @return the serviceAlias value. + */ + public String serviceAlias() { + return this.innerProperties() == null ? null : this.innerProperties().serviceAlias(); + } + + /** + * Set the serviceAlias property: The alias indicating if the policy belongs to a service. + * + * @param serviceAlias the serviceAlias value to set. + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner withServiceAlias(String serviceAlias) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceEndpointPolicyPropertiesFormat(); + } + this.innerProperties().withServiceAlias(serviceAlias); + return this; + } + + /** + * Get the contextualServiceEndpointPolicies property: A collection of contextual service endpoint policy. + * + * @return the contextualServiceEndpointPolicies value. + */ + public List contextualServiceEndpointPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().contextualServiceEndpointPolicies(); + } + + /** + * Set the contextualServiceEndpointPolicies property: A collection of contextual service endpoint policy. + * + * @param contextualServiceEndpointPolicies the contextualServiceEndpointPolicies value to set. + * @return the ServiceEndpointPolicyInner object itself. + */ + public ServiceEndpointPolicyInner + withContextualServiceEndpointPolicies(List contextualServiceEndpointPolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceEndpointPolicyPropertiesFormat(); + } + this.innerProperties().withContextualServiceEndpointPolicies(contextualServiceEndpointPolicies); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceEndpointPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceEndpointPolicyInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ServiceEndpointPolicyInner. + */ + public static ServiceEndpointPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceEndpointPolicyInner deserializedServiceEndpointPolicyInner = new ServiceEndpointPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedServiceEndpointPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServiceEndpointPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedServiceEndpointPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedServiceEndpointPolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedServiceEndpointPolicyInner.innerProperties + = ServiceEndpointPolicyPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedServiceEndpointPolicyInner.etag = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedServiceEndpointPolicyInner.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedServiceEndpointPolicyInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceEndpointPolicyInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyPropertiesFormat.java new file mode 100644 index 0000000000000..e2e077d9b0577 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceEndpointPolicyPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Service Endpoint Policy resource. + */ +@Fluent +public final class ServiceEndpointPolicyPropertiesFormat + implements JsonSerializable { + /* + * A collection of service endpoint policy definitions of the service endpoint policy. + */ + private List serviceEndpointPolicyDefinitions; + + /* + * A collection of references to subnets. + */ + private List subnets; + + /* + * The resource GUID property of the service endpoint policy resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the service endpoint policy resource. + */ + private ProvisioningState provisioningState; + + /* + * The alias indicating if the policy belongs to a service + */ + private String serviceAlias; + + /* + * A collection of contextual service endpoint policy. + */ + private List contextualServiceEndpointPolicies; + + /** + * Creates an instance of ServiceEndpointPolicyPropertiesFormat class. + */ + public ServiceEndpointPolicyPropertiesFormat() { + } + + /** + * 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 ServiceEndpointPolicyPropertiesFormat object itself. + */ + public ServiceEndpointPolicyPropertiesFormat 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 serviceAlias property: The alias indicating if the policy belongs to a service. + * + * @return the serviceAlias value. + */ + public String serviceAlias() { + return this.serviceAlias; + } + + /** + * Set the serviceAlias property: The alias indicating if the policy belongs to a service. + * + * @param serviceAlias the serviceAlias value to set. + * @return the ServiceEndpointPolicyPropertiesFormat object itself. + */ + public ServiceEndpointPolicyPropertiesFormat withServiceAlias(String serviceAlias) { + this.serviceAlias = serviceAlias; + return this; + } + + /** + * Get the contextualServiceEndpointPolicies property: A collection of contextual service endpoint policy. + * + * @return the contextualServiceEndpointPolicies value. + */ + public List contextualServiceEndpointPolicies() { + return this.contextualServiceEndpointPolicies; + } + + /** + * Set the contextualServiceEndpointPolicies property: A collection of contextual service endpoint policy. + * + * @param contextualServiceEndpointPolicies the contextualServiceEndpointPolicies value to set. + * @return the ServiceEndpointPolicyPropertiesFormat object itself. + */ + public ServiceEndpointPolicyPropertiesFormat + withContextualServiceEndpointPolicies(List contextualServiceEndpointPolicies) { + this.contextualServiceEndpointPolicies = contextualServiceEndpointPolicies; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("serviceEndpointPolicyDefinitions", this.serviceEndpointPolicyDefinitions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("serviceAlias", this.serviceAlias); + jsonWriter.writeArrayField("contextualServiceEndpointPolicies", this.contextualServiceEndpointPolicies, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceEndpointPolicyPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceEndpointPolicyPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceEndpointPolicyPropertiesFormat. + */ + public static ServiceEndpointPolicyPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceEndpointPolicyPropertiesFormat deserializedServiceEndpointPolicyPropertiesFormat + = new ServiceEndpointPolicyPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceEndpointPolicyDefinitions".equals(fieldName)) { + List serviceEndpointPolicyDefinitions + = reader.readArray(reader1 -> ServiceEndpointPolicyDefinitionInner.fromJson(reader1)); + deserializedServiceEndpointPolicyPropertiesFormat.serviceEndpointPolicyDefinitions + = serviceEndpointPolicyDefinitions; + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> SubnetInner.fromJson(reader1)); + deserializedServiceEndpointPolicyPropertiesFormat.subnets = subnets; + } else if ("resourceGuid".equals(fieldName)) { + deserializedServiceEndpointPolicyPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedServiceEndpointPolicyPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("serviceAlias".equals(fieldName)) { + deserializedServiceEndpointPolicyPropertiesFormat.serviceAlias = reader.getString(); + } else if ("contextualServiceEndpointPolicies".equals(fieldName)) { + List contextualServiceEndpointPolicies = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceEndpointPolicyPropertiesFormat.contextualServiceEndpointPolicies + = contextualServiceEndpointPolicies; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceEndpointPolicyPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagInformationInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagInformationInner.java new file mode 100644 index 0000000000000..a29a112c65307 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagInformationInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformationPropertiesFormat; +import java.io.IOException; + +/** + * The service tag information. + */ +@Immutable +public final class ServiceTagInformationInner implements JsonSerializable { + /* + * Properties of the service tag information. + */ + private ServiceTagInformationPropertiesFormat properties; + + /* + * The name of service tag. + */ + private String name; + + /* + * The ID of service tag. + */ + private String id; + + /* + * The iteration number of service tag object for region. + */ + private String serviceTagChangeNumber; + + /** + * Creates an instance of ServiceTagInformationInner class. + */ + public ServiceTagInformationInner() { + } + + /** + * 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; + } + + /** + * Get the serviceTagChangeNumber property: The iteration number of service tag object for region. + * + * @return the serviceTagChangeNumber value. + */ + public String serviceTagChangeNumber() { + return this.serviceTagChangeNumber; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagInformationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagInformationInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagInformationInner. + */ + public static ServiceTagInformationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagInformationInner deserializedServiceTagInformationInner = new ServiceTagInformationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedServiceTagInformationInner.properties + = ServiceTagInformationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedServiceTagInformationInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedServiceTagInformationInner.id = reader.getString(); + } else if ("serviceTagChangeNumber".equals(fieldName)) { + deserializedServiceTagInformationInner.serviceTagChangeNumber = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagInformationInner; + }); + } +} 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..895f164468329 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/ServiceTagsListResultInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListServiceTags API service call. + */ +@Immutable +public final class ServiceTagsListResultInner implements JsonSerializable { + /* + * The name of the cloud. + */ + private String name; + + /* + * The ID of the cloud. + */ + private String id; + + /* + * The azure resource type. + */ + private String type; + + /* + * The iteration number. + */ + private String changeNumber; + + /* + * The name of the cloud. + */ + private String cloud; + + /* + * The list of service tag information resources. + */ + private List values; + + /* + * The URL to get next page of service tag information resources. + */ + private String nextLink; + + /** + * Creates an instance of ServiceTagsListResultInner class. + */ + public ServiceTagsListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagsListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagsListResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagsListResultInner. + */ + public static ServiceTagsListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagsListResultInner deserializedServiceTagsListResultInner = new ServiceTagsListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedServiceTagsListResultInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedServiceTagsListResultInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServiceTagsListResultInner.type = reader.getString(); + } else if ("changeNumber".equals(fieldName)) { + deserializedServiceTagsListResultInner.changeNumber = reader.getString(); + } else if ("cloud".equals(fieldName)) { + deserializedServiceTagsListResultInner.cloud = reader.getString(); + } else if ("values".equals(fieldName)) { + List values + = reader.readArray(reader1 -> ServiceTagInformationInner.fromJson(reader1)); + deserializedServiceTagsListResultInner.values = values; + } else if ("nextLink".equals(fieldName)) { + deserializedServiceTagsListResultInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagsListResultInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignatureOverridesFilterValuesResponseInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignatureOverridesFilterValuesResponseInner.java new file mode 100644 index 0000000000000..ac4b3e0046e8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignatureOverridesFilterValuesResponseInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the list of all possible values for a specific filter value. + */ +@Fluent +public final class SignatureOverridesFilterValuesResponseInner + implements JsonSerializable { + /* + * Describes the possible values + */ + private List filterValues; + + /** + * Creates an instance of SignatureOverridesFilterValuesResponseInner class. + */ + public SignatureOverridesFilterValuesResponseInner() { + } + + /** + * Get the filterValues property: Describes the possible values. + * + * @return the filterValues value. + */ + public List filterValues() { + return this.filterValues; + } + + /** + * Set the filterValues property: Describes the possible values. + * + * @param filterValues the filterValues value to set. + * @return the SignatureOverridesFilterValuesResponseInner object itself. + */ + public SignatureOverridesFilterValuesResponseInner withFilterValues(List filterValues) { + this.filterValues = filterValues; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("filterValues", this.filterValues, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SignatureOverridesFilterValuesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SignatureOverridesFilterValuesResponseInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SignatureOverridesFilterValuesResponseInner. + */ + public static SignatureOverridesFilterValuesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SignatureOverridesFilterValuesResponseInner deserializedSignatureOverridesFilterValuesResponseInner + = new SignatureOverridesFilterValuesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterValues".equals(fieldName)) { + List filterValues = reader.readArray(reader1 -> reader1.getString()); + deserializedSignatureOverridesFilterValuesResponseInner.filterValues = filterValues; + } else { + reader.skipChildren(); + } + } + + return deserializedSignatureOverridesFilterValuesResponseInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesInner.java new file mode 100644 index 0000000000000..d9298734aa24c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesInner.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.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; +import java.io.IOException; + +/** + * Contains all specific policy signatures overrides for the IDPS. + */ +@Fluent +public final class SignaturesOverridesInner extends ProxyResource { + /* + * Contains the name of the resource (default) + */ + private String name; + + /* + * Will contain the resource id of the signature override resource + */ + private String id; + + /* + * Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides + */ + private String type; + + /* + * Will contain the properties of the resource (the actual signature overrides) + */ + private SignaturesOverridesProperties properties; + + /** + * Creates an instance of SignaturesOverridesInner class. + */ + public SignaturesOverridesInner() { + } + + /** + * Get the name property: Contains the name of the resource (default). + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Contains the name of the resource (default). + * + * @param name the name value to set. + * @return the SignaturesOverridesInner object itself. + */ + public SignaturesOverridesInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Will contain the resource id of the signature override resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Will contain the resource id of the signature override resource. + * + * @param id the id value to set. + * @return the SignaturesOverridesInner object itself. + */ + public SignaturesOverridesInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: Will contain the type of the resource: + * Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Will contain the type of the resource: + * Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides. + * + * @param type the type value to set. + * @return the SignaturesOverridesInner object itself. + */ + public SignaturesOverridesInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the properties property: Will contain the properties of the resource (the actual signature overrides). + * + * @return the properties value. + */ + public SignaturesOverridesProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Will contain the properties of the resource (the actual signature overrides). + * + * @param properties the properties value to set. + * @return the SignaturesOverridesInner object itself. + */ + public SignaturesOverridesInner withProperties(SignaturesOverridesProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SignaturesOverridesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SignaturesOverridesInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SignaturesOverridesInner. + */ + public static SignaturesOverridesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SignaturesOverridesInner deserializedSignaturesOverridesInner = new SignaturesOverridesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSignaturesOverridesInner.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedSignaturesOverridesInner.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSignaturesOverridesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSignaturesOverridesInner.properties = SignaturesOverridesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSignaturesOverridesInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesListInner.java new file mode 100644 index 0000000000000..0bddfdcd2cef3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SignaturesOverridesListInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes an object containing an array with a single item. + */ +@Fluent +public final class SignaturesOverridesListInner implements JsonSerializable { + /* + * Describes a list consisting exactly one item describing the policy's signature override status + */ + private List value; + + /** + * Creates an instance of SignaturesOverridesListInner class. + */ + public SignaturesOverridesListInner() { + } + + /** + * Get the value property: Describes a list consisting exactly one item describing the policy's signature override + * status. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Describes a list consisting exactly one item describing the policy's signature override + * status. + * + * @param value the value value to set. + * @return the SignaturesOverridesListInner object itself. + */ + public SignaturesOverridesListInner 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SignaturesOverridesListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SignaturesOverridesListInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SignaturesOverridesListInner. + */ + public static SignaturesOverridesListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SignaturesOverridesListInner deserializedSignaturesOverridesListInner = new SignaturesOverridesListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SignaturesOverridesInner.fromJson(reader1)); + deserializedSignaturesOverridesListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedSignaturesOverridesListInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberInner.java new file mode 100644 index 0000000000000..78252022bad39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ChildResource; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * StaticMember Item. + */ +@Fluent +public final class StaticMemberInner extends ChildResource { + /* + * The Static Member properties + */ + private StaticMemberProperties innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of StaticMemberInner class. + */ + public StaticMemberInner() { + } + + /** + * Get the innerProperties property: The Static Member properties. + * + * @return the innerProperties value. + */ + private StaticMemberProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resourceId property: Resource Id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); + } + + /** + * Set the resourceId property: Resource Id. + * + * @param resourceId the resourceId value to set. + * @return the StaticMemberInner object itself. + */ + public StaticMemberInner withResourceId(String resourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new StaticMemberProperties(); + } + this.innerProperties().withResourceId(resourceId); + return this; + } + + /** + * Get the region property: Resource region. + * + * @return the region value. + */ + public String region() { + return this.innerProperties() == null ? null : this.innerProperties().region(); + } + + /** + * Get the provisioningState property: The provisioning state of the scope assignment resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StaticMemberInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StaticMemberInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StaticMemberInner. + */ + public static StaticMemberInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StaticMemberInner deserializedStaticMemberInner = new StaticMemberInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStaticMemberInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStaticMemberInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStaticMemberInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedStaticMemberInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStaticMemberInner.innerProperties = StaticMemberProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedStaticMemberInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStaticMemberInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberProperties.java new file mode 100644 index 0000000000000..1da2f7ac886f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/StaticMemberProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of static member. + */ +@Fluent +public final class StaticMemberProperties implements JsonSerializable { + /* + * Resource Id. + */ + private String resourceId; + + /* + * Resource region. + */ + private String region; + + /* + * The provisioning state of the scope assignment resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of StaticMemberProperties class. + */ + public StaticMemberProperties() { + } + + /** + * Get the resourceId property: Resource Id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id. + * + * @param resourceId the resourceId value to set. + * @return the StaticMemberProperties object itself. + */ + public StaticMemberProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the region property: Resource region. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the provisioningState property: The provisioning state of the scope assignment 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StaticMemberProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StaticMemberProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StaticMemberProperties. + */ + public static StaticMemberProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StaticMemberProperties deserializedStaticMemberProperties = new StaticMemberProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedStaticMemberProperties.resourceId = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedStaticMemberProperties.region = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedStaticMemberProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStaticMemberProperties; + }); + } +} 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..5dcad5995b0a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetInner.java @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.SharingScope; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import java.io.IOException; +import java.util.List; + +/** + * Subnet in a virtual network resource. + */ +@Fluent +public final class SubnetInner extends SubResource { + /* + * Properties of the subnet. + */ + private SubnetPropertiesFormatInner innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of SubnetInner class. + */ + public SubnetInner() { + } + + /** + * Get the innerProperties property: Properties of the subnet. + * + * @return the innerProperties value. + */ + private SubnetPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public SubnetInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the addressPrefix property: The address prefix for the subnet. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the addressPrefixes property: List of address prefixes for the subnet. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withAddressPrefixes(addressPrefixes); + return this; + } + + /** + * Get the networkSecurityGroup property: The reference to the NetworkSecurityGroup resource. + * + * @return the networkSecurityGroup value. + */ + public NetworkSecurityGroupInner networkSecurityGroup() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withNetworkSecurityGroup(networkSecurityGroup); + return this; + } + + /** + * Get the routeTable property: The reference to the RouteTable resource. + * + * @return the routeTable value. + */ + public RouteTableInner routeTable() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withRouteTable(routeTable); + return this; + } + + /** + * Get the natGateway property: Nat gateway associated with this subnet. + * + * @return the natGateway value. + */ + public SubResource natGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withNatGateway(natGateway); + return this; + } + + /** + * Get the serviceEndpoints property: An array of service endpoints. + * + * @return the serviceEndpoints value. + */ + public List serviceEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withServiceEndpoints(serviceEndpoints); + return this; + } + + /** + * Get the serviceEndpointPolicies property: An array of service endpoint policies. + * + * @return the serviceEndpointPolicies value. + */ + public List serviceEndpointPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withServiceEndpointPolicies(serviceEndpointPolicies); + return this; + } + + /** + * Get the privateEndpoints property: An array of references to private endpoints. + * + * @return the privateEndpoints value. + */ + public List privateEndpoints() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Get the ipConfigurationProfiles property: Array of IP configuration profiles which reference this subnet. + * + * @return the ipConfigurationProfiles value. + */ + public List ipConfigurationProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurationProfiles(); + } + + /** + * Get the ipAllocations property: Array of IpAllocation which reference this subnet. + * + * @return the ipAllocations value. + */ + public List ipAllocations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withIpAllocations(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.innerProperties() == null ? null : this.innerProperties().resourceNavigationLinks(); + } + + /** + * Get the serviceAssociationLinks property: An array of references to services injecting into this subnet. + * + * @return the serviceAssociationLinks value. + */ + public List serviceAssociationLinks() { + return this.innerProperties() == null ? null : this.innerProperties().serviceAssociationLinks(); + } + + /** + * Get the delegations property: An array of references to the delegations on the subnet. + * + * @return the delegations value. + */ + public List delegations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withDelegations(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.innerProperties() == null ? null : this.innerProperties().purpose(); + } + + /** + * Get the provisioningState property: The provisioning state of the subnet resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withPrivateEndpointNetworkPolicies(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withPrivateLinkServiceNetworkPolicies(privateLinkServiceNetworkPolicies); + return this; + } + + /** + * Get the applicationGatewayIpConfigurations property: Application gateway IP configurations of virtual network + * resource. + * + * @return the applicationGatewayIpConfigurations value. + */ + public List applicationGatewayIpConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withApplicationGatewayIpConfigurations(applicationGatewayIpConfigurations); + return this; + } + + /** + * Get the sharingScope property: Set this property to Tenant to allow sharing subnet with other subscriptions in + * your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can only + * be set if subnet is empty. + * + * @return the sharingScope value. + */ + public SharingScope sharingScope() { + return this.innerProperties() == null ? null : this.innerProperties().sharingScope(); + } + + /** + * Set the sharingScope property: Set this property to Tenant to allow sharing subnet with other subscriptions in + * your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can only + * be set if subnet is empty. + * + * @param sharingScope the sharingScope value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withSharingScope(SharingScope sharingScope) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withSharingScope(sharingScope); + return this; + } + + /** + * Get the defaultOutboundAccess property: Set this property to false to disable default outbound connectivity for + * all VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for an + * existing subnet. + * + * @return the defaultOutboundAccess value. + */ + public Boolean defaultOutboundAccess() { + return this.innerProperties() == null ? null : this.innerProperties().defaultOutboundAccess(); + } + + /** + * Set the defaultOutboundAccess property: Set this property to false to disable default outbound connectivity for + * all VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for an + * existing subnet. + * + * @param defaultOutboundAccess the defaultOutboundAccess value to set. + * @return the SubnetInner object itself. + */ + public SubnetInner withDefaultOutboundAccess(Boolean defaultOutboundAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new SubnetPropertiesFormatInner(); + } + this.innerProperties().withDefaultOutboundAccess(defaultOutboundAccess); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetInner. + */ + public static SubnetInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubnetInner deserializedSubnetInner = new SubnetInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSubnetInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedSubnetInner.innerProperties = SubnetPropertiesFormatInner.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedSubnetInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedSubnetInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSubnetInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetPropertiesFormatInner.java new file mode 100644 index 0000000000000..9743b55947b88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SubnetPropertiesFormatInner.java @@ -0,0 +1,667 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.SharingScope; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateEndpointNetworkPolicies; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPrivateLinkServiceNetworkPolicies; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the subnet. + */ +@Fluent +public final class SubnetPropertiesFormatInner implements JsonSerializable { + /* + * The address prefix for the subnet. + */ + private String addressPrefix; + + /* + * List of address prefixes for the subnet. + */ + private List addressPrefixes; + + /* + * The reference to the NetworkSecurityGroup resource. + */ + private NetworkSecurityGroupInner networkSecurityGroup; + + /* + * The reference to the RouteTable resource. + */ + private RouteTableInner routeTable; + + /* + * Nat gateway associated with this subnet. + */ + private SubResource natGateway; + + /* + * An array of service endpoints. + */ + private List serviceEndpoints; + + /* + * An array of service endpoint policies. + */ + private List serviceEndpointPolicies; + + /* + * An array of references to private endpoints. + */ + private List privateEndpoints; + + /* + * An array of references to the network interface IP configurations using subnet. + */ + private List ipConfigurations; + + /* + * Array of IP configuration profiles which reference this subnet. + */ + private List ipConfigurationProfiles; + + /* + * Array of IpAllocation which reference this subnet. + */ + private List ipAllocations; + + /* + * An array of references to the external resources using subnet. + */ + private List resourceNavigationLinks; + + /* + * An array of references to services injecting into this subnet. + */ + private List serviceAssociationLinks; + + /* + * An array of references to the delegations on the subnet. + */ + private List delegations; + + /* + * A read-only string identifying the intention of use for this subnet based on delegations and other user-defined + * properties. + */ + private String purpose; + + /* + * The provisioning state of the subnet resource. + */ + private ProvisioningState provisioningState; + + /* + * Enable or Disable apply network policies on private end point in the subnet. + */ + private VirtualNetworkPrivateEndpointNetworkPolicies privateEndpointNetworkPolicies; + + /* + * Enable or Disable apply network policies on private link service in the subnet. + */ + private VirtualNetworkPrivateLinkServiceNetworkPolicies privateLinkServiceNetworkPolicies; + + /* + * Application gateway IP configurations of virtual network resource. + */ + private List applicationGatewayIpConfigurations; + + /* + * Set this property to Tenant to allow sharing subnet with other subscriptions in your AAD tenant. This property + * can only be set if defaultOutboundAccess is set to false, both properties can only be set if subnet is empty. + */ + private SharingScope sharingScope; + + /* + * Set this property to false to disable default outbound connectivity for all VMs in the subnet. This property can + * only be set at the time of subnet creation and cannot be updated for an existing subnet. + */ + private Boolean defaultOutboundAccess; + + /** + * Creates an instance of SubnetPropertiesFormatInner class. + */ + public SubnetPropertiesFormatInner() { + } + + /** + * 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner + 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner 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 SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner withApplicationGatewayIpConfigurations( + List applicationGatewayIpConfigurations) { + this.applicationGatewayIpConfigurations = applicationGatewayIpConfigurations; + return this; + } + + /** + * Get the sharingScope property: Set this property to Tenant to allow sharing subnet with other subscriptions in + * your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can only + * be set if subnet is empty. + * + * @return the sharingScope value. + */ + public SharingScope sharingScope() { + return this.sharingScope; + } + + /** + * Set the sharingScope property: Set this property to Tenant to allow sharing subnet with other subscriptions in + * your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can only + * be set if subnet is empty. + * + * @param sharingScope the sharingScope value to set. + * @return the SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner withSharingScope(SharingScope sharingScope) { + this.sharingScope = sharingScope; + return this; + } + + /** + * Get the defaultOutboundAccess property: Set this property to false to disable default outbound connectivity for + * all VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for an + * existing subnet. + * + * @return the defaultOutboundAccess value. + */ + public Boolean defaultOutboundAccess() { + return this.defaultOutboundAccess; + } + + /** + * Set the defaultOutboundAccess property: Set this property to false to disable default outbound connectivity for + * all VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for an + * existing subnet. + * + * @param defaultOutboundAccess the defaultOutboundAccess value to set. + * @return the SubnetPropertiesFormatInner object itself. + */ + public SubnetPropertiesFormatInner withDefaultOutboundAccess(Boolean defaultOutboundAccess) { + this.defaultOutboundAccess = defaultOutboundAccess; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("networkSecurityGroup", this.networkSecurityGroup); + jsonWriter.writeJsonField("routeTable", this.routeTable); + jsonWriter.writeJsonField("natGateway", this.natGateway); + jsonWriter.writeArrayField("serviceEndpoints", this.serviceEndpoints, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceEndpointPolicies", this.serviceEndpointPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipAllocations", this.ipAllocations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("delegations", this.delegations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("privateEndpointNetworkPolicies", + this.privateEndpointNetworkPolicies == null ? null : this.privateEndpointNetworkPolicies.toString()); + jsonWriter.writeStringField("privateLinkServiceNetworkPolicies", + this.privateLinkServiceNetworkPolicies == null ? null : this.privateLinkServiceNetworkPolicies.toString()); + jsonWriter.writeArrayField("applicationGatewayIPConfigurations", this.applicationGatewayIpConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("sharingScope", this.sharingScope == null ? null : this.sharingScope.toString()); + jsonWriter.writeBooleanField("defaultOutboundAccess", this.defaultOutboundAccess); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetPropertiesFormatInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetPropertiesFormatInner. + */ + public static SubnetPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubnetPropertiesFormatInner deserializedSubnetPropertiesFormatInner = new SubnetPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefix".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.addressPrefix = reader.getString(); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedSubnetPropertiesFormatInner.addressPrefixes = addressPrefixes; + } else if ("networkSecurityGroup".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.networkSecurityGroup + = NetworkSecurityGroupInner.fromJson(reader); + } else if ("routeTable".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.routeTable = RouteTableInner.fromJson(reader); + } else if ("natGateway".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.natGateway = SubResource.fromJson(reader); + } else if ("serviceEndpoints".equals(fieldName)) { + List serviceEndpoints + = reader.readArray(reader1 -> ServiceEndpointPropertiesFormat.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.serviceEndpoints = serviceEndpoints; + } else if ("serviceEndpointPolicies".equals(fieldName)) { + List serviceEndpointPolicies + = reader.readArray(reader1 -> ServiceEndpointPolicyInner.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.serviceEndpointPolicies = serviceEndpointPolicies; + } else if ("privateEndpoints".equals(fieldName)) { + List privateEndpoints + = reader.readArray(reader1 -> PrivateEndpointInner.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.privateEndpoints = privateEndpoints; + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> IpConfigurationInner.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.ipConfigurations = ipConfigurations; + } else if ("ipConfigurationProfiles".equals(fieldName)) { + List ipConfigurationProfiles + = reader.readArray(reader1 -> IpConfigurationProfileInner.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.ipConfigurationProfiles = ipConfigurationProfiles; + } else if ("ipAllocations".equals(fieldName)) { + List ipAllocations = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.ipAllocations = ipAllocations; + } else if ("resourceNavigationLinks".equals(fieldName)) { + List resourceNavigationLinks + = reader.readArray(reader1 -> ResourceNavigationLink.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.resourceNavigationLinks = resourceNavigationLinks; + } else if ("serviceAssociationLinks".equals(fieldName)) { + List serviceAssociationLinks + = reader.readArray(reader1 -> ServiceAssociationLink.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.serviceAssociationLinks = serviceAssociationLinks; + } else if ("delegations".equals(fieldName)) { + List delegations = reader.readArray(reader1 -> Delegation.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.delegations = delegations; + } else if ("purpose".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.purpose = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("privateEndpointNetworkPolicies".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.privateEndpointNetworkPolicies + = VirtualNetworkPrivateEndpointNetworkPolicies.fromString(reader.getString()); + } else if ("privateLinkServiceNetworkPolicies".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.privateLinkServiceNetworkPolicies + = VirtualNetworkPrivateLinkServiceNetworkPolicies.fromString(reader.getString()); + } else if ("applicationGatewayIPConfigurations".equals(fieldName)) { + List applicationGatewayIpConfigurations + = reader.readArray(reader1 -> ApplicationGatewayIpConfiguration.fromJson(reader1)); + deserializedSubnetPropertiesFormatInner.applicationGatewayIpConfigurations + = applicationGatewayIpConfigurations; + } else if ("sharingScope".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.sharingScope = SharingScope.fromString(reader.getString()); + } else if ("defaultOutboundAccess".equals(fieldName)) { + deserializedSubnetPropertiesFormatInner.defaultOutboundAccess + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetPropertiesFormatInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceInner.java new file mode 100644 index 0000000000000..ca45878d74259 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.SwapResourceProperties; +import java.io.IOException; + +/** + * SwapResource to represent slot type on the specified cloud service. + */ +@Fluent +public final class SwapResourceInner implements JsonSerializable { + /* + * Resource Id. + */ + private String id; + + /* + * Resource name. + */ + private String name; + + /* + * Resource type. + */ + private String type; + + /* + * Swap resource properties + */ + private SwapResourceProperties properties; + + /** + * Creates an instance of SwapResourceInner class. + */ + public SwapResourceInner() { + } + + /** + * Get the id property: Resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * 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 properties property: Swap resource properties. + * + * @return the properties value. + */ + public SwapResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Swap resource properties. + * + * @param properties the properties value to set. + * @return the SwapResourceInner object itself. + */ + public SwapResourceInner withProperties(SwapResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SwapResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SwapResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SwapResourceInner. + */ + public static SwapResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SwapResourceInner deserializedSwapResourceInner = new SwapResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSwapResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSwapResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSwapResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSwapResourceInner.properties = SwapResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSwapResourceInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceListResultInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceListResultInner.java new file mode 100644 index 0000000000000..86adee557f210 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/SwapResourceListResultInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * SwapResource List with single entry to represent slot type on the specified cloud service. + */ +@Fluent +public final class SwapResourceListResultInner implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /** + * Creates an instance of SwapResourceListResultInner class. + */ + public SwapResourceListResultInner() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the SwapResourceListResultInner object itself. + */ + public SwapResourceListResultInner 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SwapResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SwapResourceListResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SwapResourceListResultInner. + */ + public static SwapResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SwapResourceListResultInner deserializedSwapResourceListResultInner = new SwapResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SwapResourceInner.fromJson(reader1)); + deserializedSwapResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedSwapResourceListResultInner; + }); + } +} 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..2eb2584f5a5fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TopologyInner.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.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.TopologyResource; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Topology of the specified resource group. + */ +@Fluent +public final class TopologyInner implements JsonSerializable { + /* + * GUID representing the operation id. + */ + private String id; + + /* + * The datetime when the topology was initially created for the resource group. + */ + private OffsetDateTime createdDateTime; + + /* + * The datetime when the topology was last modified. + */ + private OffsetDateTime lastModified; + + /* + * A list of topology resources. + */ + private List resources; + + /** + * Creates an instance of TopologyInner class. + */ + public TopologyInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resources", this.resources, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TopologyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TopologyInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TopologyInner. + */ + public static TopologyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TopologyInner deserializedTopologyInner = new TopologyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTopologyInner.id = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedTopologyInner.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModified".equals(fieldName)) { + deserializedTopologyInner.lastModified = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resources".equals(fieldName)) { + List resources = reader.readArray(reader1 -> TopologyResource.fromJson(reader1)); + deserializedTopologyInner.resources = resources; + } else { + reader.skipChildren(); + } + } + + return deserializedTopologyInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingProperties.java new file mode 100644 index 0000000000000..b334619f97f33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingProperties.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Storage location provided for troubleshoot. + */ +@Fluent +public final class TroubleshootingProperties implements JsonSerializable { + /* + * The ID for the storage account to save the troubleshoot result. + */ + private String storageId; + + /* + * The path to the blob to save the troubleshoot result in. + */ + private String storagePath; + + /** + * Creates an instance of TroubleshootingProperties class. + */ + public TroubleshootingProperties() { + } + + /** + * 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 TroubleshootingProperties object itself. + */ + public TroubleshootingProperties 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 TroubleshootingProperties object itself. + */ + public TroubleshootingProperties withStoragePath(String storagePath) { + this.storagePath = storagePath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageId in model TroubleshootingProperties")); + } + if (storagePath() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storagePath in model TroubleshootingProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TroubleshootingProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageId", this.storageId); + jsonWriter.writeStringField("storagePath", this.storagePath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TroubleshootingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TroubleshootingProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TroubleshootingProperties. + */ + public static TroubleshootingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TroubleshootingProperties deserializedTroubleshootingProperties = new TroubleshootingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageId".equals(fieldName)) { + deserializedTroubleshootingProperties.storageId = reader.getString(); + } else if ("storagePath".equals(fieldName)) { + deserializedTroubleshootingProperties.storagePath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTroubleshootingProperties; + }); + } +} 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..395060dc1396e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/TroubleshootingResultInner.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.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.TroubleshootingDetails; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Troubleshooting information gained from specified resource. + */ +@Fluent +public final class TroubleshootingResultInner implements JsonSerializable { + /* + * The start time of the troubleshooting. + */ + private OffsetDateTime startTime; + + /* + * The end time of the troubleshooting. + */ + private OffsetDateTime endTime; + + /* + * The result code of the troubleshooting. + */ + private String code; + + /* + * Information from troubleshooting. + */ + private List results; + + /** + * Creates an instance of TroubleshootingResultInner class. + */ + public TroubleshootingResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TroubleshootingResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TroubleshootingResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TroubleshootingResultInner. + */ + public static TroubleshootingResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TroubleshootingResultInner deserializedTroubleshootingResultInner = new TroubleshootingResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedTroubleshootingResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedTroubleshootingResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("code".equals(fieldName)) { + deserializedTroubleshootingResultInner.code = reader.getString(); + } else if ("results".equals(fieldName)) { + List results + = reader.readArray(reader1 -> TroubleshootingDetails.fromJson(reader1)); + deserializedTroubleshootingResultInner.results = results; + } else { + reader.skipChildren(); + } + } + + return deserializedTroubleshootingResultInner; + }); + } +} 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..b72e8f6e10353 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/UsageInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.UsageName; +import com.azure.resourcemanager.network.generated.models.UsageUnit; +import java.io.IOException; + +/** + * The network resource usage. + */ +@Fluent +public final class UsageInner implements JsonSerializable { + /* + * Resource identifier. + */ + private String id; + + /* + * An enum describing the unit of measurement. + */ + private UsageUnit unit; + + /* + * The current value of the usage. + */ + private long currentValue; + + /* + * The limit of usage. + */ + private long limit; + + /* + * The name of the type of usage. + */ + private UsageName name; + + /** + * Creates an instance of UsageInner class. + */ + public UsageInner() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property unit in model UsageInner")); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model UsageInner")); + } else { + name().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UsageInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeLongField("currentValue", this.currentValue); + jsonWriter.writeLongField("limit", this.limit); + jsonWriter.writeJsonField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unit".equals(fieldName)) { + deserializedUsageInner.unit = UsageUnit.fromString(reader.getString()); + } else if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getLong(); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getLong(); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = UsageName.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedUsageInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } +} 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..158e6d50d003e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VerificationIpFlowResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.Access; +import java.io.IOException; + +/** + * Results of IP flow verification on the target resource. + */ +@Fluent +public final class VerificationIpFlowResultInner implements JsonSerializable { + /* + * Indicates whether the traffic is allowed or denied. + */ + private Access access; + + /* + * Name of the rule. If input is not matched against any security rule, it is not displayed. + */ + private String ruleName; + + /** + * Creates an instance of VerificationIpFlowResultInner class. + */ + public VerificationIpFlowResultInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("access", this.access == null ? null : this.access.toString()); + jsonWriter.writeStringField("ruleName", this.ruleName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VerificationIpFlowResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VerificationIpFlowResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VerificationIpFlowResultInner. + */ + public static VerificationIpFlowResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VerificationIpFlowResultInner deserializedVerificationIpFlowResultInner + = new VerificationIpFlowResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("access".equals(fieldName)) { + deserializedVerificationIpFlowResultInner.access = Access.fromString(reader.getString()); + } else if ("ruleName".equals(fieldName)) { + deserializedVerificationIpFlowResultInner.ruleName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVerificationIpFlowResultInner; + }); + } +} 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..74bdd8cd52a1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Virtual Appliance Site resource. + */ +@Fluent +public final class VirtualApplianceSiteInner extends SubResource { + /* + * The properties of the Virtual Appliance Sites. + */ + private VirtualApplianceSiteProperties innerProperties; + + /* + * Name of the virtual appliance site. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Site type. + */ + private String type; + + /** + * Creates an instance of VirtualApplianceSiteInner class. + */ + public VirtualApplianceSiteInner() { + } + + /** + * Get the innerProperties property: The properties of the Virtual Appliance Sites. + * + * @return the innerProperties value. + */ + private VirtualApplianceSiteProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualApplianceSiteInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the addressPrefix property: Address Prefix. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().addressPrefix(); + } + + /** + * Set the addressPrefix property: Address Prefix. + * + * @param addressPrefix the addressPrefix value to set. + * @return the VirtualApplianceSiteInner object itself. + */ + public VirtualApplianceSiteInner withAddressPrefix(String addressPrefix) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualApplianceSiteProperties(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the o365Policy property: Office 365 Policy. + * + * @return the o365Policy value. + */ + public Office365PolicyProperties o365Policy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualApplianceSiteProperties(); + } + this.innerProperties().withO365Policy(o365Policy); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceSiteInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceSiteInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceSiteInner. + */ + public static VirtualApplianceSiteInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceSiteInner deserializedVirtualApplianceSiteInner = new VirtualApplianceSiteInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualApplianceSiteInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualApplianceSiteInner.innerProperties + = VirtualApplianceSiteProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVirtualApplianceSiteInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVirtualApplianceSiteInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualApplianceSiteInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceSiteInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteProperties.java new file mode 100644 index 0000000000000..0ff821e21b1b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualApplianceSiteProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the rule group. + */ +@Fluent +public final class VirtualApplianceSiteProperties implements JsonSerializable { + /* + * Address Prefix. + */ + private String addressPrefix; + + /* + * Office 365 Policy. + */ + private Office365PolicyProperties o365Policy; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualApplianceSiteProperties class. + */ + public VirtualApplianceSiteProperties() { + } + + /** + * 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 VirtualApplianceSiteProperties object itself. + */ + public VirtualApplianceSiteProperties 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 VirtualApplianceSiteProperties object itself. + */ + public VirtualApplianceSiteProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (o365Policy() != null) { + o365Policy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeJsonField("o365Policy", this.o365Policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceSiteProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceSiteProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceSiteProperties. + */ + public static VirtualApplianceSiteProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceSiteProperties deserializedVirtualApplianceSiteProperties + = new VirtualApplianceSiteProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefix".equals(fieldName)) { + deserializedVirtualApplianceSiteProperties.addressPrefix = reader.getString(); + } else if ("o365Policy".equals(fieldName)) { + deserializedVirtualApplianceSiteProperties.o365Policy = Office365PolicyProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualApplianceSiteProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceSiteProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubEffectiveRouteListInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubEffectiveRouteListInner.java new file mode 100644 index 0000000000000..e605b7adb3e5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubEffectiveRouteListInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.VirtualHubEffectiveRoute; +import java.io.IOException; +import java.util.List; + +/** + * EffectiveRoutes List. + */ +@Fluent +public final class VirtualHubEffectiveRouteListInner implements JsonSerializable { + /* + * The list of effective routes configured on the virtual hub or the specified resource. + */ + private List value; + + /** + * Creates an instance of VirtualHubEffectiveRouteListInner class. + */ + public VirtualHubEffectiveRouteListInner() { + } + + /** + * Get the value property: The list of effective routes configured on the virtual hub or the specified resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of effective routes configured on the virtual hub or the specified resource. + * + * @param value the value value to set. + * @return the VirtualHubEffectiveRouteListInner object itself. + */ + public VirtualHubEffectiveRouteListInner 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubEffectiveRouteListInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubEffectiveRouteListInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubEffectiveRouteListInner. + */ + public static VirtualHubEffectiveRouteListInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubEffectiveRouteListInner deserializedVirtualHubEffectiveRouteListInner + = new VirtualHubEffectiveRouteListInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualHubEffectiveRoute.fromJson(reader1)); + deserializedVirtualHubEffectiveRouteListInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubEffectiveRouteListInner; + }); + } +} 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..6f8b3b42aefd5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubInner.java @@ -0,0 +1,654 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.HubRoutingPreference; +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.azure.resourcemanager.network.generated.models.VirtualRouterAutoScaleConfiguration; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * VirtualHub Resource. + */ +@Fluent +public final class VirtualHubInner extends Resource { + /* + * Properties of the virtual hub. + */ + private VirtualHubProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Kind of service virtual hub. This is metadata used for the Azure portal experience for Route Server. + */ + private String kind; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualHubInner class. + */ + public VirtualHubInner() { + } + + /** + * Get the innerProperties property: Properties of the virtual hub. + * + * @return the innerProperties value. + */ + private VirtualHubProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 virtual hub. This is metadata used for the Azure portal experience for + * Route Server. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualHubInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualHubInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the virtualWan property: The VirtualWAN to which the VirtualHub belongs. + * + * @return the virtualWan value. + */ + public SubResource virtualWan() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withVirtualWan(virtualWan); + return this; + } + + /** + * Get the vpnGateway property: The VpnGateway associated with this VirtualHub. + * + * @return the vpnGateway value. + */ + public SubResource vpnGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withVpnGateway(vpnGateway); + return this; + } + + /** + * Get the p2SVpnGateway property: The P2SVpnGateway associated with this VirtualHub. + * + * @return the p2SVpnGateway value. + */ + public SubResource p2SVpnGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withP2SVpnGateway(p2SVpnGateway); + return this; + } + + /** + * Get the expressRouteGateway property: The expressRouteGateway associated with this VirtualHub. + * + * @return the expressRouteGateway value. + */ + public SubResource expressRouteGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withExpressRouteGateway(expressRouteGateway); + return this; + } + + /** + * Get the azureFirewall property: The azureFirewall associated with this VirtualHub. + * + * @return the azureFirewall value. + */ + public SubResource azureFirewall() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withAzureFirewall(azureFirewall); + return this; + } + + /** + * Get the securityPartnerProvider property: The securityPartnerProvider associated with this VirtualHub. + * + * @return the securityPartnerProvider value. + */ + public SubResource securityPartnerProvider() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withSecurityPartnerProvider(securityPartnerProvider); + return this; + } + + /** + * Get the addressPrefix property: Address-prefix for this VirtualHub. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withAddressPrefix(addressPrefix); + return this; + } + + /** + * Get the routeTable property: The routeTable associated with this virtual hub. + * + * @return the routeTable value. + */ + public VirtualHubRouteTable routeTable() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withRouteTable(routeTable); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the virtual hub resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the securityProviderName property: The Security Provider name. + * + * @return the securityProviderName value. + */ + public String securityProviderName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withSecurityProviderName(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withVirtualHubRouteTableV2S(virtualHubRouteTableV2S); + return this; + } + + /** + * Get the sku property: The sku of this VirtualHub. + * + * @return the sku value. + */ + public String sku() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the routingState property: The routing state. + * + * @return the routingState value. + */ + public RoutingState routingState() { + return this.innerProperties() == null ? null : this.innerProperties().routingState(); + } + + /** + * Get the bgpConnections property: List of references to Bgp Connections. + * + * @return the bgpConnections value. + */ + public List bgpConnections() { + return this.innerProperties() == null ? null : this.innerProperties().bgpConnections(); + } + + /** + * Get the ipConfigurations property: List of references to IpConfigurations. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Get the routeMaps property: List of references to RouteMaps. + * + * @return the routeMaps value. + */ + public List routeMaps() { + return this.innerProperties() == null ? null : this.innerProperties().routeMaps(); + } + + /** + * Get the virtualRouterAsn property: VirtualRouter ASN. + * + * @return the virtualRouterAsn value. + */ + public Long virtualRouterAsn() { + return this.innerProperties() == null ? null : this.innerProperties().virtualRouterAsn(); + } + + /** + * Set the virtualRouterAsn property: VirtualRouter ASN. + * + * @param virtualRouterAsn the virtualRouterAsn value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualRouterAsn(Long virtualRouterAsn) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withVirtualRouterAsn(virtualRouterAsn); + return this; + } + + /** + * Get the virtualRouterIps property: VirtualRouter IPs. + * + * @return the virtualRouterIps value. + */ + public List virtualRouterIps() { + return this.innerProperties() == null ? null : this.innerProperties().virtualRouterIps(); + } + + /** + * Set the virtualRouterIps property: VirtualRouter IPs. + * + * @param virtualRouterIps the virtualRouterIps value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualRouterIps(List virtualRouterIps) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withVirtualRouterIps(virtualRouterIps); + return this; + } + + /** + * Get the allowBranchToBranchTraffic property: Flag to control transit for VirtualRouter hub. + * + * @return the allowBranchToBranchTraffic value. + */ + public Boolean allowBranchToBranchTraffic() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + /** + * Get the preferredRoutingGateway property: The preferred gateway to route on-prem traffic. + * + * @return the preferredRoutingGateway value. + */ + public PreferredRoutingGateway preferredRoutingGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withPreferredRoutingGateway(preferredRoutingGateway); + return this; + } + + /** + * Get the hubRoutingPreference property: The hubRoutingPreference of this VirtualHub. + * + * @return the hubRoutingPreference value. + */ + public HubRoutingPreference hubRoutingPreference() { + return this.innerProperties() == null ? null : this.innerProperties().hubRoutingPreference(); + } + + /** + * Set the hubRoutingPreference property: The hubRoutingPreference of this VirtualHub. + * + * @param hubRoutingPreference the hubRoutingPreference value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withHubRoutingPreference(HubRoutingPreference hubRoutingPreference) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withHubRoutingPreference(hubRoutingPreference); + return this; + } + + /** + * Get the virtualRouterAutoScaleConfiguration property: The VirtualHub Router autoscale configuration. + * + * @return the virtualRouterAutoScaleConfiguration value. + */ + public VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().virtualRouterAutoScaleConfiguration(); + } + + /** + * Set the virtualRouterAutoScaleConfiguration property: The VirtualHub Router autoscale configuration. + * + * @param virtualRouterAutoScaleConfiguration the virtualRouterAutoScaleConfiguration value to set. + * @return the VirtualHubInner object itself. + */ + public VirtualHubInner withVirtualRouterAutoScaleConfiguration( + VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubProperties(); + } + this.innerProperties().withVirtualRouterAutoScaleConfiguration(virtualRouterAutoScaleConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualHubInner. + */ + public static VirtualHubInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubInner deserializedVirtualHubInner = new VirtualHubInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualHubInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualHubInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualHubInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualHubInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualHubInner.innerProperties = VirtualHubProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualHubInner.etag = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedVirtualHubInner.kind = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualHubInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubProperties.java new file mode 100644 index 0000000000000..2c68ac25c8f01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubProperties.java @@ -0,0 +1,656 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.HubRoutingPreference; +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.azure.resourcemanager.network.generated.models.VirtualRouterAutoScaleConfiguration; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for VirtualHub. + */ +@Fluent +public final class VirtualHubProperties implements JsonSerializable { + /* + * The VirtualWAN to which the VirtualHub belongs. + */ + private SubResource virtualWan; + + /* + * The VpnGateway associated with this VirtualHub. + */ + private SubResource vpnGateway; + + /* + * The P2SVpnGateway associated with this VirtualHub. + */ + private SubResource p2SVpnGateway; + + /* + * The expressRouteGateway associated with this VirtualHub. + */ + private SubResource expressRouteGateway; + + /* + * The azureFirewall associated with this VirtualHub. + */ + private SubResource azureFirewall; + + /* + * The securityPartnerProvider associated with this VirtualHub. + */ + private SubResource securityPartnerProvider; + + /* + * Address-prefix for this VirtualHub. + */ + private String addressPrefix; + + /* + * The routeTable associated with this virtual hub. + */ + private VirtualHubRouteTable routeTable; + + /* + * The provisioning state of the virtual hub resource. + */ + private ProvisioningState provisioningState; + + /* + * The Security Provider name. + */ + private String securityProviderName; + + /* + * List of all virtual hub route table v2s associated with this VirtualHub. + */ + private List virtualHubRouteTableV2S; + + /* + * The sku of this VirtualHub. + */ + private String sku; + + /* + * The routing state. + */ + private RoutingState routingState; + + /* + * List of references to Bgp Connections. + */ + private List bgpConnections; + + /* + * List of references to IpConfigurations. + */ + private List ipConfigurations; + + /* + * List of references to RouteMaps. + */ + private List routeMaps; + + /* + * VirtualRouter ASN. + */ + private Long virtualRouterAsn; + + /* + * VirtualRouter IPs. + */ + private List virtualRouterIps; + + /* + * Flag to control transit for VirtualRouter hub. + */ + private Boolean allowBranchToBranchTraffic; + + /* + * The preferred gateway to route on-prem traffic + */ + private PreferredRoutingGateway preferredRoutingGateway; + + /* + * The hubRoutingPreference of this VirtualHub. + */ + private HubRoutingPreference hubRoutingPreference; + + /* + * The VirtualHub Router autoscale configuration. + */ + private VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration; + + /** + * Creates an instance of VirtualHubProperties class. + */ + public VirtualHubProperties() { + } + + /** + * 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 routeMaps property: List of references to RouteMaps. + * + * @return the routeMaps value. + */ + public List routeMaps() { + return this.routeMaps; + } + + /** + * 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties 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 VirtualHubProperties object itself. + */ + public VirtualHubProperties withPreferredRoutingGateway(PreferredRoutingGateway preferredRoutingGateway) { + this.preferredRoutingGateway = preferredRoutingGateway; + return this; + } + + /** + * Get the hubRoutingPreference property: The hubRoutingPreference of this VirtualHub. + * + * @return the hubRoutingPreference value. + */ + public HubRoutingPreference hubRoutingPreference() { + return this.hubRoutingPreference; + } + + /** + * Set the hubRoutingPreference property: The hubRoutingPreference of this VirtualHub. + * + * @param hubRoutingPreference the hubRoutingPreference value to set. + * @return the VirtualHubProperties object itself. + */ + public VirtualHubProperties withHubRoutingPreference(HubRoutingPreference hubRoutingPreference) { + this.hubRoutingPreference = hubRoutingPreference; + return this; + } + + /** + * Get the virtualRouterAutoScaleConfiguration property: The VirtualHub Router autoscale configuration. + * + * @return the virtualRouterAutoScaleConfiguration value. + */ + public VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration() { + return this.virtualRouterAutoScaleConfiguration; + } + + /** + * Set the virtualRouterAutoScaleConfiguration property: The VirtualHub Router autoscale configuration. + * + * @param virtualRouterAutoScaleConfiguration the virtualRouterAutoScaleConfiguration value to set. + * @return the VirtualHubProperties object itself. + */ + public VirtualHubProperties withVirtualRouterAutoScaleConfiguration( + VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration) { + this.virtualRouterAutoScaleConfiguration = virtualRouterAutoScaleConfiguration; + 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()); + } + if (virtualRouterAutoScaleConfiguration() != null) { + virtualRouterAutoScaleConfiguration().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualWan", this.virtualWan); + jsonWriter.writeJsonField("vpnGateway", this.vpnGateway); + jsonWriter.writeJsonField("p2SVpnGateway", this.p2SVpnGateway); + jsonWriter.writeJsonField("expressRouteGateway", this.expressRouteGateway); + jsonWriter.writeJsonField("azureFirewall", this.azureFirewall); + jsonWriter.writeJsonField("securityPartnerProvider", this.securityPartnerProvider); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeJsonField("routeTable", this.routeTable); + jsonWriter.writeStringField("securityProviderName", this.securityProviderName); + jsonWriter.writeArrayField("virtualHubRouteTableV2s", this.virtualHubRouteTableV2S, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("sku", this.sku); + jsonWriter.writeNumberField("virtualRouterAsn", this.virtualRouterAsn); + jsonWriter.writeArrayField("virtualRouterIps", this.virtualRouterIps, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("allowBranchToBranchTraffic", this.allowBranchToBranchTraffic); + jsonWriter.writeStringField("preferredRoutingGateway", + this.preferredRoutingGateway == null ? null : this.preferredRoutingGateway.toString()); + jsonWriter.writeStringField("hubRoutingPreference", + this.hubRoutingPreference == null ? null : this.hubRoutingPreference.toString()); + jsonWriter.writeJsonField("virtualRouterAutoScaleConfiguration", this.virtualRouterAutoScaleConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubProperties. + */ + public static VirtualHubProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubProperties deserializedVirtualHubProperties = new VirtualHubProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualWan".equals(fieldName)) { + deserializedVirtualHubProperties.virtualWan = SubResource.fromJson(reader); + } else if ("vpnGateway".equals(fieldName)) { + deserializedVirtualHubProperties.vpnGateway = SubResource.fromJson(reader); + } else if ("p2SVpnGateway".equals(fieldName)) { + deserializedVirtualHubProperties.p2SVpnGateway = SubResource.fromJson(reader); + } else if ("expressRouteGateway".equals(fieldName)) { + deserializedVirtualHubProperties.expressRouteGateway = SubResource.fromJson(reader); + } else if ("azureFirewall".equals(fieldName)) { + deserializedVirtualHubProperties.azureFirewall = SubResource.fromJson(reader); + } else if ("securityPartnerProvider".equals(fieldName)) { + deserializedVirtualHubProperties.securityPartnerProvider = SubResource.fromJson(reader); + } else if ("addressPrefix".equals(fieldName)) { + deserializedVirtualHubProperties.addressPrefix = reader.getString(); + } else if ("routeTable".equals(fieldName)) { + deserializedVirtualHubProperties.routeTable = VirtualHubRouteTable.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualHubProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("securityProviderName".equals(fieldName)) { + deserializedVirtualHubProperties.securityProviderName = reader.getString(); + } else if ("virtualHubRouteTableV2s".equals(fieldName)) { + List virtualHubRouteTableV2S + = reader.readArray(reader1 -> VirtualHubRouteTableV2Inner.fromJson(reader1)); + deserializedVirtualHubProperties.virtualHubRouteTableV2S = virtualHubRouteTableV2S; + } else if ("sku".equals(fieldName)) { + deserializedVirtualHubProperties.sku = reader.getString(); + } else if ("routingState".equals(fieldName)) { + deserializedVirtualHubProperties.routingState = RoutingState.fromString(reader.getString()); + } else if ("bgpConnections".equals(fieldName)) { + List bgpConnections = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualHubProperties.bgpConnections = bgpConnections; + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualHubProperties.ipConfigurations = ipConfigurations; + } else if ("routeMaps".equals(fieldName)) { + List routeMaps = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualHubProperties.routeMaps = routeMaps; + } else if ("virtualRouterAsn".equals(fieldName)) { + deserializedVirtualHubProperties.virtualRouterAsn = reader.getNullable(JsonReader::getLong); + } else if ("virtualRouterIps".equals(fieldName)) { + List virtualRouterIps = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualHubProperties.virtualRouterIps = virtualRouterIps; + } else if ("allowBranchToBranchTraffic".equals(fieldName)) { + deserializedVirtualHubProperties.allowBranchToBranchTraffic + = reader.getNullable(JsonReader::getBoolean); + } else if ("preferredRoutingGateway".equals(fieldName)) { + deserializedVirtualHubProperties.preferredRoutingGateway + = PreferredRoutingGateway.fromString(reader.getString()); + } else if ("hubRoutingPreference".equals(fieldName)) { + deserializedVirtualHubProperties.hubRoutingPreference + = HubRoutingPreference.fromString(reader.getString()); + } else if ("virtualRouterAutoScaleConfiguration".equals(fieldName)) { + deserializedVirtualHubProperties.virtualRouterAutoScaleConfiguration + = VirtualRouterAutoScaleConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubProperties; + }); + } +} 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..f2187f0fc949b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Inner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import java.io.IOException; +import java.util.List; + +/** + * VirtualHubRouteTableV2 Resource. + */ +@Fluent +public final class VirtualHubRouteTableV2Inner extends SubResource { + /* + * Properties of the virtual hub route table v2. + */ + private VirtualHubRouteTableV2Properties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VirtualHubRouteTableV2Inner class. + */ + public VirtualHubRouteTableV2Inner() { + } + + /** + * Get the innerProperties property: Properties of the virtual hub route table v2. + * + * @return the innerProperties value. + */ + private VirtualHubRouteTableV2Properties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualHubRouteTableV2Inner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the routes property: List of all routes. + * + * @return the routes value. + */ + public List routes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubRouteTableV2Properties(); + } + this.innerProperties().withRoutes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualHubRouteTableV2Properties(); + } + this.innerProperties().withAttachedConnections(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubRouteTableV2Inner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubRouteTableV2Inner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubRouteTableV2Inner. + */ + public static VirtualHubRouteTableV2Inner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubRouteTableV2Inner deserializedVirtualHubRouteTableV2Inner = new VirtualHubRouteTableV2Inner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualHubRouteTableV2Inner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualHubRouteTableV2Inner.innerProperties + = VirtualHubRouteTableV2Properties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVirtualHubRouteTableV2Inner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVirtualHubRouteTableV2Inner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubRouteTableV2Inner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Properties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Properties.java new file mode 100644 index 0000000000000..b6775d6915049 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualHubRouteTableV2Properties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for VirtualHubRouteTableV2. + */ +@Fluent +public final class VirtualHubRouteTableV2Properties implements JsonSerializable { + /* + * List of all routes. + */ + private List routes; + + /* + * List of all connections attached to this route table v2. + */ + private List attachedConnections; + + /* + * The provisioning state of the virtual hub route table v2 resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualHubRouteTableV2Properties class. + */ + public VirtualHubRouteTableV2Properties() { + } + + /** + * 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 VirtualHubRouteTableV2Properties object itself. + */ + public VirtualHubRouteTableV2Properties 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 VirtualHubRouteTableV2Properties object itself. + */ + public VirtualHubRouteTableV2Properties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routes", this.routes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("attachedConnections", this.attachedConnections, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubRouteTableV2Properties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubRouteTableV2Properties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubRouteTableV2Properties. + */ + public static VirtualHubRouteTableV2Properties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubRouteTableV2Properties deserializedVirtualHubRouteTableV2Properties + = new VirtualHubRouteTableV2Properties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routes".equals(fieldName)) { + List routes = reader.readArray(reader1 -> VirtualHubRouteV2.fromJson(reader1)); + deserializedVirtualHubRouteTableV2Properties.routes = routes; + } else if ("attachedConnections".equals(fieldName)) { + List attachedConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualHubRouteTableV2Properties.attachedConnections = attachedConnections; + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualHubRouteTableV2Properties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubRouteTableV2Properties; + }); + } +} 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..1586a2adbdcf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionInner.java @@ -0,0 +1,759 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A common class for general resource information. + */ +@Fluent +public final class VirtualNetworkGatewayConnectionInner extends Resource { + /* + * Properties of the virtual network gateway connection. + */ + private VirtualNetworkGatewayConnectionPropertiesFormatInner innerProperties + = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualNetworkGatewayConnectionInner class. + */ + public VirtualNetworkGatewayConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the virtual network gateway connection. + * + * @return the innerProperties value. + */ + private VirtualNetworkGatewayConnectionPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); + } + + /** + * Set the authorizationKey property: The authorizationKey. + * + * @param authorizationKey the authorizationKey value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withAuthorizationKey(String authorizationKey) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withAuthorizationKey(authorizationKey); + return this; + } + + /** + * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value. + */ + public VirtualNetworkGatewayInner virtualNetworkGateway1() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + /** + * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value. + */ + public VirtualNetworkGatewayInner virtualNetworkGateway2() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + + /** + * Get the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @return the localNetworkGateway2 value. + */ + public LocalNetworkGatewayInner localNetworkGateway2() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + /** + * Get the ingressNatRules property: List of ingress NatRules. + * + * @return the ingressNatRules value. + */ + public List ingressNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withIngressNatRules(ingressNatRules); + return this; + } + + /** + * Get the egressNatRules property: List of egress NatRules. + * + * @return the egressNatRules value. + */ + public List egressNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withEgressNatRules(egressNatRules); + return this; + } + + /** + * Get the connectionType property: Gateway connection type. + * + * @return the connectionType value. + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withConnectionType(connectionType); + return this; + } + + /** + * Get the connectionProtocol property: Connection protocol used for this connection. + * + * @return the connectionProtocol value. + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withConnectionProtocol(connectionProtocol); + return this; + } + + /** + * Get the routingWeight property: The routing weight. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withRoutingWeight(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withDpdTimeoutSeconds(dpdTimeoutSeconds); + return this; + } + + /** + * Get the connectionMode property: The connection mode for this connection. + * + * @return the connectionMode value. + */ + public VirtualNetworkGatewayConnectionMode connectionMode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withConnectionMode(connectionMode); + return this; + } + + /** + * Get the sharedKey property: The IPSec shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withSharedKey(sharedKey); + return this; + } + + /** + * Get the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); + } + + /** + * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value. + */ + public List tunnelConnectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().tunnelConnectionStatus(); + } + + /** + * Get the egressBytesTransferred property: The egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().egressBytesTransferred(); + } + + /** + * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().ingressBytesTransferred(); + } + + /** + * Get the peer property: The reference to peerings resource. + * + * @return the peer value. + */ + public SubResource peer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withPeer(peer); + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEnableBgp(Boolean enableBgp) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withEnableBgp(enableBgp); + return this; + } + + /** + * Get the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @return the gatewayCustomBgpIpAddresses value. + */ + public List gatewayCustomBgpIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().gatewayCustomBgpIpAddresses(); + } + + /** + * Set the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @param gatewayCustomBgpIpAddresses the gatewayCustomBgpIpAddresses value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner + withGatewayCustomBgpIpAddresses(List gatewayCustomBgpIpAddresses) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withGatewayCustomBgpIpAddresses(gatewayCustomBgpIpAddresses); + return this; + } + + /** + * Get the useLocalAzureIpAddress property: Use private local Azure IP for the connection. + * + * @return the useLocalAzureIpAddress value. + */ + public Boolean useLocalAzureIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withUseLocalAzureIpAddress(useLocalAzureIpAddress); + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withUsePolicyBasedTrafficSelectors(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withIpsecPolicies(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withTrafficSelectorPolicies(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network gateway connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value. + */ + public Boolean expressRouteGatewayBypass() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + /** + * Get the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + public Boolean enablePrivateLinkFastPath() { + return this.innerProperties() == null ? null : this.innerProperties().enablePrivateLinkFastPath(); + } + + /** + * Set the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @param enablePrivateLinkFastPath the enablePrivateLinkFastPath value to set. + * @return the VirtualNetworkGatewayConnectionInner object itself. + */ + public VirtualNetworkGatewayConnectionInner withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + } + this.innerProperties().withEnablePrivateLinkFastPath(enablePrivateLinkFastPath); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model VirtualNetworkGatewayConnectionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayConnectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayConnectionInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayConnectionInner. + */ + public static VirtualNetworkGatewayConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayConnectionInner deserializedVirtualNetworkGatewayConnectionInner + = new VirtualNetworkGatewayConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualNetworkGatewayConnectionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionInner.innerProperties + = VirtualNetworkGatewayConnectionPropertiesFormatInner.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayConnectionInner; + }); + } +} 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..fd4f57bc81a06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java @@ -0,0 +1,672 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A common class for general resource information. + */ +@Fluent +public final class VirtualNetworkGatewayConnectionListEntityInner extends Resource { + /* + * Properties of the virtual network gateway connection. + */ + private VirtualNetworkGatewayConnectionListEntityPropertiesFormat innerProperties + = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualNetworkGatewayConnectionListEntityInner class. + */ + public VirtualNetworkGatewayConnectionListEntityInner() { + } + + /** + * Get the innerProperties property: Properties of the virtual network gateway connection. + * + * @return the innerProperties value. + */ + private VirtualNetworkGatewayConnectionListEntityPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayConnectionListEntityInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayConnectionListEntityInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + public String authorizationKey() { + return this.innerProperties() == null ? null : this.innerProperties().authorizationKey(); + } + + /** + * Set the authorizationKey property: The authorizationKey. + * + * @param authorizationKey the authorizationKey value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withAuthorizationKey(String authorizationKey) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withAuthorizationKey(authorizationKey); + return this; + } + + /** + * Get the virtualNetworkGateway1 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway1 value. + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway1() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withVirtualNetworkGateway1(virtualNetworkGateway1); + return this; + } + + /** + * Get the virtualNetworkGateway2 property: The reference to virtual network gateway resource. + * + * @return the virtualNetworkGateway2 value. + */ + public VirtualNetworkConnectionGatewayReference virtualNetworkGateway2() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withVirtualNetworkGateway2(virtualNetworkGateway2); + return this; + } + + /** + * Get the localNetworkGateway2 property: The reference to local network gateway resource. + * + * @return the localNetworkGateway2 value. + */ + public VirtualNetworkConnectionGatewayReference localNetworkGateway2() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withLocalNetworkGateway2(localNetworkGateway2); + return this; + } + + /** + * Get the connectionType property: Gateway connection type. + * + * @return the connectionType value. + */ + public VirtualNetworkGatewayConnectionType connectionType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withConnectionType(connectionType); + return this; + } + + /** + * Get the connectionProtocol property: Connection protocol used for this connection. + * + * @return the connectionProtocol value. + */ + public VirtualNetworkGatewayConnectionProtocol connectionProtocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withConnectionProtocol(connectionProtocol); + return this; + } + + /** + * Get the routingWeight property: The routing weight. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withRoutingWeight(routingWeight); + return this; + } + + /** + * Get the connectionMode property: The connection mode for this connection. + * + * @return the connectionMode value. + */ + public VirtualNetworkGatewayConnectionMode connectionMode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withConnectionMode(connectionMode); + return this; + } + + /** + * Get the sharedKey property: The IPSec shared key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withSharedKey(sharedKey); + return this; + } + + /** + * Get the connectionStatus property: Virtual Network Gateway connection status. + * + * @return the connectionStatus value. + */ + public VirtualNetworkGatewayConnectionStatus connectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); + } + + /** + * Get the tunnelConnectionStatus property: Collection of all tunnels' connection health status. + * + * @return the tunnelConnectionStatus value. + */ + public List tunnelConnectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().tunnelConnectionStatus(); + } + + /** + * Get the egressBytesTransferred property: The egress bytes transferred in this connection. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().egressBytesTransferred(); + } + + /** + * Get the ingressBytesTransferred property: The ingress bytes transferred in this connection. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().ingressBytesTransferred(); + } + + /** + * Get the peer property: The reference to peerings resource. + * + * @return the peer value. + */ + public SubResource peer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withPeer(peer); + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner withEnableBgp(Boolean enableBgp) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withEnableBgp(enableBgp); + return this; + } + + /** + * Get the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @return the gatewayCustomBgpIpAddresses value. + */ + public List gatewayCustomBgpIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().gatewayCustomBgpIpAddresses(); + } + + /** + * Set the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @param gatewayCustomBgpIpAddresses the gatewayCustomBgpIpAddresses value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner + withGatewayCustomBgpIpAddresses(List gatewayCustomBgpIpAddresses) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withGatewayCustomBgpIpAddresses(gatewayCustomBgpIpAddresses); + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withUsePolicyBasedTrafficSelectors(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withIpsecPolicies(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withTrafficSelectorPolicies(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network gateway connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the expressRouteGatewayBypass property: Bypass ExpressRoute Gateway for data forwarding. + * + * @return the expressRouteGatewayBypass value. + */ + public Boolean expressRouteGatewayBypass() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withExpressRouteGatewayBypass(expressRouteGatewayBypass); + return this; + } + + /** + * Get the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + public Boolean enablePrivateLinkFastPath() { + return this.innerProperties() == null ? null : this.innerProperties().enablePrivateLinkFastPath(); + } + + /** + * Set the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @param enablePrivateLinkFastPath the enablePrivateLinkFastPath value to set. + * @return the VirtualNetworkGatewayConnectionListEntityInner object itself. + */ + public VirtualNetworkGatewayConnectionListEntityInner + withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + } + this.innerProperties().withEnablePrivateLinkFastPath(enablePrivateLinkFastPath); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model VirtualNetworkGatewayConnectionListEntityInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayConnectionListEntityInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayConnectionListEntityInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayConnectionListEntityInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayConnectionListEntityInner. + */ + public static VirtualNetworkGatewayConnectionListEntityInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayConnectionListEntityInner deserializedVirtualNetworkGatewayConnectionListEntityInner + = new VirtualNetworkGatewayConnectionListEntityInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualNetworkGatewayConnectionListEntityInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityInner.innerProperties + = VirtualNetworkGatewayConnectionListEntityPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayConnectionListEntityInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java new file mode 100644 index 0000000000000..1bedc3537bb60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.java @@ -0,0 +1,739 @@ +// Copyright (c) Microsoft 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 java.io.IOException; +import java.util.List; + +/** + * VirtualNetworkGatewayConnection properties. + */ +@Fluent +public final class VirtualNetworkGatewayConnectionListEntityPropertiesFormat + implements JsonSerializable { + /* + * The authorizationKey. + */ + private String authorizationKey; + + /* + * The reference to virtual network gateway resource. + */ + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway1; + + /* + * The reference to virtual network gateway resource. + */ + private VirtualNetworkConnectionGatewayReference virtualNetworkGateway2; + + /* + * The reference to local network gateway resource. + */ + private VirtualNetworkConnectionGatewayReference localNetworkGateway2; + + /* + * Gateway connection type. + */ + private VirtualNetworkGatewayConnectionType connectionType; + + /* + * Connection protocol used for this connection. + */ + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /* + * The routing weight. + */ + private Integer routingWeight; + + /* + * The connection mode for this connection. + */ + private VirtualNetworkGatewayConnectionMode connectionMode; + + /* + * The IPSec shared key. + */ + private String sharedKey; + + /* + * Virtual Network Gateway connection status. + */ + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * Collection of all tunnels' connection health status. + */ + private List tunnelConnectionStatus; + + /* + * The egress bytes transferred in this connection. + */ + private Long egressBytesTransferred; + + /* + * The ingress bytes transferred in this connection. + */ + private Long ingressBytesTransferred; + + /* + * The reference to peerings resource. + */ + private SubResource peer; + + /* + * EnableBgp flag. + */ + private Boolean enableBgp; + + /* + * GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + */ + private List gatewayCustomBgpIpAddresses; + + /* + * Enable policy-based traffic selectors. + */ + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + private List trafficSelectorPolicies; + + /* + * The resource GUID property of the virtual network gateway connection resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway connection resource. + */ + private ProvisioningState provisioningState; + + /* + * Bypass ExpressRoute Gateway for data forwarding. + */ + private Boolean expressRouteGatewayBypass; + + /* + * Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) + * must be enabled. + */ + private Boolean enablePrivateLinkFastPath; + + /** + * Creates an instance of VirtualNetworkGatewayConnectionListEntityPropertiesFormat class. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat() { + } + + /** + * 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @return the gatewayCustomBgpIpAddresses value. + */ + public List gatewayCustomBgpIpAddresses() { + return this.gatewayCustomBgpIpAddresses; + } + + /** + * Set the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @param gatewayCustomBgpIpAddresses the gatewayCustomBgpIpAddresses value to set. + * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + withGatewayCustomBgpIpAddresses(List gatewayCustomBgpIpAddresses) { + this.gatewayCustomBgpIpAddresses = gatewayCustomBgpIpAddresses; + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + 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 VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + public Boolean enablePrivateLinkFastPath() { + return this.enablePrivateLinkFastPath; + } + + /** + * Set the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @param enablePrivateLinkFastPath the enablePrivateLinkFastPath value to set. + * @return the VirtualNetworkGatewayConnectionListEntityPropertiesFormat object itself. + */ + public VirtualNetworkGatewayConnectionListEntityPropertiesFormat + withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath) { + this.enablePrivateLinkFastPath = enablePrivateLinkFastPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkGateway1() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualNetworkGateway1 in model VirtualNetworkGatewayConnectionListEntityPropertiesFormat")); + } else { + virtualNetworkGateway1().validate(); + } + if (virtualNetworkGateway2() != null) { + virtualNetworkGateway2().validate(); + } + if (localNetworkGateway2() != null) { + localNetworkGateway2().validate(); + } + if (connectionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectionType in model VirtualNetworkGatewayConnectionListEntityPropertiesFormat")); + } + if (tunnelConnectionStatus() != null) { + tunnelConnectionStatus().forEach(e -> e.validate()); + } + if (gatewayCustomBgpIpAddresses() != null) { + gatewayCustomBgpIpAddresses().forEach(e -> e.validate()); + } + if (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + if (trafficSelectorPolicies() != null) { + trafficSelectorPolicies().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(VirtualNetworkGatewayConnectionListEntityPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualNetworkGateway1", this.virtualNetworkGateway1); + jsonWriter.writeStringField("connectionType", + this.connectionType == null ? null : this.connectionType.toString()); + jsonWriter.writeStringField("authorizationKey", this.authorizationKey); + jsonWriter.writeJsonField("virtualNetworkGateway2", this.virtualNetworkGateway2); + jsonWriter.writeJsonField("localNetworkGateway2", this.localNetworkGateway2); + jsonWriter.writeStringField("connectionProtocol", + this.connectionProtocol == null ? null : this.connectionProtocol.toString()); + jsonWriter.writeNumberField("routingWeight", this.routingWeight); + jsonWriter.writeStringField("connectionMode", + this.connectionMode == null ? null : this.connectionMode.toString()); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeJsonField("peer", this.peer); + jsonWriter.writeBooleanField("enableBgp", this.enableBgp); + jsonWriter.writeArrayField("gatewayCustomBgpIpAddresses", this.gatewayCustomBgpIpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("usePolicyBasedTrafficSelectors", this.usePolicyBasedTrafficSelectors); + jsonWriter.writeArrayField("ipsecPolicies", this.ipsecPolicies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trafficSelectorPolicies", this.trafficSelectorPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("expressRouteGatewayBypass", this.expressRouteGatewayBypass); + jsonWriter.writeBooleanField("enablePrivateLinkFastPath", this.enablePrivateLinkFastPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayConnectionListEntityPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayConnectionListEntityPropertiesFormat if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the + * VirtualNetworkGatewayConnectionListEntityPropertiesFormat. + */ + public static VirtualNetworkGatewayConnectionListEntityPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayConnectionListEntityPropertiesFormat deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat + = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualNetworkGateway1".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.virtualNetworkGateway1 + = VirtualNetworkConnectionGatewayReference.fromJson(reader); + } else if ("connectionType".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.connectionType + = VirtualNetworkGatewayConnectionType.fromString(reader.getString()); + } else if ("authorizationKey".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.authorizationKey + = reader.getString(); + } else if ("virtualNetworkGateway2".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.virtualNetworkGateway2 + = VirtualNetworkConnectionGatewayReference.fromJson(reader); + } else if ("localNetworkGateway2".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.localNetworkGateway2 + = VirtualNetworkConnectionGatewayReference.fromJson(reader); + } else if ("connectionProtocol".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.connectionProtocol + = VirtualNetworkGatewayConnectionProtocol.fromString(reader.getString()); + } else if ("routingWeight".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.routingWeight + = reader.getNullable(JsonReader::getInt); + } else if ("connectionMode".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.connectionMode + = VirtualNetworkGatewayConnectionMode.fromString(reader.getString()); + } else if ("sharedKey".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.sharedKey + = reader.getString(); + } else if ("connectionStatus".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.connectionStatus + = VirtualNetworkGatewayConnectionStatus.fromString(reader.getString()); + } else if ("tunnelConnectionStatus".equals(fieldName)) { + List tunnelConnectionStatus + = reader.readArray(reader1 -> TunnelConnectionHealth.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.tunnelConnectionStatus + = tunnelConnectionStatus; + } else if ("egressBytesTransferred".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.egressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("ingressBytesTransferred".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.ingressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("peer".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.peer + = SubResource.fromJson(reader); + } else if ("enableBgp".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.enableBgp + = reader.getNullable(JsonReader::getBoolean); + } else if ("gatewayCustomBgpIpAddresses".equals(fieldName)) { + List gatewayCustomBgpIpAddresses + = reader.readArray(reader1 -> GatewayCustomBgpIpAddressIpConfiguration.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.gatewayCustomBgpIpAddresses + = gatewayCustomBgpIpAddresses; + } else if ("usePolicyBasedTrafficSelectors".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.usePolicyBasedTrafficSelectors + = reader.getNullable(JsonReader::getBoolean); + } else if ("ipsecPolicies".equals(fieldName)) { + List ipsecPolicies = reader.readArray(reader1 -> IpsecPolicy.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.ipsecPolicies = ipsecPolicies; + } else if ("trafficSelectorPolicies".equals(fieldName)) { + List trafficSelectorPolicies + = reader.readArray(reader1 -> TrafficSelectorPolicy.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.trafficSelectorPolicies + = trafficSelectorPolicies; + } else if ("resourceGuid".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.resourceGuid + = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("expressRouteGatewayBypass".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.expressRouteGatewayBypass + = reader.getNullable(JsonReader::getBoolean); + } else if ("enablePrivateLinkFastPath".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat.enablePrivateLinkFastPath + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayConnectionListEntityPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java new file mode 100644 index 0000000000000..0d33a08f91fa0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayConnectionPropertiesFormatInner.java @@ -0,0 +1,853 @@ +// Copyright (c) Microsoft 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 java.io.IOException; +import java.util.List; + +/** + * VirtualNetworkGatewayConnection properties. + */ +@Fluent +public final class VirtualNetworkGatewayConnectionPropertiesFormatInner + implements JsonSerializable { + /* + * The authorizationKey. + */ + private String authorizationKey; + + /* + * The reference to virtual network gateway resource. + */ + private VirtualNetworkGatewayInner virtualNetworkGateway1; + + /* + * The reference to virtual network gateway resource. + */ + private VirtualNetworkGatewayInner virtualNetworkGateway2; + + /* + * The reference to local network gateway resource. + */ + private LocalNetworkGatewayInner localNetworkGateway2; + + /* + * List of ingress NatRules. + */ + private List ingressNatRules; + + /* + * List of egress NatRules. + */ + private List egressNatRules; + + /* + * Gateway connection type. + */ + private VirtualNetworkGatewayConnectionType connectionType; + + /* + * Connection protocol used for this connection. + */ + private VirtualNetworkGatewayConnectionProtocol connectionProtocol; + + /* + * The routing weight. + */ + private Integer routingWeight; + + /* + * The dead peer detection timeout of this connection in seconds. + */ + private Integer dpdTimeoutSeconds; + + /* + * The connection mode for this connection. + */ + private VirtualNetworkGatewayConnectionMode connectionMode; + + /* + * The IPSec shared key. + */ + private String sharedKey; + + /* + * Virtual Network Gateway connection status. + */ + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * Collection of all tunnels' connection health status. + */ + private List tunnelConnectionStatus; + + /* + * The egress bytes transferred in this connection. + */ + private Long egressBytesTransferred; + + /* + * The ingress bytes transferred in this connection. + */ + private Long ingressBytesTransferred; + + /* + * The reference to peerings resource. + */ + private SubResource peer; + + /* + * EnableBgp flag. + */ + private Boolean enableBgp; + + /* + * GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. + */ + private List gatewayCustomBgpIpAddresses; + + /* + * Use private local Azure IP for the connection. + */ + private Boolean useLocalAzureIpAddress; + + /* + * Enable policy-based traffic selectors. + */ + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + private List trafficSelectorPolicies; + + /* + * The resource GUID property of the virtual network gateway connection resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway connection resource. + */ + private ProvisioningState provisioningState; + + /* + * Bypass ExpressRoute Gateway for data forwarding. + */ + private Boolean expressRouteGatewayBypass; + + /* + * Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) + * must be enabled. + */ + private Boolean enablePrivateLinkFastPath; + + /** + * Creates an instance of VirtualNetworkGatewayConnectionPropertiesFormatInner class. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner() { + } + + /** + * 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @return the gatewayCustomBgpIpAddresses value. + */ + public List gatewayCustomBgpIpAddresses() { + return this.gatewayCustomBgpIpAddresses; + } + + /** + * Set the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @param gatewayCustomBgpIpAddresses the gatewayCustomBgpIpAddresses value to set. + * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + withGatewayCustomBgpIpAddresses(List gatewayCustomBgpIpAddresses) { + this.gatewayCustomBgpIpAddresses = gatewayCustomBgpIpAddresses; + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + 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 VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + withExpressRouteGatewayBypass(Boolean expressRouteGatewayBypass) { + this.expressRouteGatewayBypass = expressRouteGatewayBypass; + return this; + } + + /** + * Get the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + public Boolean enablePrivateLinkFastPath() { + return this.enablePrivateLinkFastPath; + } + + /** + * Set the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @param enablePrivateLinkFastPath the enablePrivateLinkFastPath value to set. + * @return the VirtualNetworkGatewayConnectionPropertiesFormatInner object itself. + */ + public VirtualNetworkGatewayConnectionPropertiesFormatInner + withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath) { + this.enablePrivateLinkFastPath = enablePrivateLinkFastPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkGateway1() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualNetworkGateway1 in model VirtualNetworkGatewayConnectionPropertiesFormatInner")); + } else { + virtualNetworkGateway1().validate(); + } + if (virtualNetworkGateway2() != null) { + virtualNetworkGateway2().validate(); + } + if (localNetworkGateway2() != null) { + localNetworkGateway2().validate(); + } + if (connectionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectionType in model VirtualNetworkGatewayConnectionPropertiesFormatInner")); + } + if (tunnelConnectionStatus() != null) { + tunnelConnectionStatus().forEach(e -> e.validate()); + } + if (gatewayCustomBgpIpAddresses() != null) { + gatewayCustomBgpIpAddresses().forEach(e -> e.validate()); + } + if (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + if (trafficSelectorPolicies() != null) { + trafficSelectorPolicies().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(VirtualNetworkGatewayConnectionPropertiesFormatInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualNetworkGateway1", this.virtualNetworkGateway1); + jsonWriter.writeStringField("connectionType", + this.connectionType == null ? null : this.connectionType.toString()); + jsonWriter.writeStringField("authorizationKey", this.authorizationKey); + jsonWriter.writeJsonField("virtualNetworkGateway2", this.virtualNetworkGateway2); + jsonWriter.writeJsonField("localNetworkGateway2", this.localNetworkGateway2); + jsonWriter.writeArrayField("ingressNatRules", this.ingressNatRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("egressNatRules", this.egressNatRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("connectionProtocol", + this.connectionProtocol == null ? null : this.connectionProtocol.toString()); + jsonWriter.writeNumberField("routingWeight", this.routingWeight); + jsonWriter.writeNumberField("dpdTimeoutSeconds", this.dpdTimeoutSeconds); + jsonWriter.writeStringField("connectionMode", + this.connectionMode == null ? null : this.connectionMode.toString()); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeJsonField("peer", this.peer); + jsonWriter.writeBooleanField("enableBgp", this.enableBgp); + jsonWriter.writeArrayField("gatewayCustomBgpIpAddresses", this.gatewayCustomBgpIpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("useLocalAzureIpAddress", this.useLocalAzureIpAddress); + jsonWriter.writeBooleanField("usePolicyBasedTrafficSelectors", this.usePolicyBasedTrafficSelectors); + jsonWriter.writeArrayField("ipsecPolicies", this.ipsecPolicies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trafficSelectorPolicies", this.trafficSelectorPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("expressRouteGatewayBypass", this.expressRouteGatewayBypass); + jsonWriter.writeBooleanField("enablePrivateLinkFastPath", this.enablePrivateLinkFastPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayConnectionPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayConnectionPropertiesFormatInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayConnectionPropertiesFormatInner. + */ + public static VirtualNetworkGatewayConnectionPropertiesFormatInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayConnectionPropertiesFormatInner deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner + = new VirtualNetworkGatewayConnectionPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualNetworkGateway1".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.virtualNetworkGateway1 + = VirtualNetworkGatewayInner.fromJson(reader); + } else if ("connectionType".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.connectionType + = VirtualNetworkGatewayConnectionType.fromString(reader.getString()); + } else if ("authorizationKey".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.authorizationKey + = reader.getString(); + } else if ("virtualNetworkGateway2".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.virtualNetworkGateway2 + = VirtualNetworkGatewayInner.fromJson(reader); + } else if ("localNetworkGateway2".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.localNetworkGateway2 + = LocalNetworkGatewayInner.fromJson(reader); + } else if ("ingressNatRules".equals(fieldName)) { + List ingressNatRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.ingressNatRules = ingressNatRules; + } else if ("egressNatRules".equals(fieldName)) { + List egressNatRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.egressNatRules = egressNatRules; + } else if ("connectionProtocol".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.connectionProtocol + = VirtualNetworkGatewayConnectionProtocol.fromString(reader.getString()); + } else if ("routingWeight".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.routingWeight + = reader.getNullable(JsonReader::getInt); + } else if ("dpdTimeoutSeconds".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.dpdTimeoutSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("connectionMode".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.connectionMode + = VirtualNetworkGatewayConnectionMode.fromString(reader.getString()); + } else if ("sharedKey".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.sharedKey = reader.getString(); + } else if ("connectionStatus".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.connectionStatus + = VirtualNetworkGatewayConnectionStatus.fromString(reader.getString()); + } else if ("tunnelConnectionStatus".equals(fieldName)) { + List tunnelConnectionStatus + = reader.readArray(reader1 -> TunnelConnectionHealth.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.tunnelConnectionStatus + = tunnelConnectionStatus; + } else if ("egressBytesTransferred".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.egressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("ingressBytesTransferred".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.ingressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("peer".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.peer + = SubResource.fromJson(reader); + } else if ("enableBgp".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.enableBgp + = reader.getNullable(JsonReader::getBoolean); + } else if ("gatewayCustomBgpIpAddresses".equals(fieldName)) { + List gatewayCustomBgpIpAddresses + = reader.readArray(reader1 -> GatewayCustomBgpIpAddressIpConfiguration.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.gatewayCustomBgpIpAddresses + = gatewayCustomBgpIpAddresses; + } else if ("useLocalAzureIpAddress".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.useLocalAzureIpAddress + = reader.getNullable(JsonReader::getBoolean); + } else if ("usePolicyBasedTrafficSelectors".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.usePolicyBasedTrafficSelectors + = reader.getNullable(JsonReader::getBoolean); + } else if ("ipsecPolicies".equals(fieldName)) { + List ipsecPolicies = reader.readArray(reader1 -> IpsecPolicy.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.ipsecPolicies = ipsecPolicies; + } else if ("trafficSelectorPolicies".equals(fieldName)) { + List trafficSelectorPolicies + = reader.readArray(reader1 -> TrafficSelectorPolicy.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.trafficSelectorPolicies + = trafficSelectorPolicies; + } else if ("resourceGuid".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("expressRouteGatewayBypass".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.expressRouteGatewayBypass + = reader.getNullable(JsonReader::getBoolean); + } else if ("enablePrivateLinkFastPath".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner.enablePrivateLinkFastPath + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayConnectionPropertiesFormatInner; + }); + } +} 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..57282fbad9da1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayInner.java @@ -0,0 +1,861 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.AdminState; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResiliencyModel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayPolicyGroup; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A common class for general resource information. + */ +@Fluent +public final class VirtualNetworkGatewayInner extends Resource { + /* + * Properties of the virtual network gateway. + */ + private VirtualNetworkGatewayPropertiesFormat innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + + /* + * The extended location of type local virtual network gateway. + */ + private ExtendedLocation extendedLocation; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The identity of the virtual network gateway, if configured. + */ + private ManagedServiceIdentity identity; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualNetworkGatewayInner class. + */ + public VirtualNetworkGatewayInner() { + } + + /** + * Get the innerProperties property: Properties of the virtual network gateway. + * + * @return the innerProperties value. + */ + private VirtualNetworkGatewayPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 identity property: The identity of the virtual network gateway, if configured. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the virtual network gateway, if configured. + * + * @param identity the identity value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the autoScaleConfiguration property: Autoscale configuration for virutal network gateway. + * + * @return the autoScaleConfiguration value. + */ + public VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().autoScaleConfiguration(); + } + + /** + * Set the autoScaleConfiguration property: Autoscale configuration for virutal network gateway. + * + * @param autoScaleConfiguration the autoScaleConfiguration value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner + withAutoScaleConfiguration(VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withAutoScaleConfiguration(autoScaleConfiguration); + return this; + } + + /** + * Get the ipConfigurations property: IP configurations for virtual network gateway. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withIpConfigurations(ipConfigurations); + return this; + } + + /** + * Get the gatewayType property: The type of this virtual network gateway. + * + * @return the gatewayType value. + */ + public VirtualNetworkGatewayType gatewayType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withGatewayType(gatewayType); + return this; + } + + /** + * Get the vpnType property: The type of this virtual network gateway. + * + * @return the vpnType value. + */ + public VpnType vpnType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withVpnType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withVpnGatewayGeneration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withEnableBgp(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withEnablePrivateIpAddress(enablePrivateIpAddress); + return this; + } + + /** + * Get the active property: ActiveActive flag. + * + * @return the active value. + */ + public Boolean active() { + return this.innerProperties() == null ? null : this.innerProperties().active(); + } + + /** + * Set the active property: ActiveActive flag. + * + * @param active the active value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withActive(Boolean active) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withActive(active); + return this; + } + + /** + * Get the disableIpSecReplayProtection property: disableIPSecReplayProtection flag. + * + * @return the disableIpSecReplayProtection value. + */ + public Boolean disableIpSecReplayProtection() { + return this.innerProperties() == null ? null : this.innerProperties().disableIpSecReplayProtection(); + } + + /** + * Set the disableIpSecReplayProtection property: disableIPSecReplayProtection flag. + * + * @param disableIpSecReplayProtection the disableIpSecReplayProtection value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withDisableIpSecReplayProtection(Boolean disableIpSecReplayProtection) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withDisableIpSecReplayProtection(disableIpSecReplayProtection); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withGatewayDefaultSite(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withSku(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withVpnClientConfiguration(vpnClientConfiguration); + return this; + } + + /** + * Get the virtualNetworkGatewayPolicyGroups property: The reference to the VirtualNetworkGatewayPolicyGroup + * resource which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + * + * @return the virtualNetworkGatewayPolicyGroups value. + */ + public List virtualNetworkGatewayPolicyGroups() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkGatewayPolicyGroups(); + } + + /** + * Set the virtualNetworkGatewayPolicyGroups property: The reference to the VirtualNetworkGatewayPolicyGroup + * resource which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + * + * @param virtualNetworkGatewayPolicyGroups the virtualNetworkGatewayPolicyGroups value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withVirtualNetworkGatewayPolicyGroups( + List virtualNetworkGatewayPolicyGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withVirtualNetworkGatewayPolicyGroups(virtualNetworkGatewayPolicyGroups); + return this; + } + + /** + * Get the bgpSettings property: Virtual network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + public BgpSettings bgpSettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withBgpSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withCustomRoutes(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the enableDnsForwarding property: Whether dns forwarding is enabled or not. + * + * @return the enableDnsForwarding value. + */ + public Boolean enableDnsForwarding() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withEnableDnsForwarding(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withVNetExtendedLocationResourceId(vNetExtendedLocationResourceId); + return this; + } + + /** + * Get the natRules property: NatRules for virtual network gateway. + * + * @return the natRules value. + */ + public List natRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withNatRules(natRules); + return this; + } + + /** + * Get the enableBgpRouteTranslationForNat property: EnableBgpRouteTranslationForNat flag. + * + * @return the enableBgpRouteTranslationForNat value. + */ + public Boolean enableBgpRouteTranslationForNat() { + return this.innerProperties() == null ? null : this.innerProperties().enableBgpRouteTranslationForNat(); + } + + /** + * Set the enableBgpRouteTranslationForNat property: EnableBgpRouteTranslationForNat flag. + * + * @param enableBgpRouteTranslationForNat the enableBgpRouteTranslationForNat value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withEnableBgpRouteTranslationForNat(enableBgpRouteTranslationForNat); + return this; + } + + /** + * Get the allowVirtualWanTraffic property: Configures this gateway to accept traffic from remote Virtual WAN + * networks. + * + * @return the allowVirtualWanTraffic value. + */ + public Boolean allowVirtualWanTraffic() { + return this.innerProperties() == null ? null : this.innerProperties().allowVirtualWanTraffic(); + } + + /** + * Set the allowVirtualWanTraffic property: Configures this gateway to accept traffic from remote Virtual WAN + * networks. + * + * @param allowVirtualWanTraffic the allowVirtualWanTraffic value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withAllowVirtualWanTraffic(Boolean allowVirtualWanTraffic) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withAllowVirtualWanTraffic(allowVirtualWanTraffic); + return this; + } + + /** + * Get the allowRemoteVnetTraffic property: Configure this gateway to accept traffic from other Azure Virtual + * Networks. This configuration does not support connectivity to Azure Virtual WAN. + * + * @return the allowRemoteVnetTraffic value. + */ + public Boolean allowRemoteVnetTraffic() { + return this.innerProperties() == null ? null : this.innerProperties().allowRemoteVnetTraffic(); + } + + /** + * Set the allowRemoteVnetTraffic property: Configure this gateway to accept traffic from other Azure Virtual + * Networks. This configuration does not support connectivity to Azure Virtual WAN. + * + * @param allowRemoteVnetTraffic the allowRemoteVnetTraffic value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withAllowRemoteVnetTraffic(Boolean allowRemoteVnetTraffic) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withAllowRemoteVnetTraffic(allowRemoteVnetTraffic); + return this; + } + + /** + * Get the adminState property: Property to indicate if the Express Route Gateway serves traffic when there are + * multiple Express Route Gateways in the vnet. + * + * @return the adminState value. + */ + public AdminState adminState() { + return this.innerProperties() == null ? null : this.innerProperties().adminState(); + } + + /** + * Set the adminState property: Property to indicate if the Express Route Gateway serves traffic when there are + * multiple Express Route Gateways in the vnet. + * + * @param adminState the adminState value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withAdminState(AdminState adminState) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withAdminState(adminState); + return this; + } + + /** + * Get the resiliencyModel property: Property to indicate if the Express Route Gateway has resiliency model of + * MultiHomed or SingleHomed. + * + * @return the resiliencyModel value. + */ + public ResiliencyModel resiliencyModel() { + return this.innerProperties() == null ? null : this.innerProperties().resiliencyModel(); + } + + /** + * Set the resiliencyModel property: Property to indicate if the Express Route Gateway has resiliency model of + * MultiHomed or SingleHomed. + * + * @param resiliencyModel the resiliencyModel value to set. + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withResiliencyModel(ResiliencyModel resiliencyModel) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPropertiesFormat(); + } + this.innerProperties().withResiliencyModel(resiliencyModel); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model VirtualNetworkGatewayInner")); + } else { + innerProperties().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayInner. + */ + public static VirtualNetworkGatewayInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayInner deserializedVirtualNetworkGatewayInner = new VirtualNetworkGatewayInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualNetworkGatewayInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.innerProperties + = VirtualNetworkGatewayPropertiesFormat.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedVirtualNetworkGatewayInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..6542c3aec2ba2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayIpConfigurationPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of VirtualNetworkGatewayIPConfiguration. + */ +@Fluent +public final class VirtualNetworkGatewayIpConfigurationPropertiesFormat + implements JsonSerializable { + /* + * The private IP address allocation method. + */ + private IpAllocationMethod privateIpAllocationMethod; + + /* + * The reference to the subnet resource. + */ + private SubResource subnet; + + /* + * The reference to the public IP resource. + */ + private SubResource publicIpAddress; + + /* + * Private IP Address for this gateway. + */ + private String privateIpAddress; + + /* + * The provisioning state of the virtual network gateway IP configuration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualNetworkGatewayIpConfigurationPropertiesFormat class. + */ + public VirtualNetworkGatewayIpConfigurationPropertiesFormat() { + } + + /** + * 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 VirtualNetworkGatewayIpConfigurationPropertiesFormat object itself. + */ + public VirtualNetworkGatewayIpConfigurationPropertiesFormat + 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 VirtualNetworkGatewayIpConfigurationPropertiesFormat object itself. + */ + public VirtualNetworkGatewayIpConfigurationPropertiesFormat 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 VirtualNetworkGatewayIpConfigurationPropertiesFormat object itself. + */ + public VirtualNetworkGatewayIpConfigurationPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("publicIPAddress", this.publicIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayIpConfigurationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayIpConfigurationPropertiesFormat if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayIpConfigurationPropertiesFormat. + */ + public static VirtualNetworkGatewayIpConfigurationPropertiesFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayIpConfigurationPropertiesFormat deserializedVirtualNetworkGatewayIpConfigurationPropertiesFormat + = new VirtualNetworkGatewayIpConfigurationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfigurationPropertiesFormat.privateIpAllocationMethod + = IpAllocationMethod.fromString(reader.getString()); + } else if ("subnet".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfigurationPropertiesFormat.subnet + = SubResource.fromJson(reader); + } else if ("publicIPAddress".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfigurationPropertiesFormat.publicIpAddress + = SubResource.fromJson(reader); + } else if ("privateIPAddress".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfigurationPropertiesFormat.privateIpAddress + = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfigurationPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayIpConfigurationPropertiesFormat; + }); + } +} 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..17d61e6f35646 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * VirtualNetworkGatewayNatRule Resource. + */ +@Fluent +public final class VirtualNetworkGatewayNatRuleInner extends SubResource { + /* + * Properties of the Virtual Network Gateway NAT rule. + */ + private VirtualNetworkGatewayNatRuleProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of VirtualNetworkGatewayNatRuleInner class. + */ + public VirtualNetworkGatewayNatRuleInner() { + } + + /** + * Get the innerProperties property: Properties of the Virtual Network Gateway NAT rule. + * + * @return the innerProperties value. + */ + private VirtualNetworkGatewayNatRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayNatRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the type property: The type of NAT rule for VPN NAT. + * + * @return the type value. + */ + public VpnNatRuleType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type of NAT rule for VPN NAT. + * + * @param type the type value to set. + * @return the VirtualNetworkGatewayNatRuleInner object itself. + */ + public VirtualNetworkGatewayNatRuleInner withTypePropertiesType(VpnNatRuleType type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayNatRuleProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + public VpnNatRuleMode mode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayNatRuleProperties(); + } + this.innerProperties().withMode(mode); + return this; + } + + /** + * Get the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + public List internalMappings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayNatRuleProperties(); + } + this.innerProperties().withInternalMappings(internalMappings); + return this; + } + + /** + * Get the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + public List externalMappings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayNatRuleProperties(); + } + this.innerProperties().withExternalMappings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayNatRuleProperties(); + } + this.innerProperties().withIpConfigurationId(ipConfigurationId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayNatRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayNatRuleInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayNatRuleInner. + */ + public static VirtualNetworkGatewayNatRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayNatRuleInner deserializedVirtualNetworkGatewayNatRuleInner + = new VirtualNetworkGatewayNatRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleInner.innerProperties + = VirtualNetworkGatewayNatRuleProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayNatRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleProperties.java new file mode 100644 index 0000000000000..64c3a407323b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayNatRuleProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for VirtualNetworkGatewayNatRule. + */ +@Fluent +public final class VirtualNetworkGatewayNatRuleProperties + implements JsonSerializable { + /* + * The provisioning state of the NAT Rule resource. + */ + private ProvisioningState provisioningState; + + /* + * The type of NAT rule for VPN NAT. + */ + private VpnNatRuleType type; + + /* + * The Source NAT direction of a VPN NAT. + */ + private VpnNatRuleMode mode; + + /* + * The private IP address internal mapping for NAT. + */ + private List internalMappings; + + /* + * The private IP address external mapping for NAT. + */ + private List externalMappings; + + /* + * The IP Configuration ID this NAT rule applies to. + */ + private String ipConfigurationId; + + /** + * Creates an instance of VirtualNetworkGatewayNatRuleProperties class. + */ + public VirtualNetworkGatewayNatRuleProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the type property: The type of NAT rule for VPN NAT. + * + * @return the type value. + */ + public VpnNatRuleType type() { + return this.type; + } + + /** + * Set the type property: The type of NAT rule for VPN NAT. + * + * @param type the type value to set. + * @return the VirtualNetworkGatewayNatRuleProperties object itself. + */ + public VirtualNetworkGatewayNatRuleProperties withType(VpnNatRuleType type) { + this.type = type; + 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 VirtualNetworkGatewayNatRuleProperties object itself. + */ + public VirtualNetworkGatewayNatRuleProperties 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 VirtualNetworkGatewayNatRuleProperties object itself. + */ + public VirtualNetworkGatewayNatRuleProperties 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 VirtualNetworkGatewayNatRuleProperties object itself. + */ + public VirtualNetworkGatewayNatRuleProperties 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 VirtualNetworkGatewayNatRuleProperties object itself. + */ + public VirtualNetworkGatewayNatRuleProperties withIpConfigurationId(String ipConfigurationId) { + this.ipConfigurationId = ipConfigurationId; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeArrayField("internalMappings", this.internalMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("externalMappings", this.externalMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("ipConfigurationId", this.ipConfigurationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayNatRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayNatRuleProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayNatRuleProperties. + */ + public static VirtualNetworkGatewayNatRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayNatRuleProperties deserializedVirtualNetworkGatewayNatRuleProperties + = new VirtualNetworkGatewayNatRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleProperties.type + = VpnNatRuleType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleProperties.mode + = VpnNatRuleMode.fromString(reader.getString()); + } else if ("internalMappings".equals(fieldName)) { + List internalMappings + = reader.readArray(reader1 -> VpnNatRuleMapping.fromJson(reader1)); + deserializedVirtualNetworkGatewayNatRuleProperties.internalMappings = internalMappings; + } else if ("externalMappings".equals(fieldName)) { + List externalMappings + = reader.readArray(reader1 -> VpnNatRuleMapping.fromJson(reader1)); + deserializedVirtualNetworkGatewayNatRuleProperties.externalMappings = externalMappings; + } else if ("ipConfigurationId".equals(fieldName)) { + deserializedVirtualNetworkGatewayNatRuleProperties.ipConfigurationId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayNatRuleProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPolicyGroupProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPolicyGroupProperties.java new file mode 100644 index 0000000000000..6428e41f71a90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPolicyGroupProperties.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayPolicyGroupMember; +import java.io.IOException; +import java.util.List; + +/** + * Properties of VirtualNetworkGatewayPolicyGroup. + */ +@Fluent +public final class VirtualNetworkGatewayPolicyGroupProperties + implements JsonSerializable { + /* + * Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + */ + private boolean isDefault; + + /* + * Priority for VirtualNetworkGatewayPolicyGroup. + */ + private int priority; + + /* + * Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + */ + private List policyMembers; + + /* + * List of references to vngClientConnectionConfigurations. + */ + private List vngClientConnectionConfigurations; + + /* + * The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualNetworkGatewayPolicyGroupProperties class. + */ + public VirtualNetworkGatewayPolicyGroupProperties() { + } + + /** + * Get the isDefault property: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + * + * @return the isDefault value. + */ + public boolean isDefault() { + return this.isDefault; + } + + /** + * Set the isDefault property: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + * + * @param isDefault the isDefault value to set. + * @return the VirtualNetworkGatewayPolicyGroupProperties object itself. + */ + public VirtualNetworkGatewayPolicyGroupProperties withIsDefault(boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the priority property: Priority for VirtualNetworkGatewayPolicyGroup. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: Priority for VirtualNetworkGatewayPolicyGroup. + * + * @param priority the priority value to set. + * @return the VirtualNetworkGatewayPolicyGroupProperties object itself. + */ + public VirtualNetworkGatewayPolicyGroupProperties withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the policyMembers property: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + * + * @return the policyMembers value. + */ + public List policyMembers() { + return this.policyMembers; + } + + /** + * Set the policyMembers property: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + * + * @param policyMembers the policyMembers value to set. + * @return the VirtualNetworkGatewayPolicyGroupProperties object itself. + */ + public VirtualNetworkGatewayPolicyGroupProperties + withPolicyMembers(List policyMembers) { + this.policyMembers = policyMembers; + return this; + } + + /** + * Get the vngClientConnectionConfigurations property: List of references to vngClientConnectionConfigurations. + * + * @return the vngClientConnectionConfigurations value. + */ + public List vngClientConnectionConfigurations() { + return this.vngClientConnectionConfigurations; + } + + /** + * Get the provisioningState property: The provisioning state of the VirtualNetworkGatewayPolicyGroup 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() { + if (policyMembers() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policyMembers in model VirtualNetworkGatewayPolicyGroupProperties")); + } else { + policyMembers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkGatewayPolicyGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeIntField("priority", this.priority); + jsonWriter.writeArrayField("policyMembers", this.policyMembers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayPolicyGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayPolicyGroupProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayPolicyGroupProperties. + */ + public static VirtualNetworkGatewayPolicyGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayPolicyGroupProperties deserializedVirtualNetworkGatewayPolicyGroupProperties + = new VirtualNetworkGatewayPolicyGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isDefault".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroupProperties.isDefault = reader.getBoolean(); + } else if ("priority".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroupProperties.priority = reader.getInt(); + } else if ("policyMembers".equals(fieldName)) { + List policyMembers + = reader.readArray(reader1 -> VirtualNetworkGatewayPolicyGroupMember.fromJson(reader1)); + deserializedVirtualNetworkGatewayPolicyGroupProperties.policyMembers = policyMembers; + } else if ("vngClientConnectionConfigurations".equals(fieldName)) { + List vngClientConnectionConfigurations + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualNetworkGatewayPolicyGroupProperties.vngClientConnectionConfigurations + = vngClientConnectionConfigurations; + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayPolicyGroupProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPropertiesFormat.java new file mode 100644 index 0000000000000..fc874e3807cf1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkGatewayPropertiesFormat.java @@ -0,0 +1,863 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.AdminState; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResiliencyModel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayPolicyGroup; +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 java.io.IOException; +import java.util.List; + +/** + * VirtualNetworkGateway properties. + */ +@Fluent +public final class VirtualNetworkGatewayPropertiesFormat + implements JsonSerializable { + /* + * Autoscale configuration for virutal network gateway + */ + private VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration; + + /* + * IP configurations for virtual network gateway. + */ + private List ipConfigurations; + + /* + * The type of this virtual network gateway. + */ + private VirtualNetworkGatewayType gatewayType; + + /* + * The type of this virtual network gateway. + */ + private VpnType vpnType; + + /* + * The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. + */ + private VpnGatewayGeneration vpnGatewayGeneration; + + /* + * Whether BGP is enabled for this virtual network gateway or not. + */ + private Boolean enableBgp; + + /* + * Whether private IP needs to be enabled on this gateway for connections or not. + */ + private Boolean enablePrivateIpAddress; + + /* + * ActiveActive flag. + */ + private Boolean active; + + /* + * disableIPSecReplayProtection flag. + */ + private Boolean disableIpSecReplayProtection; + + /* + * 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. + */ + private SubResource gatewayDefaultSite; + + /* + * The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network + * gateway. + */ + private VirtualNetworkGatewaySku sku; + + /* + * The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations. + */ + private VpnClientConfiguration vpnClientConfiguration; + + /* + * The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the available + * VirtualNetworkGatewayPolicyGroup for the gateway. + */ + private List virtualNetworkGatewayPolicyGroups; + + /* + * Virtual network gateway's BGP speaker settings. + */ + 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. + */ + private AddressSpace customRoutes; + + /* + * The resource GUID property of the virtual network gateway resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the virtual network gateway resource. + */ + private ProvisioningState provisioningState; + + /* + * Whether dns forwarding is enabled or not. + */ + private Boolean enableDnsForwarding; + + /* + * The IP address allocated by the gateway to which dns requests can be sent. + */ + private String inboundDnsForwardingEndpoint; + + /* + * Customer vnet resource id. VirtualNetworkGateway of type local gateway is associated with the customer vnet. + */ + private String vNetExtendedLocationResourceId; + + /* + * NatRules for virtual network gateway. + */ + private List natRules; + + /* + * EnableBgpRouteTranslationForNat flag. + */ + private Boolean enableBgpRouteTranslationForNat; + + /* + * Configures this gateway to accept traffic from remote Virtual WAN networks. + */ + private Boolean allowVirtualWanTraffic; + + /* + * Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration does not support + * connectivity to Azure Virtual WAN. + */ + private Boolean allowRemoteVnetTraffic; + + /* + * Property to indicate if the Express Route Gateway serves traffic when there are multiple Express Route Gateways + * in the vnet + */ + private AdminState adminState; + + /* + * Property to indicate if the Express Route Gateway has resiliency model of MultiHomed or SingleHomed + */ + private ResiliencyModel resiliencyModel; + + /** + * Creates an instance of VirtualNetworkGatewayPropertiesFormat class. + */ + public VirtualNetworkGatewayPropertiesFormat() { + } + + /** + * Get the autoScaleConfiguration property: Autoscale configuration for virutal network gateway. + * + * @return the autoScaleConfiguration value. + */ + public VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration() { + return this.autoScaleConfiguration; + } + + /** + * Set the autoScaleConfiguration property: Autoscale configuration for virutal network gateway. + * + * @param autoScaleConfiguration the autoScaleConfiguration value to set. + * @return the VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat + withAutoScaleConfiguration(VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration) { + this.autoScaleConfiguration = autoScaleConfiguration; + return this; + } + + /** + * 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat + 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat withActive(Boolean active) { + this.active = active; + return this; + } + + /** + * Get the disableIpSecReplayProtection property: disableIPSecReplayProtection flag. + * + * @return the disableIpSecReplayProtection value. + */ + public Boolean disableIpSecReplayProtection() { + return this.disableIpSecReplayProtection; + } + + /** + * Set the disableIpSecReplayProtection property: disableIPSecReplayProtection flag. + * + * @param disableIpSecReplayProtection the disableIpSecReplayProtection value to set. + * @return the VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat + withDisableIpSecReplayProtection(Boolean disableIpSecReplayProtection) { + this.disableIpSecReplayProtection = disableIpSecReplayProtection; + 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat + withVpnClientConfiguration(VpnClientConfiguration vpnClientConfiguration) { + this.vpnClientConfiguration = vpnClientConfiguration; + return this; + } + + /** + * Get the virtualNetworkGatewayPolicyGroups property: The reference to the VirtualNetworkGatewayPolicyGroup + * resource which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + * + * @return the virtualNetworkGatewayPolicyGroups value. + */ + public List virtualNetworkGatewayPolicyGroups() { + return this.virtualNetworkGatewayPolicyGroups; + } + + /** + * Set the virtualNetworkGatewayPolicyGroups property: The reference to the VirtualNetworkGatewayPolicyGroup + * resource which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + * + * @param virtualNetworkGatewayPolicyGroups the virtualNetworkGatewayPolicyGroups value to set. + * @return the VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat withVirtualNetworkGatewayPolicyGroups( + List virtualNetworkGatewayPolicyGroups) { + this.virtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; + 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat + 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat 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 VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat + withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + this.enableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + return this; + } + + /** + * Get the allowVirtualWanTraffic property: Configures this gateway to accept traffic from remote Virtual WAN + * networks. + * + * @return the allowVirtualWanTraffic value. + */ + public Boolean allowVirtualWanTraffic() { + return this.allowVirtualWanTraffic; + } + + /** + * Set the allowVirtualWanTraffic property: Configures this gateway to accept traffic from remote Virtual WAN + * networks. + * + * @param allowVirtualWanTraffic the allowVirtualWanTraffic value to set. + * @return the VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat withAllowVirtualWanTraffic(Boolean allowVirtualWanTraffic) { + this.allowVirtualWanTraffic = allowVirtualWanTraffic; + return this; + } + + /** + * Get the allowRemoteVnetTraffic property: Configure this gateway to accept traffic from other Azure Virtual + * Networks. This configuration does not support connectivity to Azure Virtual WAN. + * + * @return the allowRemoteVnetTraffic value. + */ + public Boolean allowRemoteVnetTraffic() { + return this.allowRemoteVnetTraffic; + } + + /** + * Set the allowRemoteVnetTraffic property: Configure this gateway to accept traffic from other Azure Virtual + * Networks. This configuration does not support connectivity to Azure Virtual WAN. + * + * @param allowRemoteVnetTraffic the allowRemoteVnetTraffic value to set. + * @return the VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat withAllowRemoteVnetTraffic(Boolean allowRemoteVnetTraffic) { + this.allowRemoteVnetTraffic = allowRemoteVnetTraffic; + return this; + } + + /** + * Get the adminState property: Property to indicate if the Express Route Gateway serves traffic when there are + * multiple Express Route Gateways in the vnet. + * + * @return the adminState value. + */ + public AdminState adminState() { + return this.adminState; + } + + /** + * Set the adminState property: Property to indicate if the Express Route Gateway serves traffic when there are + * multiple Express Route Gateways in the vnet. + * + * @param adminState the adminState value to set. + * @return the VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat withAdminState(AdminState adminState) { + this.adminState = adminState; + return this; + } + + /** + * Get the resiliencyModel property: Property to indicate if the Express Route Gateway has resiliency model of + * MultiHomed or SingleHomed. + * + * @return the resiliencyModel value. + */ + public ResiliencyModel resiliencyModel() { + return this.resiliencyModel; + } + + /** + * Set the resiliencyModel property: Property to indicate if the Express Route Gateway has resiliency model of + * MultiHomed or SingleHomed. + * + * @param resiliencyModel the resiliencyModel value to set. + * @return the VirtualNetworkGatewayPropertiesFormat object itself. + */ + public VirtualNetworkGatewayPropertiesFormat withResiliencyModel(ResiliencyModel resiliencyModel) { + this.resiliencyModel = resiliencyModel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoScaleConfiguration() != null) { + autoScaleConfiguration().validate(); + } + if (ipConfigurations() != null) { + ipConfigurations().forEach(e -> e.validate()); + } + if (sku() != null) { + sku().validate(); + } + if (vpnClientConfiguration() != null) { + vpnClientConfiguration().validate(); + } + if (virtualNetworkGatewayPolicyGroups() != null) { + virtualNetworkGatewayPolicyGroups().forEach(e -> e.validate()); + } + if (bgpSettings() != null) { + bgpSettings().validate(); + } + if (customRoutes() != null) { + customRoutes().validate(); + } + if (natRules() != null) { + natRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("autoScaleConfiguration", this.autoScaleConfiguration); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("gatewayType", this.gatewayType == null ? null : this.gatewayType.toString()); + jsonWriter.writeStringField("vpnType", this.vpnType == null ? null : this.vpnType.toString()); + jsonWriter.writeStringField("vpnGatewayGeneration", + this.vpnGatewayGeneration == null ? null : this.vpnGatewayGeneration.toString()); + jsonWriter.writeBooleanField("enableBgp", this.enableBgp); + jsonWriter.writeBooleanField("enablePrivateIpAddress", this.enablePrivateIpAddress); + jsonWriter.writeBooleanField("activeActive", this.active); + jsonWriter.writeBooleanField("disableIPSecReplayProtection", this.disableIpSecReplayProtection); + jsonWriter.writeJsonField("gatewayDefaultSite", this.gatewayDefaultSite); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("vpnClientConfiguration", this.vpnClientConfiguration); + jsonWriter.writeArrayField("virtualNetworkGatewayPolicyGroups", this.virtualNetworkGatewayPolicyGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("bgpSettings", this.bgpSettings); + jsonWriter.writeJsonField("customRoutes", this.customRoutes); + jsonWriter.writeBooleanField("enableDnsForwarding", this.enableDnsForwarding); + jsonWriter.writeStringField("vNetExtendedLocationResourceId", this.vNetExtendedLocationResourceId); + jsonWriter.writeArrayField("natRules", this.natRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enableBgpRouteTranslationForNat", this.enableBgpRouteTranslationForNat); + jsonWriter.writeBooleanField("allowVirtualWanTraffic", this.allowVirtualWanTraffic); + jsonWriter.writeBooleanField("allowRemoteVnetTraffic", this.allowRemoteVnetTraffic); + jsonWriter.writeStringField("adminState", this.adminState == null ? null : this.adminState.toString()); + jsonWriter.writeStringField("resiliencyModel", + this.resiliencyModel == null ? null : this.resiliencyModel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayPropertiesFormat. + */ + public static VirtualNetworkGatewayPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayPropertiesFormat deserializedVirtualNetworkGatewayPropertiesFormat + = new VirtualNetworkGatewayPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("autoScaleConfiguration".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.autoScaleConfiguration + = VirtualNetworkGatewayAutoScaleConfiguration.fromJson(reader); + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> VirtualNetworkGatewayIpConfiguration.fromJson(reader1)); + deserializedVirtualNetworkGatewayPropertiesFormat.ipConfigurations = ipConfigurations; + } else if ("gatewayType".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.gatewayType + = VirtualNetworkGatewayType.fromString(reader.getString()); + } else if ("vpnType".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.vpnType = VpnType.fromString(reader.getString()); + } else if ("vpnGatewayGeneration".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.vpnGatewayGeneration + = VpnGatewayGeneration.fromString(reader.getString()); + } else if ("enableBgp".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.enableBgp + = reader.getNullable(JsonReader::getBoolean); + } else if ("enablePrivateIpAddress".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.enablePrivateIpAddress + = reader.getNullable(JsonReader::getBoolean); + } else if ("activeActive".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.active + = reader.getNullable(JsonReader::getBoolean); + } else if ("disableIPSecReplayProtection".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.disableIpSecReplayProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("gatewayDefaultSite".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.gatewayDefaultSite = SubResource.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.sku = VirtualNetworkGatewaySku.fromJson(reader); + } else if ("vpnClientConfiguration".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.vpnClientConfiguration + = VpnClientConfiguration.fromJson(reader); + } else if ("virtualNetworkGatewayPolicyGroups".equals(fieldName)) { + List virtualNetworkGatewayPolicyGroups + = reader.readArray(reader1 -> VirtualNetworkGatewayPolicyGroup.fromJson(reader1)); + deserializedVirtualNetworkGatewayPropertiesFormat.virtualNetworkGatewayPolicyGroups + = virtualNetworkGatewayPolicyGroups; + } else if ("bgpSettings".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.bgpSettings = BgpSettings.fromJson(reader); + } else if ("customRoutes".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.customRoutes = AddressSpace.fromJson(reader); + } else if ("resourceGuid".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("enableDnsForwarding".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.enableDnsForwarding + = reader.getNullable(JsonReader::getBoolean); + } else if ("inboundDnsForwardingEndpoint".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.inboundDnsForwardingEndpoint = reader.getString(); + } else if ("vNetExtendedLocationResourceId".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.vNetExtendedLocationResourceId + = reader.getString(); + } else if ("natRules".equals(fieldName)) { + List natRules + = reader.readArray(reader1 -> VirtualNetworkGatewayNatRuleInner.fromJson(reader1)); + deserializedVirtualNetworkGatewayPropertiesFormat.natRules = natRules; + } else if ("enableBgpRouteTranslationForNat".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.enableBgpRouteTranslationForNat + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowVirtualWanTraffic".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.allowVirtualWanTraffic + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowRemoteVnetTraffic".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.allowRemoteVnetTraffic + = reader.getNullable(JsonReader::getBoolean); + } else if ("adminState".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.adminState + = AdminState.fromString(reader.getString()); + } else if ("resiliencyModel".equals(fieldName)) { + deserializedVirtualNetworkGatewayPropertiesFormat.resiliencyModel + = ResiliencyModel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayPropertiesFormat; + }); + } +} 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..550ff45aef4f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkInner.java @@ -0,0 +1,546 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.PrivateEndpointVNetPolicies; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryption; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Virtual Network resource. + */ +@Fluent +public final class VirtualNetworkInner extends Resource { + /* + * The extended location of the virtual network. + */ + private ExtendedLocation extendedLocation; + + /* + * Properties of the virtual network. + */ + private VirtualNetworkPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualNetworkInner class. + */ + public VirtualNetworkInner() { + } + + /** + * 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 innerProperties property: Properties of the virtual network. + * + * @return the innerProperties value. + */ + private VirtualNetworkPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withAddressSpace(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withDhcpOptions(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withFlowTimeoutInMinutes(flowTimeoutInMinutes); + return this; + } + + /** + * Get the subnets property: A list of subnets in a Virtual Network. + * + * @return the subnets value. + */ + public List subnets() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withSubnets(subnets); + return this; + } + + /** + * Get the virtualNetworkPeerings property: A list of peerings in a Virtual Network. + * + * @return the virtualNetworkPeerings value. + */ + public List virtualNetworkPeerings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withVirtualNetworkPeerings(virtualNetworkPeerings); + return this; + } + + /** + * Get the resourceGuid property: The resourceGuid property of the Virtual Network resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withEnableDdosProtection(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withEnableVmProtection(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withDdosProtectionPlan(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withBgpCommunities(bgpCommunities); + return this; + } + + /** + * Get the encryption property: Indicates if encryption is enabled on virtual network and if VM without encryption + * is allowed in encrypted VNet. + * + * @return the encryption value. + */ + public VirtualNetworkEncryption encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Indicates if encryption is enabled on virtual network and if VM without encryption + * is allowed in encrypted VNet. + * + * @param encryption the encryption value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner withEncryption(VirtualNetworkEncryption encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the ipAllocations property: Array of IpAllocation which reference this VNET. + * + * @return the ipAllocations value. + */ + public List ipAllocations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withIpAllocations(ipAllocations); + return this; + } + + /** + * Get the flowLogs property: A collection of references to flow log resources. + * + * @return the flowLogs value. + */ + public List flowLogs() { + return this.innerProperties() == null ? null : this.innerProperties().flowLogs(); + } + + /** + * Get the privateEndpointVNetPolicies property: Private Endpoint VNet Policies. + * + * @return the privateEndpointVNetPolicies value. + */ + public PrivateEndpointVNetPolicies privateEndpointVNetPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointVNetPolicies(); + } + + /** + * Set the privateEndpointVNetPolicies property: Private Endpoint VNet Policies. + * + * @param privateEndpointVNetPolicies the privateEndpointVNetPolicies value to set. + * @return the VirtualNetworkInner object itself. + */ + public VirtualNetworkInner + withPrivateEndpointVNetPolicies(PrivateEndpointVNetPolicies privateEndpointVNetPolicies) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPropertiesFormat(); + } + this.innerProperties().withPrivateEndpointVNetPolicies(privateEndpointVNetPolicies); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extendedLocation() != null) { + extendedLocation().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkInner. + */ + public static VirtualNetworkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkInner deserializedVirtualNetworkInner = new VirtualNetworkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualNetworkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualNetworkInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualNetworkInner.withTags(tags); + } else if ("extendedLocation".equals(fieldName)) { + deserializedVirtualNetworkInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkInner.innerProperties = VirtualNetworkPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualNetworkInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkInner; + }); + } +} 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..51cfc2fb93e2d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringInner.java @@ -0,0 +1,621 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.VirtualNetworkEncryption; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringLevel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringState; +import java.io.IOException; +import java.util.List; + +/** + * Peerings in a virtual network resource. + */ +@Fluent +public final class VirtualNetworkPeeringInner extends SubResource { + /* + * Properties of the virtual network peering. + */ + private VirtualNetworkPeeringPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of VirtualNetworkPeeringInner class. + */ + public VirtualNetworkPeeringInner() { + } + + /** + * Get the innerProperties property: Properties of the virtual network peering. + * + * @return the innerProperties value. + */ + private VirtualNetworkPeeringPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkPeeringInner withId(String id) { + super.withId(id); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withAllowVirtualNetworkAccess(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withAllowForwardedTraffic(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withAllowGatewayTransit(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withUseRemoteGateways(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withRemoteVirtualNetwork(remoteVirtualNetwork); + return this; + } + + /** + * Get the localAddressSpace property: The local address space of the local virtual network that is peered. + * + * @return the localAddressSpace value. + */ + public AddressSpace localAddressSpace() { + return this.innerProperties() == null ? null : this.innerProperties().localAddressSpace(); + } + + /** + * Set the localAddressSpace property: The local address space of the local virtual network that is peered. + * + * @param localAddressSpace the localAddressSpace value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withLocalAddressSpace(AddressSpace localAddressSpace) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withLocalAddressSpace(localAddressSpace); + return this; + } + + /** + * Get the localVirtualNetworkAddressSpace property: The current local address space of the local virtual network + * that is peered. + * + * @return the localVirtualNetworkAddressSpace value. + */ + public AddressSpace localVirtualNetworkAddressSpace() { + return this.innerProperties() == null ? null : this.innerProperties().localVirtualNetworkAddressSpace(); + } + + /** + * Set the localVirtualNetworkAddressSpace property: The current local address space of the local virtual network + * that is peered. + * + * @param localVirtualNetworkAddressSpace the localVirtualNetworkAddressSpace value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner + withLocalVirtualNetworkAddressSpace(AddressSpace localVirtualNetworkAddressSpace) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withLocalVirtualNetworkAddressSpace(localVirtualNetworkAddressSpace); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withRemoteAddressSpace(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withRemoteVirtualNetworkAddressSpace(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withRemoteBgpCommunities(remoteBgpCommunities); + return this; + } + + /** + * Get the remoteVirtualNetworkEncryption property: The reference to the remote virtual network's encryption. + * + * @return the remoteVirtualNetworkEncryption value. + */ + public VirtualNetworkEncryption remoteVirtualNetworkEncryption() { + return this.innerProperties() == null ? null : this.innerProperties().remoteVirtualNetworkEncryption(); + } + + /** + * Get the peeringState property: The status of the virtual network peering. + * + * @return the peeringState value. + */ + public VirtualNetworkPeeringState peeringState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withPeeringState(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withPeeringSyncLevel(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withDoNotVerifyRemoteGateways(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.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the peerCompleteVnets property: Whether complete virtual network address space is peered. + * + * @return the peerCompleteVnets value. + */ + public Boolean peerCompleteVnets() { + return this.innerProperties() == null ? null : this.innerProperties().peerCompleteVnets(); + } + + /** + * Set the peerCompleteVnets property: Whether complete virtual network address space is peered. + * + * @param peerCompleteVnets the peerCompleteVnets value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withPeerCompleteVnets(Boolean peerCompleteVnets) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withPeerCompleteVnets(peerCompleteVnets); + return this; + } + + /** + * Get the enableOnlyIPv6Peering property: Whether only Ipv6 address space is peered for subnet peering. + * + * @return the enableOnlyIPv6Peering value. + */ + public Boolean enableOnlyIPv6Peering() { + return this.innerProperties() == null ? null : this.innerProperties().enableOnlyIPv6Peering(); + } + + /** + * Set the enableOnlyIPv6Peering property: Whether only Ipv6 address space is peered for subnet peering. + * + * @param enableOnlyIPv6Peering the enableOnlyIPv6Peering value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withEnableOnlyIPv6Peering(Boolean enableOnlyIPv6Peering) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withEnableOnlyIPv6Peering(enableOnlyIPv6Peering); + return this; + } + + /** + * Get the localSubnetNames property: List of local subnet names that are subnet peered with remote virtual network. + * + * @return the localSubnetNames value. + */ + public List localSubnetNames() { + return this.innerProperties() == null ? null : this.innerProperties().localSubnetNames(); + } + + /** + * Set the localSubnetNames property: List of local subnet names that are subnet peered with remote virtual network. + * + * @param localSubnetNames the localSubnetNames value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withLocalSubnetNames(List localSubnetNames) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withLocalSubnetNames(localSubnetNames); + return this; + } + + /** + * Get the remoteSubnetNames property: List of remote subnet names from remote virtual network that are subnet + * peered. + * + * @return the remoteSubnetNames value. + */ + public List remoteSubnetNames() { + return this.innerProperties() == null ? null : this.innerProperties().remoteSubnetNames(); + } + + /** + * Set the remoteSubnetNames property: List of remote subnet names from remote virtual network that are subnet + * peered. + * + * @param remoteSubnetNames the remoteSubnetNames value to set. + * @return the VirtualNetworkPeeringInner object itself. + */ + public VirtualNetworkPeeringInner withRemoteSubnetNames(List remoteSubnetNames) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkPeeringPropertiesFormat(); + } + this.innerProperties().withRemoteSubnetNames(remoteSubnetNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkPeeringInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkPeeringInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkPeeringInner. + */ + public static VirtualNetworkPeeringInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkPeeringInner deserializedVirtualNetworkPeeringInner = new VirtualNetworkPeeringInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkPeeringInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkPeeringInner.innerProperties + = VirtualNetworkPeeringPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVirtualNetworkPeeringInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkPeeringInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkPeeringInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkPeeringInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringPropertiesFormat.java new file mode 100644 index 0000000000000..9aead2abf0f65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPeeringPropertiesFormat.java @@ -0,0 +1,669 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.VirtualNetworkEncryption; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringLevel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the virtual network peering. + */ +@Fluent +public final class VirtualNetworkPeeringPropertiesFormat + implements JsonSerializable { + /* + * Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network + * space. + */ + private Boolean allowVirtualNetworkAccess; + + /* + * Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote + * virtual network. + */ + private Boolean allowForwardedTraffic; + + /* + * If gateway links can be used in remote virtual networking to link to this virtual network. + */ + 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. + */ + 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). + */ + private SubResource remoteVirtualNetwork; + + /* + * The local address space of the local virtual network that is peered. + */ + private AddressSpace localAddressSpace; + + /* + * The current local address space of the local virtual network that is peered. + */ + private AddressSpace localVirtualNetworkAddressSpace; + + /* + * The reference to the address space peered with the remote virtual network. + */ + private AddressSpace remoteAddressSpace; + + /* + * The reference to the current address space of the remote virtual network. + */ + private AddressSpace remoteVirtualNetworkAddressSpace; + + /* + * The reference to the remote virtual network's Bgp Communities. + */ + private VirtualNetworkBgpCommunities remoteBgpCommunities; + + /* + * The reference to the remote virtual network's encryption + */ + private VirtualNetworkEncryption remoteVirtualNetworkEncryption; + + /* + * The status of the virtual network peering. + */ + private VirtualNetworkPeeringState peeringState; + + /* + * The peering sync status of the virtual network peering. + */ + private VirtualNetworkPeeringLevel peeringSyncLevel; + + /* + * The provisioning state of the virtual network peering resource. + */ + private ProvisioningState provisioningState; + + /* + * If we need to verify the provisioning state of the remote gateway. + */ + private Boolean doNotVerifyRemoteGateways; + + /* + * The resourceGuid property of the Virtual Network peering resource. + */ + private String resourceGuid; + + /* + * Whether complete virtual network address space is peered. + */ + private Boolean peerCompleteVnets; + + /* + * Whether only Ipv6 address space is peered for subnet peering. + */ + private Boolean enableOnlyIPv6Peering; + + /* + * List of local subnet names that are subnet peered with remote virtual network. + */ + private List localSubnetNames; + + /* + * List of remote subnet names from remote virtual network that are subnet peered. + */ + private List remoteSubnetNames; + + /** + * Creates an instance of VirtualNetworkPeeringPropertiesFormat class. + */ + public VirtualNetworkPeeringPropertiesFormat() { + } + + /** + * 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat withRemoteVirtualNetwork(SubResource remoteVirtualNetwork) { + this.remoteVirtualNetwork = remoteVirtualNetwork; + return this; + } + + /** + * Get the localAddressSpace property: The local address space of the local virtual network that is peered. + * + * @return the localAddressSpace value. + */ + public AddressSpace localAddressSpace() { + return this.localAddressSpace; + } + + /** + * Set the localAddressSpace property: The local address space of the local virtual network that is peered. + * + * @param localAddressSpace the localAddressSpace value to set. + * @return the VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat withLocalAddressSpace(AddressSpace localAddressSpace) { + this.localAddressSpace = localAddressSpace; + return this; + } + + /** + * Get the localVirtualNetworkAddressSpace property: The current local address space of the local virtual network + * that is peered. + * + * @return the localVirtualNetworkAddressSpace value. + */ + public AddressSpace localVirtualNetworkAddressSpace() { + return this.localVirtualNetworkAddressSpace; + } + + /** + * Set the localVirtualNetworkAddressSpace property: The current local address space of the local virtual network + * that is peered. + * + * @param localVirtualNetworkAddressSpace the localVirtualNetworkAddressSpace value to set. + * @return the VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat + withLocalVirtualNetworkAddressSpace(AddressSpace localVirtualNetworkAddressSpace) { + this.localVirtualNetworkAddressSpace = localVirtualNetworkAddressSpace; + 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat + 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat + withRemoteBgpCommunities(VirtualNetworkBgpCommunities remoteBgpCommunities) { + this.remoteBgpCommunities = remoteBgpCommunities; + return this; + } + + /** + * Get the remoteVirtualNetworkEncryption property: The reference to the remote virtual network's encryption. + * + * @return the remoteVirtualNetworkEncryption value. + */ + public VirtualNetworkEncryption remoteVirtualNetworkEncryption() { + return this.remoteVirtualNetworkEncryption; + } + + /** + * 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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 VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat 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; + } + + /** + * Get the peerCompleteVnets property: Whether complete virtual network address space is peered. + * + * @return the peerCompleteVnets value. + */ + public Boolean peerCompleteVnets() { + return this.peerCompleteVnets; + } + + /** + * Set the peerCompleteVnets property: Whether complete virtual network address space is peered. + * + * @param peerCompleteVnets the peerCompleteVnets value to set. + * @return the VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat withPeerCompleteVnets(Boolean peerCompleteVnets) { + this.peerCompleteVnets = peerCompleteVnets; + return this; + } + + /** + * Get the enableOnlyIPv6Peering property: Whether only Ipv6 address space is peered for subnet peering. + * + * @return the enableOnlyIPv6Peering value. + */ + public Boolean enableOnlyIPv6Peering() { + return this.enableOnlyIPv6Peering; + } + + /** + * Set the enableOnlyIPv6Peering property: Whether only Ipv6 address space is peered for subnet peering. + * + * @param enableOnlyIPv6Peering the enableOnlyIPv6Peering value to set. + * @return the VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat withEnableOnlyIPv6Peering(Boolean enableOnlyIPv6Peering) { + this.enableOnlyIPv6Peering = enableOnlyIPv6Peering; + return this; + } + + /** + * Get the localSubnetNames property: List of local subnet names that are subnet peered with remote virtual network. + * + * @return the localSubnetNames value. + */ + public List localSubnetNames() { + return this.localSubnetNames; + } + + /** + * Set the localSubnetNames property: List of local subnet names that are subnet peered with remote virtual network. + * + * @param localSubnetNames the localSubnetNames value to set. + * @return the VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat withLocalSubnetNames(List localSubnetNames) { + this.localSubnetNames = localSubnetNames; + return this; + } + + /** + * Get the remoteSubnetNames property: List of remote subnet names from remote virtual network that are subnet + * peered. + * + * @return the remoteSubnetNames value. + */ + public List remoteSubnetNames() { + return this.remoteSubnetNames; + } + + /** + * Set the remoteSubnetNames property: List of remote subnet names from remote virtual network that are subnet + * peered. + * + * @param remoteSubnetNames the remoteSubnetNames value to set. + * @return the VirtualNetworkPeeringPropertiesFormat object itself. + */ + public VirtualNetworkPeeringPropertiesFormat withRemoteSubnetNames(List remoteSubnetNames) { + this.remoteSubnetNames = remoteSubnetNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (localAddressSpace() != null) { + localAddressSpace().validate(); + } + if (localVirtualNetworkAddressSpace() != null) { + localVirtualNetworkAddressSpace().validate(); + } + if (remoteAddressSpace() != null) { + remoteAddressSpace().validate(); + } + if (remoteVirtualNetworkAddressSpace() != null) { + remoteVirtualNetworkAddressSpace().validate(); + } + if (remoteBgpCommunities() != null) { + remoteBgpCommunities().validate(); + } + if (remoteVirtualNetworkEncryption() != null) { + remoteVirtualNetworkEncryption().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowVirtualNetworkAccess", this.allowVirtualNetworkAccess); + jsonWriter.writeBooleanField("allowForwardedTraffic", this.allowForwardedTraffic); + jsonWriter.writeBooleanField("allowGatewayTransit", this.allowGatewayTransit); + jsonWriter.writeBooleanField("useRemoteGateways", this.useRemoteGateways); + jsonWriter.writeJsonField("remoteVirtualNetwork", this.remoteVirtualNetwork); + jsonWriter.writeJsonField("localAddressSpace", this.localAddressSpace); + jsonWriter.writeJsonField("localVirtualNetworkAddressSpace", this.localVirtualNetworkAddressSpace); + jsonWriter.writeJsonField("remoteAddressSpace", this.remoteAddressSpace); + jsonWriter.writeJsonField("remoteVirtualNetworkAddressSpace", this.remoteVirtualNetworkAddressSpace); + jsonWriter.writeJsonField("remoteBgpCommunities", this.remoteBgpCommunities); + jsonWriter.writeStringField("peeringState", this.peeringState == null ? null : this.peeringState.toString()); + jsonWriter.writeStringField("peeringSyncLevel", + this.peeringSyncLevel == null ? null : this.peeringSyncLevel.toString()); + jsonWriter.writeBooleanField("doNotVerifyRemoteGateways", this.doNotVerifyRemoteGateways); + jsonWriter.writeBooleanField("peerCompleteVnets", this.peerCompleteVnets); + jsonWriter.writeBooleanField("enableOnlyIPv6Peering", this.enableOnlyIPv6Peering); + jsonWriter.writeArrayField("localSubnetNames", this.localSubnetNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("remoteSubnetNames", this.remoteSubnetNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkPeeringPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkPeeringPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkPeeringPropertiesFormat. + */ + public static VirtualNetworkPeeringPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkPeeringPropertiesFormat deserializedVirtualNetworkPeeringPropertiesFormat + = new VirtualNetworkPeeringPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowVirtualNetworkAccess".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.allowVirtualNetworkAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowForwardedTraffic".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.allowForwardedTraffic + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowGatewayTransit".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.allowGatewayTransit + = reader.getNullable(JsonReader::getBoolean); + } else if ("useRemoteGateways".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.useRemoteGateways + = reader.getNullable(JsonReader::getBoolean); + } else if ("remoteVirtualNetwork".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.remoteVirtualNetwork + = SubResource.fromJson(reader); + } else if ("localAddressSpace".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.localAddressSpace = AddressSpace.fromJson(reader); + } else if ("localVirtualNetworkAddressSpace".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.localVirtualNetworkAddressSpace + = AddressSpace.fromJson(reader); + } else if ("remoteAddressSpace".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.remoteAddressSpace + = AddressSpace.fromJson(reader); + } else if ("remoteVirtualNetworkAddressSpace".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.remoteVirtualNetworkAddressSpace + = AddressSpace.fromJson(reader); + } else if ("remoteBgpCommunities".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.remoteBgpCommunities + = VirtualNetworkBgpCommunities.fromJson(reader); + } else if ("remoteVirtualNetworkEncryption".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.remoteVirtualNetworkEncryption + = VirtualNetworkEncryption.fromJson(reader); + } else if ("peeringState".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.peeringState + = VirtualNetworkPeeringState.fromString(reader.getString()); + } else if ("peeringSyncLevel".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.peeringSyncLevel + = VirtualNetworkPeeringLevel.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("doNotVerifyRemoteGateways".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.doNotVerifyRemoteGateways + = reader.getNullable(JsonReader::getBoolean); + } else if ("resourceGuid".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.resourceGuid = reader.getString(); + } else if ("peerCompleteVnets".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.peerCompleteVnets + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableOnlyIPv6Peering".equals(fieldName)) { + deserializedVirtualNetworkPeeringPropertiesFormat.enableOnlyIPv6Peering + = reader.getNullable(JsonReader::getBoolean); + } else if ("localSubnetNames".equals(fieldName)) { + List localSubnetNames = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualNetworkPeeringPropertiesFormat.localSubnetNames = localSubnetNames; + } else if ("remoteSubnetNames".equals(fieldName)) { + List remoteSubnetNames = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualNetworkPeeringPropertiesFormat.remoteSubnetNames = remoteSubnetNames; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkPeeringPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPropertiesFormat.java new file mode 100644 index 0000000000000..a0d19a4dc6e4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.DhcpOptions; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointVNetPolicies; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryption; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the virtual network. + */ +@Fluent +public final class VirtualNetworkPropertiesFormat implements JsonSerializable { + /* + * The AddressSpace that contains an array of IP address ranges that can be used by subnets. + */ + private AddressSpace addressSpace; + + /* + * The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. + */ + private DhcpOptions dhcpOptions; + + /* + * The FlowTimeout value (in minutes) for the Virtual Network + */ + private Integer flowTimeoutInMinutes; + + /* + * A list of subnets in a Virtual Network. + */ + private List subnets; + + /* + * A list of peerings in a Virtual Network. + */ + private List virtualNetworkPeerings; + + /* + * The resourceGuid property of the Virtual Network resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the virtual network resource. + */ + 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. + */ + private Boolean enableDdosProtection; + + /* + * Indicates if VM protection is enabled for all the subnets in the virtual network. + */ + private Boolean enableVmProtection; + + /* + * The DDoS protection plan associated with the virtual network. + */ + private SubResource ddosProtectionPlan; + + /* + * Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. + */ + private VirtualNetworkBgpCommunities bgpCommunities; + + /* + * Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. + */ + private VirtualNetworkEncryption encryption; + + /* + * Array of IpAllocation which reference this VNET. + */ + private List ipAllocations; + + /* + * A collection of references to flow log resources. + */ + private List flowLogs; + + /* + * Private Endpoint VNet Policies. + */ + private PrivateEndpointVNetPolicies privateEndpointVNetPolicies; + + /** + * Creates an instance of VirtualNetworkPropertiesFormat class. + */ + public VirtualNetworkPropertiesFormat() { + } + + /** + * 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat + 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat withBgpCommunities(VirtualNetworkBgpCommunities bgpCommunities) { + this.bgpCommunities = bgpCommunities; + return this; + } + + /** + * Get the encryption property: Indicates if encryption is enabled on virtual network and if VM without encryption + * is allowed in encrypted VNet. + * + * @return the encryption value. + */ + public VirtualNetworkEncryption encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Indicates if encryption is enabled on virtual network and if VM without encryption + * is allowed in encrypted VNet. + * + * @param encryption the encryption value to set. + * @return the VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat withEncryption(VirtualNetworkEncryption encryption) { + this.encryption = encryption; + 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 VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat withIpAllocations(List ipAllocations) { + this.ipAllocations = ipAllocations; + return this; + } + + /** + * Get the flowLogs property: A collection of references to flow log resources. + * + * @return the flowLogs value. + */ + public List flowLogs() { + return this.flowLogs; + } + + /** + * Get the privateEndpointVNetPolicies property: Private Endpoint VNet Policies. + * + * @return the privateEndpointVNetPolicies value. + */ + public PrivateEndpointVNetPolicies privateEndpointVNetPolicies() { + return this.privateEndpointVNetPolicies; + } + + /** + * Set the privateEndpointVNetPolicies property: Private Endpoint VNet Policies. + * + * @param privateEndpointVNetPolicies the privateEndpointVNetPolicies value to set. + * @return the VirtualNetworkPropertiesFormat object itself. + */ + public VirtualNetworkPropertiesFormat + withPrivateEndpointVNetPolicies(PrivateEndpointVNetPolicies privateEndpointVNetPolicies) { + this.privateEndpointVNetPolicies = privateEndpointVNetPolicies; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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(); + } + if (encryption() != null) { + encryption().validate(); + } + if (flowLogs() != null) { + flowLogs().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("addressSpace", this.addressSpace); + jsonWriter.writeJsonField("dhcpOptions", this.dhcpOptions); + jsonWriter.writeNumberField("flowTimeoutInMinutes", this.flowTimeoutInMinutes); + jsonWriter.writeArrayField("subnets", this.subnets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("virtualNetworkPeerings", this.virtualNetworkPeerings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enableDdosProtection", this.enableDdosProtection); + jsonWriter.writeBooleanField("enableVmProtection", this.enableVmProtection); + jsonWriter.writeJsonField("ddosProtectionPlan", this.ddosProtectionPlan); + jsonWriter.writeJsonField("bgpCommunities", this.bgpCommunities); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeArrayField("ipAllocations", this.ipAllocations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("privateEndpointVNetPolicies", + this.privateEndpointVNetPolicies == null ? null : this.privateEndpointVNetPolicies.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkPropertiesFormat. + */ + public static VirtualNetworkPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkPropertiesFormat deserializedVirtualNetworkPropertiesFormat + = new VirtualNetworkPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressSpace".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.addressSpace = AddressSpace.fromJson(reader); + } else if ("dhcpOptions".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.dhcpOptions = DhcpOptions.fromJson(reader); + } else if ("flowTimeoutInMinutes".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.flowTimeoutInMinutes + = reader.getNullable(JsonReader::getInt); + } else if ("subnets".equals(fieldName)) { + List subnets = reader.readArray(reader1 -> SubnetInner.fromJson(reader1)); + deserializedVirtualNetworkPropertiesFormat.subnets = subnets; + } else if ("virtualNetworkPeerings".equals(fieldName)) { + List virtualNetworkPeerings + = reader.readArray(reader1 -> VirtualNetworkPeeringInner.fromJson(reader1)); + deserializedVirtualNetworkPropertiesFormat.virtualNetworkPeerings = virtualNetworkPeerings; + } else if ("resourceGuid".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("enableDdosProtection".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.enableDdosProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableVmProtection".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.enableVmProtection + = reader.getNullable(JsonReader::getBoolean); + } else if ("ddosProtectionPlan".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.ddosProtectionPlan = SubResource.fromJson(reader); + } else if ("bgpCommunities".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.bgpCommunities + = VirtualNetworkBgpCommunities.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.encryption = VirtualNetworkEncryption.fromJson(reader); + } else if ("ipAllocations".equals(fieldName)) { + List ipAllocations = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualNetworkPropertiesFormat.ipAllocations = ipAllocations; + } else if ("flowLogs".equals(fieldName)) { + List flowLogs = reader.readArray(reader1 -> FlowLogInner.fromJson(reader1)); + deserializedVirtualNetworkPropertiesFormat.flowLogs = flowLogs; + } else if ("privateEndpointVNetPolicies".equals(fieldName)) { + deserializedVirtualNetworkPropertiesFormat.privateEndpointVNetPolicies + = PrivateEndpointVNetPolicies.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkPropertiesFormat; + }); + } +} 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..f71ae295a302c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapInner.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Virtual Network Tap resource. + */ +@Fluent +public final class VirtualNetworkTapInner extends Resource { + /* + * Virtual Network Tap Properties. + */ + private VirtualNetworkTapPropertiesFormatInner innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualNetworkTapInner class. + */ + public VirtualNetworkTapInner() { + } + + /** + * Get the innerProperties property: Virtual Network Tap Properties. + * + * @return the innerProperties value. + */ + private VirtualNetworkTapPropertiesFormatInner innerProperties() { + return this.innerProperties; + } + + /** + * 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 VirtualNetworkTapInner object itself. + */ + public VirtualNetworkTapInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkTapInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkTapInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().networkInterfaceTapConfigurations(); + } + + /** + * Get the resourceGuid property: The resource GUID property of the virtual network tap resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual network tap resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null + ? null + : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkTapPropertiesFormatInner(); + } + this.innerProperties() + .withDestinationNetworkInterfaceIpConfiguration(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.innerProperties() == null + ? null + : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkTapPropertiesFormatInner(); + } + this.innerProperties() + .withDestinationLoadBalancerFrontEndIpConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkTapPropertiesFormatInner(); + } + this.innerProperties().withDestinationPort(destinationPort); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkTapInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkTapInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkTapInner. + */ + public static VirtualNetworkTapInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkTapInner deserializedVirtualNetworkTapInner = new VirtualNetworkTapInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualNetworkTapInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualNetworkTapInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualNetworkTapInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualNetworkTapInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkTapInner.innerProperties + = VirtualNetworkTapPropertiesFormatInner.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkTapInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualNetworkTapInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkTapInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapPropertiesFormatInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapPropertiesFormatInner.java new file mode 100644 index 0000000000000..cf37418ddb314 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkTapPropertiesFormatInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Virtual Network Tap properties. + */ +@Fluent +public final class VirtualNetworkTapPropertiesFormatInner + implements JsonSerializable { + /* + * Specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. + */ + private List networkInterfaceTapConfigurations; + + /* + * The resource GUID property of the virtual network tap resource. + */ + private String resourceGuid; + + /* + * The provisioning state of the virtual network tap resource. + */ + private ProvisioningState provisioningState; + + /* + * The reference to the private IP Address of the collector nic that will receive the tap. + */ + private NetworkInterfaceIpConfigurationInner destinationNetworkInterfaceIpConfiguration; + + /* + * The reference to the private IP address on the internal Load Balancer that will receive the tap. + */ + private FrontendIpConfigurationInner destinationLoadBalancerFrontEndIpConfiguration; + + /* + * The VXLAN destination port that will receive the tapped traffic. + */ + private Integer destinationPort; + + /** + * Creates an instance of VirtualNetworkTapPropertiesFormatInner class. + */ + public VirtualNetworkTapPropertiesFormatInner() { + } + + /** + * 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 VirtualNetworkTapPropertiesFormatInner object itself. + */ + public VirtualNetworkTapPropertiesFormatInner 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 VirtualNetworkTapPropertiesFormatInner object itself. + */ + public VirtualNetworkTapPropertiesFormatInner 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 VirtualNetworkTapPropertiesFormatInner object itself. + */ + public VirtualNetworkTapPropertiesFormatInner withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationNetworkInterfaceIPConfiguration", + this.destinationNetworkInterfaceIpConfiguration); + jsonWriter.writeJsonField("destinationLoadBalancerFrontEndIPConfiguration", + this.destinationLoadBalancerFrontEndIpConfiguration); + jsonWriter.writeNumberField("destinationPort", this.destinationPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkTapPropertiesFormatInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkTapPropertiesFormatInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkTapPropertiesFormatInner. + */ + public static VirtualNetworkTapPropertiesFormatInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkTapPropertiesFormatInner deserializedVirtualNetworkTapPropertiesFormatInner + = new VirtualNetworkTapPropertiesFormatInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaceTapConfigurations".equals(fieldName)) { + List networkInterfaceTapConfigurations + = reader.readArray(reader1 -> NetworkInterfaceTapConfigurationInner.fromJson(reader1)); + deserializedVirtualNetworkTapPropertiesFormatInner.networkInterfaceTapConfigurations + = networkInterfaceTapConfigurations; + } else if ("resourceGuid".equals(fieldName)) { + deserializedVirtualNetworkTapPropertiesFormatInner.resourceGuid = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualNetworkTapPropertiesFormatInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("destinationNetworkInterfaceIPConfiguration".equals(fieldName)) { + deserializedVirtualNetworkTapPropertiesFormatInner.destinationNetworkInterfaceIpConfiguration + = NetworkInterfaceIpConfigurationInner.fromJson(reader); + } else if ("destinationLoadBalancerFrontEndIPConfiguration".equals(fieldName)) { + deserializedVirtualNetworkTapPropertiesFormatInner.destinationLoadBalancerFrontEndIpConfiguration + = FrontendIpConfigurationInner.fromJson(reader); + } else if ("destinationPort".equals(fieldName)) { + deserializedVirtualNetworkTapPropertiesFormatInner.destinationPort + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkTapPropertiesFormatInner; + }); + } +} 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..c0db141d021de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualNetworkUsageInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsageName; +import java.io.IOException; + +/** + * Usage details for subnet. + */ +@Immutable +public final class VirtualNetworkUsageInner implements JsonSerializable { + /* + * Indicates number of IPs used from the Subnet. + */ + private Double currentValue; + + /* + * Subnet identifier. + */ + private String id; + + /* + * Indicates the size of the subnet. + */ + private Double limit; + + /* + * The name containing common and localized value for usage. + */ + private VirtualNetworkUsageName name; + + /* + * Usage units. Returns 'Count'. + */ + private String unit; + + /** + * Creates an instance of VirtualNetworkUsageInner class. + */ + public VirtualNetworkUsageInner() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkUsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkUsageInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkUsageInner. + */ + public static VirtualNetworkUsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkUsageInner deserializedVirtualNetworkUsageInner = new VirtualNetworkUsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentValue".equals(fieldName)) { + deserializedVirtualNetworkUsageInner.currentValue = reader.getNullable(JsonReader::getDouble); + } else if ("id".equals(fieldName)) { + deserializedVirtualNetworkUsageInner.id = reader.getString(); + } else if ("limit".equals(fieldName)) { + deserializedVirtualNetworkUsageInner.limit = reader.getNullable(JsonReader::getDouble); + } else if ("name".equals(fieldName)) { + deserializedVirtualNetworkUsageInner.name = VirtualNetworkUsageName.fromJson(reader); + } else if ("unit".equals(fieldName)) { + deserializedVirtualNetworkUsageInner.unit = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkUsageInner; + }); + } +} 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..985fd05db9eba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterInner.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * VirtualRouter Resource. + */ +@Fluent +public final class VirtualRouterInner extends Resource { + /* + * Properties of the Virtual Router. + */ + private VirtualRouterPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualRouterInner class. + */ + public VirtualRouterInner() { + } + + /** + * Get the innerProperties property: Properties of the Virtual Router. + * + * @return the innerProperties value. + */ + private VirtualRouterPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 VirtualRouterInner object itself. + */ + public VirtualRouterInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualRouterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualRouterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the virtualRouterAsn property: VirtualRouter ASN. + * + * @return the virtualRouterAsn value. + */ + public Long virtualRouterAsn() { + return this.innerProperties() == null ? null : this.innerProperties().virtualRouterAsn(); + } + + /** + * Set the virtualRouterAsn property: VirtualRouter ASN. + * + * @param virtualRouterAsn the virtualRouterAsn value to set. + * @return the VirtualRouterInner object itself. + */ + public VirtualRouterInner withVirtualRouterAsn(Long virtualRouterAsn) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualRouterPropertiesFormat(); + } + this.innerProperties().withVirtualRouterAsn(virtualRouterAsn); + return this; + } + + /** + * Get the virtualRouterIps property: VirtualRouter IPs. + * + * @return the virtualRouterIps value. + */ + public List virtualRouterIps() { + return this.innerProperties() == null ? null : this.innerProperties().virtualRouterIps(); + } + + /** + * Set the virtualRouterIps property: VirtualRouter IPs. + * + * @param virtualRouterIps the virtualRouterIps value to set. + * @return the VirtualRouterInner object itself. + */ + public VirtualRouterInner withVirtualRouterIps(List virtualRouterIps) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualRouterPropertiesFormat(); + } + this.innerProperties().withVirtualRouterIps(virtualRouterIps); + return this; + } + + /** + * Get the hostedSubnet property: The Subnet on which VirtualRouter is hosted. + * + * @return the hostedSubnet value. + */ + public SubResource hostedSubnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualRouterPropertiesFormat(); + } + this.innerProperties().withHostedSubnet(hostedSubnet); + return this; + } + + /** + * Get the hostedGateway property: The Gateway on which VirtualRouter is hosted. + * + * @return the hostedGateway value. + */ + public SubResource hostedGateway() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualRouterPropertiesFormat(); + } + this.innerProperties().withHostedGateway(hostedGateway); + return this; + } + + /** + * Get the peerings property: List of references to VirtualRouterPeerings. + * + * @return the peerings value. + */ + public List peerings() { + return this.innerProperties() == null ? null : this.innerProperties().peerings(); + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualRouterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualRouterInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualRouterInner. + */ + public static VirtualRouterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualRouterInner deserializedVirtualRouterInner = new VirtualRouterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualRouterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualRouterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualRouterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualRouterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualRouterInner.innerProperties = VirtualRouterPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualRouterInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualRouterInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualRouterInner; + }); + } +} 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..79845e3e654a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Virtual Router Peering resource. + */ +@Fluent +public final class VirtualRouterPeeringInner extends SubResource { + /* + * The properties of the Virtual Router Peering. + */ + private VirtualRouterPeeringProperties innerProperties; + + /* + * Name of the virtual router peering that is unique within a virtual router. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Peering type. + */ + private String type; + + /** + * Creates an instance of VirtualRouterPeeringInner class. + */ + public VirtualRouterPeeringInner() { + } + + /** + * Get the innerProperties property: The properties of the Virtual Router Peering. + * + * @return the innerProperties value. + */ + private VirtualRouterPeeringProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualRouterPeeringInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the peerAsn property: Peer ASN. + * + * @return the peerAsn value. + */ + public Long peerAsn() { + return this.innerProperties() == null ? null : this.innerProperties().peerAsn(); + } + + /** + * Set the peerAsn property: Peer ASN. + * + * @param peerAsn the peerAsn value to set. + * @return the VirtualRouterPeeringInner object itself. + */ + public VirtualRouterPeeringInner withPeerAsn(Long peerAsn) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualRouterPeeringProperties(); + } + this.innerProperties().withPeerAsn(peerAsn); + return this; + } + + /** + * Get the peerIp property: Peer IP. + * + * @return the peerIp value. + */ + public String peerIp() { + return this.innerProperties() == null ? null : this.innerProperties().peerIp(); + } + + /** + * Set the peerIp property: Peer IP. + * + * @param peerIp the peerIp value to set. + * @return the VirtualRouterPeeringInner object itself. + */ + public VirtualRouterPeeringInner withPeerIp(String peerIp) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualRouterPeeringProperties(); + } + this.innerProperties().withPeerIp(peerIp); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualRouterPeeringInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualRouterPeeringInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualRouterPeeringInner. + */ + public static VirtualRouterPeeringInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualRouterPeeringInner deserializedVirtualRouterPeeringInner = new VirtualRouterPeeringInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualRouterPeeringInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualRouterPeeringInner.innerProperties + = VirtualRouterPeeringProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVirtualRouterPeeringInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVirtualRouterPeeringInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualRouterPeeringInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualRouterPeeringInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringProperties.java new file mode 100644 index 0000000000000..7460e96ea765f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPeeringProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the rule group. + */ +@Fluent +public final class VirtualRouterPeeringProperties implements JsonSerializable { + /* + * Peer ASN. + */ + private Long peerAsn; + + /* + * Peer IP. + */ + private String peerIp; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualRouterPeeringProperties class. + */ + public VirtualRouterPeeringProperties() { + } + + /** + * 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 VirtualRouterPeeringProperties object itself. + */ + public VirtualRouterPeeringProperties 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 VirtualRouterPeeringProperties object itself. + */ + public VirtualRouterPeeringProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("peerAsn", this.peerAsn); + jsonWriter.writeStringField("peerIp", this.peerIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualRouterPeeringProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualRouterPeeringProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualRouterPeeringProperties. + */ + public static VirtualRouterPeeringProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualRouterPeeringProperties deserializedVirtualRouterPeeringProperties + = new VirtualRouterPeeringProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("peerAsn".equals(fieldName)) { + deserializedVirtualRouterPeeringProperties.peerAsn = reader.getNullable(JsonReader::getLong); + } else if ("peerIp".equals(fieldName)) { + deserializedVirtualRouterPeeringProperties.peerIp = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualRouterPeeringProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualRouterPeeringProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPropertiesFormat.java new file mode 100644 index 0000000000000..3291b369268e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualRouterPropertiesFormat.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Virtual Router definition. + */ +@Fluent +public final class VirtualRouterPropertiesFormat implements JsonSerializable { + /* + * VirtualRouter ASN. + */ + private Long virtualRouterAsn; + + /* + * VirtualRouter IPs. + */ + private List virtualRouterIps; + + /* + * The Subnet on which VirtualRouter is hosted. + */ + private SubResource hostedSubnet; + + /* + * The Gateway on which VirtualRouter is hosted. + */ + private SubResource hostedGateway; + + /* + * List of references to VirtualRouterPeerings. + */ + private List peerings; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VirtualRouterPropertiesFormat class. + */ + public VirtualRouterPropertiesFormat() { + } + + /** + * 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 VirtualRouterPropertiesFormat object itself. + */ + public VirtualRouterPropertiesFormat 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 VirtualRouterPropertiesFormat object itself. + */ + public VirtualRouterPropertiesFormat 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 VirtualRouterPropertiesFormat object itself. + */ + public VirtualRouterPropertiesFormat 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 VirtualRouterPropertiesFormat object itself. + */ + public VirtualRouterPropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("virtualRouterAsn", this.virtualRouterAsn); + jsonWriter.writeArrayField("virtualRouterIps", this.virtualRouterIps, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("hostedSubnet", this.hostedSubnet); + jsonWriter.writeJsonField("hostedGateway", this.hostedGateway); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualRouterPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualRouterPropertiesFormat if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualRouterPropertiesFormat. + */ + public static VirtualRouterPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualRouterPropertiesFormat deserializedVirtualRouterPropertiesFormat + = new VirtualRouterPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualRouterAsn".equals(fieldName)) { + deserializedVirtualRouterPropertiesFormat.virtualRouterAsn + = reader.getNullable(JsonReader::getLong); + } else if ("virtualRouterIps".equals(fieldName)) { + List virtualRouterIps = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualRouterPropertiesFormat.virtualRouterIps = virtualRouterIps; + } else if ("hostedSubnet".equals(fieldName)) { + deserializedVirtualRouterPropertiesFormat.hostedSubnet = SubResource.fromJson(reader); + } else if ("hostedGateway".equals(fieldName)) { + deserializedVirtualRouterPropertiesFormat.hostedGateway = SubResource.fromJson(reader); + } else if ("peerings".equals(fieldName)) { + List peerings = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualRouterPropertiesFormat.peerings = peerings; + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualRouterPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualRouterPropertiesFormat; + }); + } +} 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..7aa7633e5c2f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanInner.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * VirtualWAN Resource. + */ +@Fluent +public final class VirtualWanInner extends Resource { + /* + * Properties of the virtual WAN. + */ + private VirtualWanProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VirtualWanInner class. + */ + public VirtualWanInner() { + } + + /** + * Get the innerProperties property: Properties of the virtual WAN. + * + * @return the innerProperties value. + */ + private VirtualWanProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 VirtualWanInner object itself. + */ + public VirtualWanInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualWanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualWanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the disableVpnEncryption property: Vpn encryption to be disabled or not. + * + * @return the disableVpnEncryption value. + */ + public Boolean disableVpnEncryption() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualWanProperties(); + } + this.innerProperties().withDisableVpnEncryption(disableVpnEncryption); + return this; + } + + /** + * Get the virtualHubs property: List of VirtualHubs in the VirtualWAN. + * + * @return the virtualHubs value. + */ + public List virtualHubs() { + return this.innerProperties() == null ? null : this.innerProperties().virtualHubs(); + } + + /** + * Get the vpnSites property: List of VpnSites in the VirtualWAN. + * + * @return the vpnSites value. + */ + public List vpnSites() { + return this.innerProperties() == null ? null : this.innerProperties().vpnSites(); + } + + /** + * Get the allowBranchToBranchTraffic property: True if branch to branch traffic is allowed. + * + * @return the allowBranchToBranchTraffic value. + */ + public Boolean allowBranchToBranchTraffic() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualWanProperties(); + } + this.innerProperties().withAllowBranchToBranchTraffic(allowBranchToBranchTraffic); + return this; + } + + /** + * Get the allowVnetToVnetTraffic property: True if Vnet to Vnet traffic is allowed. + * + * @return the allowVnetToVnetTraffic value. + */ + public Boolean allowVnetToVnetTraffic() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualWanProperties(); + } + this.innerProperties().withAllowVnetToVnetTraffic(allowVnetToVnetTraffic); + return this; + } + + /** + * Get the office365LocalBreakoutCategory property: The office local breakout category. + * + * @return the office365LocalBreakoutCategory value. + */ + public OfficeTrafficCategory office365LocalBreakoutCategory() { + return this.innerProperties() == null ? null : this.innerProperties().office365LocalBreakoutCategory(); + } + + /** + * Get the provisioningState property: The provisioning state of the virtual WAN resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the type property: The type of the VirtualWAN. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type of the VirtualWAN. + * + * @param type the type value to set. + * @return the VirtualWanInner object itself. + */ + public VirtualWanInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualWanProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualWanInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualWanInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualWanInner. + */ + public static VirtualWanInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualWanInner deserializedVirtualWanInner = new VirtualWanInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualWanInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualWanInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVirtualWanInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVirtualWanInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVirtualWanInner.innerProperties = VirtualWanProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVirtualWanInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVirtualWanInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualWanInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanProperties.java new file mode 100644 index 0000000000000..f0d1da6317625 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanProperties.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.OfficeTrafficCategory; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for VirtualWAN. + */ +@Fluent +public final class VirtualWanProperties implements JsonSerializable { + /* + * Vpn encryption to be disabled or not. + */ + private Boolean disableVpnEncryption; + + /* + * List of VirtualHubs in the VirtualWAN. + */ + private List virtualHubs; + + /* + * List of VpnSites in the VirtualWAN. + */ + private List vpnSites; + + /* + * True if branch to branch traffic is allowed. + */ + private Boolean allowBranchToBranchTraffic; + + /* + * True if Vnet to Vnet traffic is allowed. + */ + private Boolean allowVnetToVnetTraffic; + + /* + * The office local breakout category. + */ + private OfficeTrafficCategory office365LocalBreakoutCategory; + + /* + * The provisioning state of the virtual WAN resource. + */ + private ProvisioningState provisioningState; + + /* + * The type of the VirtualWAN. + */ + private String type; + + /** + * Creates an instance of VirtualWanProperties class. + */ + public VirtualWanProperties() { + } + + /** + * 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 VirtualWanProperties object itself. + */ + public VirtualWanProperties 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 VirtualWanProperties object itself. + */ + public VirtualWanProperties 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 VirtualWanProperties object itself. + */ + public VirtualWanProperties 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 type property: The type of the VirtualWAN. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of the VirtualWAN. + * + * @param type the type value to set. + * @return the VirtualWanProperties object itself. + */ + public VirtualWanProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("disableVpnEncryption", this.disableVpnEncryption); + jsonWriter.writeBooleanField("allowBranchToBranchTraffic", this.allowBranchToBranchTraffic); + jsonWriter.writeBooleanField("allowVnetToVnetTraffic", this.allowVnetToVnetTraffic); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualWanProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualWanProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualWanProperties. + */ + public static VirtualWanProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualWanProperties deserializedVirtualWanProperties = new VirtualWanProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disableVpnEncryption".equals(fieldName)) { + deserializedVirtualWanProperties.disableVpnEncryption = reader.getNullable(JsonReader::getBoolean); + } else if ("virtualHubs".equals(fieldName)) { + List virtualHubs = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualWanProperties.virtualHubs = virtualHubs; + } else if ("vpnSites".equals(fieldName)) { + List vpnSites = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVirtualWanProperties.vpnSites = vpnSites; + } else if ("allowBranchToBranchTraffic".equals(fieldName)) { + deserializedVirtualWanProperties.allowBranchToBranchTraffic + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowVnetToVnetTraffic".equals(fieldName)) { + deserializedVirtualWanProperties.allowVnetToVnetTraffic + = reader.getNullable(JsonReader::getBoolean); + } else if ("office365LocalBreakoutCategory".equals(fieldName)) { + deserializedVirtualWanProperties.office365LocalBreakoutCategory + = OfficeTrafficCategory.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedVirtualWanProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedVirtualWanProperties.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualWanProperties; + }); + } +} 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..d1d91f9829fe8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VirtualWanSecurityProvidersInner.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.VirtualWanSecurityProvider; +import java.io.IOException; +import java.util.List; + +/** + * Collection of SecurityProviders. + */ +@Fluent +public final class VirtualWanSecurityProvidersInner implements JsonSerializable { + /* + * List of VirtualWAN security providers. + */ + private List supportedProviders; + + /** + * Creates an instance of VirtualWanSecurityProvidersInner class. + */ + public VirtualWanSecurityProvidersInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("supportedProviders", this.supportedProviders, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualWanSecurityProvidersInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualWanSecurityProvidersInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualWanSecurityProvidersInner. + */ + public static VirtualWanSecurityProvidersInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualWanSecurityProvidersInner deserializedVirtualWanSecurityProvidersInner + = new VirtualWanSecurityProvidersInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("supportedProviders".equals(fieldName)) { + List supportedProviders + = reader.readArray(reader1 -> VirtualWanSecurityProvider.fromJson(reader1)); + deserializedVirtualWanSecurityProvidersInner.supportedProviders = supportedProviders; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualWanSecurityProvidersInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VngClientConnectionConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VngClientConnectionConfigurationProperties.java new file mode 100644 index 0000000000000..d2c8b86e0a006 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VngClientConnectionConfigurationProperties.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.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of VngClientConnectionConfiguration. + */ +@Fluent +public final class VngClientConnectionConfigurationProperties + implements JsonSerializable { + /* + * The reference to the address space resource which represents Address space for P2S VpnClient. + */ + private AddressSpace vpnClientAddressPool; + + /* + * List of references to virtualNetworkGatewayPolicyGroups + */ + private List virtualNetworkGatewayPolicyGroups; + + /* + * The provisioning state of the VngClientConnectionConfiguration resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VngClientConnectionConfigurationProperties class. + */ + public VngClientConnectionConfigurationProperties() { + } + + /** + * 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 VngClientConnectionConfigurationProperties object itself. + */ + public VngClientConnectionConfigurationProperties withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + this.vpnClientAddressPool = vpnClientAddressPool; + return this; + } + + /** + * Get the virtualNetworkGatewayPolicyGroups property: List of references to virtualNetworkGatewayPolicyGroups. + * + * @return the virtualNetworkGatewayPolicyGroups value. + */ + public List virtualNetworkGatewayPolicyGroups() { + return this.virtualNetworkGatewayPolicyGroups; + } + + /** + * Set the virtualNetworkGatewayPolicyGroups property: List of references to virtualNetworkGatewayPolicyGroups. + * + * @param virtualNetworkGatewayPolicyGroups the virtualNetworkGatewayPolicyGroups value to set. + * @return the VngClientConnectionConfigurationProperties object itself. + */ + public VngClientConnectionConfigurationProperties + withVirtualNetworkGatewayPolicyGroups(List virtualNetworkGatewayPolicyGroups) { + this.virtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroups; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VngClientConnectionConfiguration 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() { + if (vpnClientAddressPool() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property vpnClientAddressPool in model VngClientConnectionConfigurationProperties")); + } else { + vpnClientAddressPool().validate(); + } + if (virtualNetworkGatewayPolicyGroups() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property virtualNetworkGatewayPolicyGroups in model VngClientConnectionConfigurationProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VngClientConnectionConfigurationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vpnClientAddressPool", this.vpnClientAddressPool); + jsonWriter.writeArrayField("virtualNetworkGatewayPolicyGroups", this.virtualNetworkGatewayPolicyGroups, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VngClientConnectionConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VngClientConnectionConfigurationProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VngClientConnectionConfigurationProperties. + */ + public static VngClientConnectionConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VngClientConnectionConfigurationProperties deserializedVngClientConnectionConfigurationProperties + = new VngClientConnectionConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnClientAddressPool".equals(fieldName)) { + deserializedVngClientConnectionConfigurationProperties.vpnClientAddressPool + = AddressSpace.fromJson(reader); + } else if ("virtualNetworkGatewayPolicyGroups".equals(fieldName)) { + List virtualNetworkGatewayPolicyGroups + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVngClientConnectionConfigurationProperties.virtualNetworkGatewayPolicyGroups + = virtualNetworkGatewayPolicyGroups; + } else if ("provisioningState".equals(fieldName)) { + deserializedVngClientConnectionConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVngClientConnectionConfigurationProperties; + }); + } +} 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..a12ecd5521e74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientConnectionHealthDetailListResultInner.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.VpnClientConnectionHealthDetail; +import java.io.IOException; +import java.util.List; + +/** + * List of virtual network gateway vpn client connection health. + */ +@Fluent +public final class VpnClientConnectionHealthDetailListResultInner + implements JsonSerializable { + /* + * List of vpn client connection health. + */ + private List value; + + /** + * Creates an instance of VpnClientConnectionHealthDetailListResultInner class. + */ + public VpnClientConnectionHealthDetailListResultInner() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientConnectionHealthDetailListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientConnectionHealthDetailListResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnClientConnectionHealthDetailListResultInner. + */ + public static VpnClientConnectionHealthDetailListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientConnectionHealthDetailListResultInner deserializedVpnClientConnectionHealthDetailListResultInner + = new VpnClientConnectionHealthDetailListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VpnClientConnectionHealthDetail.fromJson(reader1)); + deserializedVpnClientConnectionHealthDetailListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientConnectionHealthDetailListResultInner; + }); + } +} 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..7f349aee98004 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientIPsecParametersInner.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * An IPSec parameters for a virtual network gateway P2S connection. + */ +@Fluent +public final class VpnClientIPsecParametersInner implements JsonSerializable { + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. + */ + private int saLifeTimeSeconds; + + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. + */ + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + private PfsGroup pfsGroup; + + /** + * Creates an instance of VpnClientIPsecParametersInner class. + */ + public VpnClientIPsecParametersInner() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property ipsecEncryption in model VpnClientIPsecParametersInner")); + } + if (ipsecIntegrity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ipsecIntegrity in model VpnClientIPsecParametersInner")); + } + if (ikeEncryption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ikeEncryption in model VpnClientIPsecParametersInner")); + } + if (ikeIntegrity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ikeIntegrity in model VpnClientIPsecParametersInner")); + } + if (dhGroup() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property dhGroup in model VpnClientIPsecParametersInner")); + } + if (pfsGroup() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property pfsGroup in model VpnClientIPsecParametersInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VpnClientIPsecParametersInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("saLifeTimeSeconds", this.saLifeTimeSeconds); + jsonWriter.writeIntField("saDataSizeKilobytes", this.saDataSizeKilobytes); + jsonWriter.writeStringField("ipsecEncryption", + this.ipsecEncryption == null ? null : this.ipsecEncryption.toString()); + jsonWriter.writeStringField("ipsecIntegrity", + this.ipsecIntegrity == null ? null : this.ipsecIntegrity.toString()); + jsonWriter.writeStringField("ikeEncryption", this.ikeEncryption == null ? null : this.ikeEncryption.toString()); + jsonWriter.writeStringField("ikeIntegrity", this.ikeIntegrity == null ? null : this.ikeIntegrity.toString()); + jsonWriter.writeStringField("dhGroup", this.dhGroup == null ? null : this.dhGroup.toString()); + jsonWriter.writeStringField("pfsGroup", this.pfsGroup == null ? null : this.pfsGroup.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientIPsecParametersInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientIPsecParametersInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VpnClientIPsecParametersInner. + */ + public static VpnClientIPsecParametersInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientIPsecParametersInner deserializedVpnClientIPsecParametersInner + = new VpnClientIPsecParametersInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saLifeTimeSeconds".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.saLifeTimeSeconds = reader.getInt(); + } else if ("saDataSizeKilobytes".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.saDataSizeKilobytes = reader.getInt(); + } else if ("ipsecEncryption".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.ipsecEncryption + = IpsecEncryption.fromString(reader.getString()); + } else if ("ipsecIntegrity".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.ipsecIntegrity + = IpsecIntegrity.fromString(reader.getString()); + } else if ("ikeEncryption".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.ikeEncryption + = IkeEncryption.fromString(reader.getString()); + } else if ("ikeIntegrity".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.ikeIntegrity + = IkeIntegrity.fromString(reader.getString()); + } else if ("dhGroup".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.dhGroup = DhGroup.fromString(reader.getString()); + } else if ("pfsGroup".equals(fieldName)) { + deserializedVpnClientIPsecParametersInner.pfsGroup = PfsGroup.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientIPsecParametersInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRevokedCertificatePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRevokedCertificatePropertiesFormat.java new file mode 100644 index 0000000000000..fce2fa8cbb9de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRevokedCertificatePropertiesFormat.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of the revoked VPN client certificate of virtual network gateway. + */ +@Fluent +public final class VpnClientRevokedCertificatePropertiesFormat + implements JsonSerializable { + /* + * The revoked VPN client certificate thumbprint. + */ + private String thumbprint; + + /* + * The provisioning state of the VPN client revoked certificate resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VpnClientRevokedCertificatePropertiesFormat class. + */ + public VpnClientRevokedCertificatePropertiesFormat() { + } + + /** + * 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 VpnClientRevokedCertificatePropertiesFormat object itself. + */ + public VpnClientRevokedCertificatePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("thumbprint", this.thumbprint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientRevokedCertificatePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientRevokedCertificatePropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnClientRevokedCertificatePropertiesFormat. + */ + public static VpnClientRevokedCertificatePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientRevokedCertificatePropertiesFormat deserializedVpnClientRevokedCertificatePropertiesFormat + = new VpnClientRevokedCertificatePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("thumbprint".equals(fieldName)) { + deserializedVpnClientRevokedCertificatePropertiesFormat.thumbprint = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnClientRevokedCertificatePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientRevokedCertificatePropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRootCertificatePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRootCertificatePropertiesFormat.java new file mode 100644 index 0000000000000..bc6767f155343 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnClientRootCertificatePropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.io.IOException; + +/** + * Properties of SSL certificates of application gateway. + */ +@Fluent +public final class VpnClientRootCertificatePropertiesFormat + implements JsonSerializable { + /* + * The certificate public data. + */ + private String publicCertData; + + /* + * The provisioning state of the VPN client root certificate resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VpnClientRootCertificatePropertiesFormat class. + */ + public VpnClientRootCertificatePropertiesFormat() { + } + + /** + * 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 VpnClientRootCertificatePropertiesFormat object itself. + */ + public VpnClientRootCertificatePropertiesFormat 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicCertData() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property publicCertData in model VpnClientRootCertificatePropertiesFormat")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VpnClientRootCertificatePropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("publicCertData", this.publicCertData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientRootCertificatePropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientRootCertificatePropertiesFormat if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VpnClientRootCertificatePropertiesFormat. + */ + public static VpnClientRootCertificatePropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientRootCertificatePropertiesFormat deserializedVpnClientRootCertificatePropertiesFormat + = new VpnClientRootCertificatePropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicCertData".equals(fieldName)) { + deserializedVpnClientRootCertificatePropertiesFormat.publicCertData = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnClientRootCertificatePropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientRootCertificatePropertiesFormat; + }); + } +} 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..ec7f42f2b78a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionInner.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * VpnConnection Resource. + */ +@Fluent +public final class VpnConnectionInner extends SubResource { + /* + * Properties of the VPN connection. + */ + private VpnConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VpnConnectionInner class. + */ + public VpnConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the VPN connection. + * + * @return the innerProperties value. + */ + private VpnConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the remoteVpnSite property: Id of the connected vpn site. + * + * @return the remoteVpnSite value. + */ + public SubResource remoteVpnSite() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withRemoteVpnSite(remoteVpnSite); + return this; + } + + /** + * Get the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withRoutingWeight(routingWeight); + return this; + } + + /** + * Get the dpdTimeoutSeconds property: DPD timeout in seconds for vpn connection. + * + * @return the dpdTimeoutSeconds value. + */ + public Integer dpdTimeoutSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withDpdTimeoutSeconds(dpdTimeoutSeconds); + return this; + } + + /** + * Get the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + public VpnConnectionStatus connectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); + } + + /** + * Get the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withVpnConnectionProtocolType(vpnConnectionProtocolType); + return this; + } + + /** + * Get the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().ingressBytesTransferred(); + } + + /** + * Get the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().egressBytesTransferred(); + } + + /** + * Get the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + public Integer connectionBandwidth() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withConnectionBandwidth(connectionBandwidth); + return this; + } + + /** + * Get the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withSharedKey(sharedKey); + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableBgp(Boolean enableBgp) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withEnableBgp(enableBgp); + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withUsePolicyBasedTrafficSelectors(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withIpsecPolicies(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withTrafficSelectorPolicies(trafficSelectorPolicies); + return this; + } + + /** + * Get the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + public Boolean enableRateLimiting() { + return this.innerProperties() == null ? null : this.innerProperties().enableRateLimiting(); + } + + /** + * Set the enableRateLimiting property: EnableBgp flag. + * + * @param enableRateLimiting the enableRateLimiting value to set. + * @return the VpnConnectionInner object itself. + */ + public VpnConnectionInner withEnableRateLimiting(Boolean enableRateLimiting) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withEnableRateLimiting(enableRateLimiting); + return this; + } + + /** + * Get the enableInternetSecurity property: Enable internet security. + * + * @return the enableInternetSecurity value. + */ + public Boolean enableInternetSecurity() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withEnableInternetSecurity(enableInternetSecurity); + return this; + } + + /** + * Get the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + public Boolean useLocalAzureIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withUseLocalAzureIpAddress(useLocalAzureIpAddress); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vpnLinkConnections property: List of all vpn site link connections to the gateway. + * + * @return the vpnLinkConnections value. + */ + public List vpnLinkConnections() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withVpnLinkConnections(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnConnectionProperties(); + } + this.innerProperties().withRoutingConfiguration(routingConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnConnectionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnConnectionInner. + */ + public static VpnConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnConnectionInner deserializedVpnConnectionInner = new VpnConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVpnConnectionInner.innerProperties = VpnConnectionProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVpnConnectionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVpnConnectionInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionProperties.java new file mode 100644 index 0000000000000..ad6e3e7b33436 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnConnectionProperties.java @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for VpnConnection. + */ +@Fluent +public final class VpnConnectionProperties implements JsonSerializable { + /* + * Id of the connected vpn site. + */ + private SubResource remoteVpnSite; + + /* + * Routing weight for vpn connection. + */ + private Integer routingWeight; + + /* + * DPD timeout in seconds for vpn connection. + */ + private Integer dpdTimeoutSeconds; + + /* + * The connection status. + */ + private VpnConnectionStatus connectionStatus; + + /* + * Connection protocol used for this connection. + */ + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /* + * Ingress bytes transferred. + */ + private Long ingressBytesTransferred; + + /* + * Egress bytes transferred. + */ + private Long egressBytesTransferred; + + /* + * Expected bandwidth in MBPS. + */ + private Integer connectionBandwidth; + + /* + * SharedKey for the vpn connection. + */ + private String sharedKey; + + /* + * EnableBgp flag. + */ + private Boolean enableBgp; + + /* + * Enable policy-based traffic selectors. + */ + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + private List ipsecPolicies; + + /* + * The Traffic Selector Policies to be considered by this connection. + */ + private List trafficSelectorPolicies; + + /* + * EnableBgp flag. + */ + private Boolean enableRateLimiting; + + /* + * Enable internet security. + */ + private Boolean enableInternetSecurity; + + /* + * Use local azure ip to initiate connection. + */ + private Boolean useLocalAzureIpAddress; + + /* + * The provisioning state of the VPN connection resource. + */ + private ProvisioningState provisioningState; + + /* + * List of all vpn site link connections to the gateway. + */ + private List vpnLinkConnections; + + /* + * The Routing Configuration indicating the associated and propagated route tables on this connection. + */ + private RoutingConfiguration routingConfiguration; + + /** + * Creates an instance of VpnConnectionProperties class. + */ + public VpnConnectionProperties() { + } + + /** + * 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties + 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties 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 VpnConnectionProperties object itself. + */ + public VpnConnectionProperties withRoutingConfiguration(RoutingConfiguration routingConfiguration) { + this.routingConfiguration = routingConfiguration; + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("remoteVpnSite", this.remoteVpnSite); + jsonWriter.writeNumberField("routingWeight", this.routingWeight); + jsonWriter.writeNumberField("dpdTimeoutSeconds", this.dpdTimeoutSeconds); + jsonWriter.writeStringField("vpnConnectionProtocolType", + this.vpnConnectionProtocolType == null ? null : this.vpnConnectionProtocolType.toString()); + jsonWriter.writeNumberField("connectionBandwidth", this.connectionBandwidth); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeBooleanField("enableBgp", this.enableBgp); + jsonWriter.writeBooleanField("usePolicyBasedTrafficSelectors", this.usePolicyBasedTrafficSelectors); + jsonWriter.writeArrayField("ipsecPolicies", this.ipsecPolicies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trafficSelectorPolicies", this.trafficSelectorPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enableRateLimiting", this.enableRateLimiting); + jsonWriter.writeBooleanField("enableInternetSecurity", this.enableInternetSecurity); + jsonWriter.writeBooleanField("useLocalAzureIpAddress", this.useLocalAzureIpAddress); + jsonWriter.writeArrayField("vpnLinkConnections", this.vpnLinkConnections, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("routingConfiguration", this.routingConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnConnectionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnConnectionProperties. + */ + public static VpnConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnConnectionProperties deserializedVpnConnectionProperties = new VpnConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteVpnSite".equals(fieldName)) { + deserializedVpnConnectionProperties.remoteVpnSite = SubResource.fromJson(reader); + } else if ("routingWeight".equals(fieldName)) { + deserializedVpnConnectionProperties.routingWeight = reader.getNullable(JsonReader::getInt); + } else if ("dpdTimeoutSeconds".equals(fieldName)) { + deserializedVpnConnectionProperties.dpdTimeoutSeconds = reader.getNullable(JsonReader::getInt); + } else if ("connectionStatus".equals(fieldName)) { + deserializedVpnConnectionProperties.connectionStatus + = VpnConnectionStatus.fromString(reader.getString()); + } else if ("vpnConnectionProtocolType".equals(fieldName)) { + deserializedVpnConnectionProperties.vpnConnectionProtocolType + = VirtualNetworkGatewayConnectionProtocol.fromString(reader.getString()); + } else if ("ingressBytesTransferred".equals(fieldName)) { + deserializedVpnConnectionProperties.ingressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("egressBytesTransferred".equals(fieldName)) { + deserializedVpnConnectionProperties.egressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("connectionBandwidth".equals(fieldName)) { + deserializedVpnConnectionProperties.connectionBandwidth = reader.getNullable(JsonReader::getInt); + } else if ("sharedKey".equals(fieldName)) { + deserializedVpnConnectionProperties.sharedKey = reader.getString(); + } else if ("enableBgp".equals(fieldName)) { + deserializedVpnConnectionProperties.enableBgp = reader.getNullable(JsonReader::getBoolean); + } else if ("usePolicyBasedTrafficSelectors".equals(fieldName)) { + deserializedVpnConnectionProperties.usePolicyBasedTrafficSelectors + = reader.getNullable(JsonReader::getBoolean); + } else if ("ipsecPolicies".equals(fieldName)) { + List ipsecPolicies = reader.readArray(reader1 -> IpsecPolicy.fromJson(reader1)); + deserializedVpnConnectionProperties.ipsecPolicies = ipsecPolicies; + } else if ("trafficSelectorPolicies".equals(fieldName)) { + List trafficSelectorPolicies + = reader.readArray(reader1 -> TrafficSelectorPolicy.fromJson(reader1)); + deserializedVpnConnectionProperties.trafficSelectorPolicies = trafficSelectorPolicies; + } else if ("enableRateLimiting".equals(fieldName)) { + deserializedVpnConnectionProperties.enableRateLimiting = reader.getNullable(JsonReader::getBoolean); + } else if ("enableInternetSecurity".equals(fieldName)) { + deserializedVpnConnectionProperties.enableInternetSecurity + = reader.getNullable(JsonReader::getBoolean); + } else if ("useLocalAzureIpAddress".equals(fieldName)) { + deserializedVpnConnectionProperties.useLocalAzureIpAddress + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("vpnLinkConnections".equals(fieldName)) { + List vpnLinkConnections + = reader.readArray(reader1 -> VpnSiteLinkConnectionInner.fromJson(reader1)); + deserializedVpnConnectionProperties.vpnLinkConnections = vpnLinkConnections; + } else if ("routingConfiguration".equals(fieldName)) { + deserializedVpnConnectionProperties.routingConfiguration = RoutingConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnConnectionProperties; + }); + } +} 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..42304ee4bc410 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayInner.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * VpnGateway Resource. + */ +@Fluent +public final class VpnGatewayInner extends Resource { + /* + * Properties of the VPN gateway. + */ + private VpnGatewayProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VpnGatewayInner class. + */ + public VpnGatewayInner() { + } + + /** + * Get the innerProperties property: Properties of the VPN gateway. + * + * @return the innerProperties value. + */ + private VpnGatewayProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 VpnGatewayInner object itself. + */ + public VpnGatewayInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnGatewayInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnGatewayInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the virtualHub property: The VirtualHub to which the gateway belongs. + * + * @return the virtualHub value. + */ + public SubResource virtualHub() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayProperties(); + } + this.innerProperties().withVirtualHub(virtualHub); + return this; + } + + /** + * Get the connections property: List of all vpn connections to the gateway. + * + * @return the connections value. + */ + public List connections() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayProperties(); + } + this.innerProperties().withConnections(connections); + return this; + } + + /** + * Get the bgpSettings property: Local network gateway's BGP speaker settings. + * + * @return the bgpSettings value. + */ + public BgpSettings bgpSettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayProperties(); + } + this.innerProperties().withBgpSettings(bgpSettings); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN gateway resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the vpnGatewayScaleUnit property: The scale unit for this vpn gateway. + * + * @return the vpnGatewayScaleUnit value. + */ + public Integer vpnGatewayScaleUnit() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayProperties(); + } + this.innerProperties().withVpnGatewayScaleUnit(vpnGatewayScaleUnit); + return this; + } + + /** + * Get the ipConfigurations property: List of all IPs configured on the gateway. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Get the enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this VpnGateway. + * + * @return the enableBgpRouteTranslationForNat value. + */ + public Boolean enableBgpRouteTranslationForNat() { + return this.innerProperties() == null ? null : this.innerProperties().enableBgpRouteTranslationForNat(); + } + + /** + * Set the enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this VpnGateway. + * + * @param enableBgpRouteTranslationForNat the enableBgpRouteTranslationForNat value to set. + * @return the VpnGatewayInner object itself. + */ + public VpnGatewayInner withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayProperties(); + } + this.innerProperties().withEnableBgpRouteTranslationForNat(enableBgpRouteTranslationForNat); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayProperties(); + } + this.innerProperties().withIsRoutingPreferenceInternet(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayProperties(); + } + this.innerProperties().withNatRules(natRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnGatewayInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnGatewayInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VpnGatewayInner. + */ + public static VpnGatewayInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnGatewayInner deserializedVpnGatewayInner = new VpnGatewayInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnGatewayInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVpnGatewayInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVpnGatewayInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVpnGatewayInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVpnGatewayInner.innerProperties = VpnGatewayProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVpnGatewayInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVpnGatewayInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnGatewayInner; + }); + } +} 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..16a2593f46ac1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleInner.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * VpnGatewayNatRule Resource. + */ +@Fluent +public final class VpnGatewayNatRuleInner extends SubResource { + /* + * Properties of the VpnGateway NAT rule. + */ + private VpnGatewayNatRuleProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of VpnGatewayNatRuleInner class. + */ + public VpnGatewayNatRuleInner() { + } + + /** + * Get the innerProperties property: Properties of the VpnGateway NAT rule. + * + * @return the innerProperties value. + */ + private VpnGatewayNatRuleProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnGatewayNatRuleInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the type property: The type of NAT rule for VPN NAT. + * + * @return the type value. + */ + public VpnNatRuleType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type of NAT rule for VPN NAT. + * + * @param type the type value to set. + * @return the VpnGatewayNatRuleInner object itself. + */ + public VpnGatewayNatRuleInner withTypePropertiesType(VpnNatRuleType type) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayNatRuleProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the mode property: The Source NAT direction of a VPN NAT. + * + * @return the mode value. + */ + public VpnNatRuleMode mode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayNatRuleProperties(); + } + this.innerProperties().withMode(mode); + return this; + } + + /** + * Get the internalMappings property: The private IP address internal mapping for NAT. + * + * @return the internalMappings value. + */ + public List internalMappings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayNatRuleProperties(); + } + this.innerProperties().withInternalMappings(internalMappings); + return this; + } + + /** + * Get the externalMappings property: The private IP address external mapping for NAT. + * + * @return the externalMappings value. + */ + public List externalMappings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayNatRuleProperties(); + } + this.innerProperties().withExternalMappings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnGatewayNatRuleProperties(); + } + this.innerProperties().withIpConfigurationId(ipConfigurationId); + return this; + } + + /** + * Get the egressVpnSiteLinkConnections property: List of egress VpnSiteLinkConnections. + * + * @return the egressVpnSiteLinkConnections value. + */ + public List egressVpnSiteLinkConnections() { + return this.innerProperties() == null ? null : this.innerProperties().egressVpnSiteLinkConnections(); + } + + /** + * Get the ingressVpnSiteLinkConnections property: List of ingress VpnSiteLinkConnections. + * + * @return the ingressVpnSiteLinkConnections value. + */ + public List ingressVpnSiteLinkConnections() { + return this.innerProperties() == null ? null : this.innerProperties().ingressVpnSiteLinkConnections(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnGatewayNatRuleInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnGatewayNatRuleInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnGatewayNatRuleInner. + */ + public static VpnGatewayNatRuleInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnGatewayNatRuleInner deserializedVpnGatewayNatRuleInner = new VpnGatewayNatRuleInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnGatewayNatRuleInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVpnGatewayNatRuleInner.innerProperties = VpnGatewayNatRuleProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVpnGatewayNatRuleInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVpnGatewayNatRuleInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVpnGatewayNatRuleInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnGatewayNatRuleInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleProperties.java new file mode 100644 index 0000000000000..824fe83305052 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayNatRuleProperties.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for VpnGatewayNatRule. + */ +@Fluent +public final class VpnGatewayNatRuleProperties implements JsonSerializable { + /* + * The provisioning state of the NAT Rule resource. + */ + private ProvisioningState provisioningState; + + /* + * The type of NAT rule for VPN NAT. + */ + private VpnNatRuleType type; + + /* + * The Source NAT direction of a VPN NAT. + */ + private VpnNatRuleMode mode; + + /* + * The private IP address internal mapping for NAT. + */ + private List internalMappings; + + /* + * The private IP address external mapping for NAT. + */ + private List externalMappings; + + /* + * The IP Configuration ID this NAT rule applies to. + */ + private String ipConfigurationId; + + /* + * List of egress VpnSiteLinkConnections. + */ + private List egressVpnSiteLinkConnections; + + /* + * List of ingress VpnSiteLinkConnections. + */ + private List ingressVpnSiteLinkConnections; + + /** + * Creates an instance of VpnGatewayNatRuleProperties class. + */ + public VpnGatewayNatRuleProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the NAT Rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the type property: The type of NAT rule for VPN NAT. + * + * @return the type value. + */ + public VpnNatRuleType type() { + return this.type; + } + + /** + * Set the type property: The type of NAT rule for VPN NAT. + * + * @param type the type value to set. + * @return the VpnGatewayNatRuleProperties object itself. + */ + public VpnGatewayNatRuleProperties withType(VpnNatRuleType type) { + this.type = type; + 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 VpnGatewayNatRuleProperties object itself. + */ + public VpnGatewayNatRuleProperties 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 VpnGatewayNatRuleProperties object itself. + */ + public VpnGatewayNatRuleProperties 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 VpnGatewayNatRuleProperties object itself. + */ + public VpnGatewayNatRuleProperties 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 VpnGatewayNatRuleProperties object itself. + */ + public VpnGatewayNatRuleProperties 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; + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeArrayField("internalMappings", this.internalMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("externalMappings", this.externalMappings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("ipConfigurationId", this.ipConfigurationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnGatewayNatRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnGatewayNatRuleProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnGatewayNatRuleProperties. + */ + public static VpnGatewayNatRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnGatewayNatRuleProperties deserializedVpnGatewayNatRuleProperties = new VpnGatewayNatRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedVpnGatewayNatRuleProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedVpnGatewayNatRuleProperties.type = VpnNatRuleType.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedVpnGatewayNatRuleProperties.mode = VpnNatRuleMode.fromString(reader.getString()); + } else if ("internalMappings".equals(fieldName)) { + List internalMappings + = reader.readArray(reader1 -> VpnNatRuleMapping.fromJson(reader1)); + deserializedVpnGatewayNatRuleProperties.internalMappings = internalMappings; + } else if ("externalMappings".equals(fieldName)) { + List externalMappings + = reader.readArray(reader1 -> VpnNatRuleMapping.fromJson(reader1)); + deserializedVpnGatewayNatRuleProperties.externalMappings = externalMappings; + } else if ("ipConfigurationId".equals(fieldName)) { + deserializedVpnGatewayNatRuleProperties.ipConfigurationId = reader.getString(); + } else if ("egressVpnSiteLinkConnections".equals(fieldName)) { + List egressVpnSiteLinkConnections + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVpnGatewayNatRuleProperties.egressVpnSiteLinkConnections = egressVpnSiteLinkConnections; + } else if ("ingressVpnSiteLinkConnections".equals(fieldName)) { + List ingressVpnSiteLinkConnections + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVpnGatewayNatRuleProperties.ingressVpnSiteLinkConnections + = ingressVpnSiteLinkConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnGatewayNatRuleProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayProperties.java new file mode 100644 index 0000000000000..a6495002cb190 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnGatewayProperties.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for VpnGateway. + */ +@Fluent +public final class VpnGatewayProperties implements JsonSerializable { + /* + * The VirtualHub to which the gateway belongs. + */ + private SubResource virtualHub; + + /* + * List of all vpn connections to the gateway. + */ + private List connections; + + /* + * Local network gateway's BGP speaker settings. + */ + private BgpSettings bgpSettings; + + /* + * The provisioning state of the VPN gateway resource. + */ + private ProvisioningState provisioningState; + + /* + * The scale unit for this vpn gateway. + */ + private Integer vpnGatewayScaleUnit; + + /* + * List of all IPs configured on the gateway. + */ + private List ipConfigurations; + + /* + * Enable BGP routes translation for NAT on this VpnGateway. + */ + private Boolean enableBgpRouteTranslationForNat; + + /* + * Enable Routing Preference property for the Public IP Interface of the VpnGateway. + */ + private Boolean isRoutingPreferenceInternet; + + /* + * List of all the nat Rules associated with the gateway. + */ + private List natRules; + + /** + * Creates an instance of VpnGatewayProperties class. + */ + public VpnGatewayProperties() { + } + + /** + * 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 VpnGatewayProperties object itself. + */ + public VpnGatewayProperties 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 VpnGatewayProperties object itself. + */ + public VpnGatewayProperties 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 VpnGatewayProperties object itself. + */ + public VpnGatewayProperties 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 VpnGatewayProperties object itself. + */ + public VpnGatewayProperties 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 enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this VpnGateway. + * + * @return the enableBgpRouteTranslationForNat value. + */ + public Boolean enableBgpRouteTranslationForNat() { + return this.enableBgpRouteTranslationForNat; + } + + /** + * Set the enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this VpnGateway. + * + * @param enableBgpRouteTranslationForNat the enableBgpRouteTranslationForNat value to set. + * @return the VpnGatewayProperties object itself. + */ + public VpnGatewayProperties withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + this.enableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + return this; + } + + /** + * 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 VpnGatewayProperties object itself. + */ + public VpnGatewayProperties 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 VpnGatewayProperties object itself. + */ + public VpnGatewayProperties withNatRules(List natRules) { + this.natRules = natRules; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualHub", this.virtualHub); + jsonWriter.writeArrayField("connections", this.connections, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("bgpSettings", this.bgpSettings); + jsonWriter.writeNumberField("vpnGatewayScaleUnit", this.vpnGatewayScaleUnit); + jsonWriter.writeBooleanField("enableBgpRouteTranslationForNat", this.enableBgpRouteTranslationForNat); + jsonWriter.writeBooleanField("isRoutingPreferenceInternet", this.isRoutingPreferenceInternet); + jsonWriter.writeArrayField("natRules", this.natRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnGatewayProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnGatewayProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnGatewayProperties. + */ + public static VpnGatewayProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnGatewayProperties deserializedVpnGatewayProperties = new VpnGatewayProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualHub".equals(fieldName)) { + deserializedVpnGatewayProperties.virtualHub = SubResource.fromJson(reader); + } else if ("connections".equals(fieldName)) { + List connections + = reader.readArray(reader1 -> VpnConnectionInner.fromJson(reader1)); + deserializedVpnGatewayProperties.connections = connections; + } else if ("bgpSettings".equals(fieldName)) { + deserializedVpnGatewayProperties.bgpSettings = BgpSettings.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnGatewayProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("vpnGatewayScaleUnit".equals(fieldName)) { + deserializedVpnGatewayProperties.vpnGatewayScaleUnit = reader.getNullable(JsonReader::getInt); + } else if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> VpnGatewayIpConfiguration.fromJson(reader1)); + deserializedVpnGatewayProperties.ipConfigurations = ipConfigurations; + } else if ("enableBgpRouteTranslationForNat".equals(fieldName)) { + deserializedVpnGatewayProperties.enableBgpRouteTranslationForNat + = reader.getNullable(JsonReader::getBoolean); + } else if ("isRoutingPreferenceInternet".equals(fieldName)) { + deserializedVpnGatewayProperties.isRoutingPreferenceInternet + = reader.getNullable(JsonReader::getBoolean); + } else if ("natRules".equals(fieldName)) { + List natRules + = reader.readArray(reader1 -> VpnGatewayNatRuleInner.fromJson(reader1)); + deserializedVpnGatewayProperties.natRules = natRules; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnGatewayProperties; + }); + } +} 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..bf6dbe3c48c0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnProfileResponseInner.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Vpn Profile Response for package generation. + */ +@Fluent +public final class VpnProfileResponseInner implements JsonSerializable { + /* + * URL to the VPN profile. + */ + private String profileUrl; + + /** + * Creates an instance of VpnProfileResponseInner class. + */ + public VpnProfileResponseInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("profileUrl", this.profileUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnProfileResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnProfileResponseInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnProfileResponseInner. + */ + public static VpnProfileResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnProfileResponseInner deserializedVpnProfileResponseInner = new VpnProfileResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profileUrl".equals(fieldName)) { + deserializedVpnProfileResponseInner.profileUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnProfileResponseInner; + }); + } +} 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..d2dfdbf02e631 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationInner.java @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft 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.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * VpnServerConfiguration Resource. + */ +@Fluent +public final class VpnServerConfigurationInner extends Resource { + /* + * Properties of the P2SVpnServer configuration. + */ + private VpnServerConfigurationProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VpnServerConfigurationInner class. + */ + public VpnServerConfigurationInner() { + } + + /** + * Get the innerProperties property: Properties of the P2SVpnServer configuration. + * + * @return the innerProperties value. + */ + private VpnServerConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnServerConfigurationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnServerConfigurationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the name property: The name of the VpnServerConfiguration that is unique within a resource group. + * + * @return the name value. + */ + public String namePropertiesName() { + return this.innerProperties() == null ? null : this.innerProperties().name(); + } + + /** + * Set the name property: The name of the VpnServerConfiguration that is unique within a resource group. + * + * @param name the name value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner withNamePropertiesName(String name) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withName(name); + return this; + } + + /** + * Get the vpnProtocols property: VPN protocols for the VpnServerConfiguration. + * + * @return the vpnProtocols value. + */ + public List vpnProtocols() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withVpnProtocols(vpnProtocols); + return this; + } + + /** + * Get the vpnAuthenticationTypes property: VPN authentication types for the VpnServerConfiguration. + * + * @return the vpnAuthenticationTypes value. + */ + public List vpnAuthenticationTypes() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withVpnAuthenticationTypes(vpnAuthenticationTypes); + return this; + } + + /** + * Get the vpnClientRootCertificates property: VPN client root certificate of VpnServerConfiguration. + * + * @return the vpnClientRootCertificates value. + */ + public List vpnClientRootCertificates() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withVpnClientRootCertificates(vpnClientRootCertificates); + return this; + } + + /** + * Get the vpnClientRevokedCertificates property: VPN client revoked certificate of VpnServerConfiguration. + * + * @return the vpnClientRevokedCertificates value. + */ + public List vpnClientRevokedCertificates() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withVpnClientRevokedCertificates(vpnClientRevokedCertificates); + return this; + } + + /** + * Get the radiusServerRootCertificates property: Radius Server root certificate of VpnServerConfiguration. + * + * @return the radiusServerRootCertificates value. + */ + public List radiusServerRootCertificates() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withRadiusServerRootCertificates(radiusServerRootCertificates); + return this; + } + + /** + * Get the radiusClientRootCertificates property: Radius client root certificate of VpnServerConfiguration. + * + * @return the radiusClientRootCertificates value. + */ + public List radiusClientRootCertificates() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withRadiusClientRootCertificates(radiusClientRootCertificates); + return this; + } + + /** + * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for VpnServerConfiguration. + * + * @return the vpnClientIpsecPolicies value. + */ + public List vpnClientIpsecPolicies() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withVpnClientIpsecPolicies(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withRadiusServerAddress(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withRadiusServerSecret(radiusServerSecret); + return this; + } + + /** + * Get the radiusServers property: Multiple Radius Server configuration for VpnServerConfiguration. + * + * @return the radiusServers value. + */ + public List radiusServers() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withRadiusServers(radiusServers); + return this; + } + + /** + * Get the aadAuthenticationParameters property: The set of aad vpn authentication parameters. + * + * @return the aadAuthenticationParameters value. + */ + public AadAuthenticationParameters aadAuthenticationParameters() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withAadAuthenticationParameters(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the p2SVpnGateways property: List of references to P2SVpnGateways. + * + * @return the p2SVpnGateways value. + */ + public List p2SVpnGateways() { + return this.innerProperties() == null ? null : this.innerProperties().p2SVpnGateways(); + } + + /** + * Get the configurationPolicyGroups property: List of all VpnServerConfigurationPolicyGroups. + * + * @return the configurationPolicyGroups value. + */ + public List configurationPolicyGroups() { + return this.innerProperties() == null ? null : this.innerProperties().configurationPolicyGroups(); + } + + /** + * Set the configurationPolicyGroups property: List of all VpnServerConfigurationPolicyGroups. + * + * @param configurationPolicyGroups the configurationPolicyGroups value to set. + * @return the VpnServerConfigurationInner object itself. + */ + public VpnServerConfigurationInner + withConfigurationPolicyGroups(List configurationPolicyGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationProperties(); + } + this.innerProperties().withConfigurationPolicyGroups(configurationPolicyGroups); + return this; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + public String etagPropertiesEtag() { + return this.innerProperties() == null ? null : this.innerProperties().etag(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigurationInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VpnServerConfigurationInner. + */ + public static VpnServerConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigurationInner deserializedVpnServerConfigurationInner = new VpnServerConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnServerConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVpnServerConfigurationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVpnServerConfigurationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVpnServerConfigurationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVpnServerConfigurationInner.innerProperties + = VpnServerConfigurationProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVpnServerConfigurationInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVpnServerConfigurationInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigurationInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupInner.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupInner.java new file mode 100644 index 0000000000000..0991dd545d790 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroupMember; +import java.io.IOException; +import java.util.List; + +/** + * VpnServerConfigurationPolicyGroup Resource. + */ +@Fluent +public final class VpnServerConfigurationPolicyGroupInner extends SubResource { + /* + * Properties of the VpnServerConfigurationPolicyGroup. + */ + private VpnServerConfigurationPolicyGroupProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of VpnServerConfigurationPolicyGroupInner class. + */ + public VpnServerConfigurationPolicyGroupInner() { + } + + /** + * Get the innerProperties property: Properties of the VpnServerConfigurationPolicyGroup. + * + * @return the innerProperties value. + */ + private VpnServerConfigurationPolicyGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 VpnServerConfigurationPolicyGroupInner object itself. + */ + public VpnServerConfigurationPolicyGroupInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnServerConfigurationPolicyGroupInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the isDefault property: Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.innerProperties() == null ? null : this.innerProperties().isDefault(); + } + + /** + * Set the isDefault property: Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + * + * @param isDefault the isDefault value to set. + * @return the VpnServerConfigurationPolicyGroupInner object itself. + */ + public VpnServerConfigurationPolicyGroupInner withIsDefault(Boolean isDefault) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationPolicyGroupProperties(); + } + this.innerProperties().withIsDefault(isDefault); + return this; + } + + /** + * Get the priority property: Priority for VpnServerConfigurationPolicyGroup. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority for VpnServerConfigurationPolicyGroup. + * + * @param priority the priority value to set. + * @return the VpnServerConfigurationPolicyGroupInner object itself. + */ + public VpnServerConfigurationPolicyGroupInner withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationPolicyGroupProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the policyMembers property: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + * + * @return the policyMembers value. + */ + public List policyMembers() { + return this.innerProperties() == null ? null : this.innerProperties().policyMembers(); + } + + /** + * Set the policyMembers property: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + * + * @param policyMembers the policyMembers value to set. + * @return the VpnServerConfigurationPolicyGroupInner object itself. + */ + public VpnServerConfigurationPolicyGroupInner + withPolicyMembers(List policyMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnServerConfigurationPolicyGroupProperties(); + } + this.innerProperties().withPolicyMembers(policyMembers); + return this; + } + + /** + * Get the p2SConnectionConfigurations property: List of references to P2SConnectionConfigurations. + * + * @return the p2SConnectionConfigurations value. + */ + public List p2SConnectionConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().p2SConnectionConfigurations(); + } + + /** + * Get the provisioningState property: The provisioning state of the VpnServerConfigurationPolicyGroup resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigurationPolicyGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigurationPolicyGroupInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigurationPolicyGroupInner. + */ + public static VpnServerConfigurationPolicyGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigurationPolicyGroupInner deserializedVpnServerConfigurationPolicyGroupInner + = new VpnServerConfigurationPolicyGroupInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupInner.innerProperties + = VpnServerConfigurationPolicyGroupProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupInner.etag = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigurationPolicyGroupInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupProperties.java new file mode 100644 index 0000000000000..e13aef529b1a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationPolicyGroupProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroupMember; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for VpnServerConfigurationPolicyGroup. + */ +@Fluent +public final class VpnServerConfigurationPolicyGroupProperties + implements JsonSerializable { + /* + * Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + */ + private Boolean isDefault; + + /* + * Priority for VpnServerConfigurationPolicyGroup. + */ + private Integer priority; + + /* + * Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + */ + private List policyMembers; + + /* + * List of references to P2SConnectionConfigurations. + */ + private List p2SConnectionConfigurations; + + /* + * The provisioning state of the VpnServerConfigurationPolicyGroup resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VpnServerConfigurationPolicyGroupProperties class. + */ + public VpnServerConfigurationPolicyGroupProperties() { + } + + /** + * Get the isDefault property: Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set the isDefault property: Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + * + * @param isDefault the isDefault value to set. + * @return the VpnServerConfigurationPolicyGroupProperties object itself. + */ + public VpnServerConfigurationPolicyGroupProperties withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the priority property: Priority for VpnServerConfigurationPolicyGroup. + * + * @return the priority value. + */ + public Integer priority() { + return this.priority; + } + + /** + * Set the priority property: Priority for VpnServerConfigurationPolicyGroup. + * + * @param priority the priority value to set. + * @return the VpnServerConfigurationPolicyGroupProperties object itself. + */ + public VpnServerConfigurationPolicyGroupProperties withPriority(Integer priority) { + this.priority = priority; + return this; + } + + /** + * Get the policyMembers property: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + * + * @return the policyMembers value. + */ + public List policyMembers() { + return this.policyMembers; + } + + /** + * Set the policyMembers property: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + * + * @param policyMembers the policyMembers value to set. + * @return the VpnServerConfigurationPolicyGroupProperties object itself. + */ + public VpnServerConfigurationPolicyGroupProperties + withPolicyMembers(List policyMembers) { + this.policyMembers = policyMembers; + return this; + } + + /** + * Get the p2SConnectionConfigurations property: List of references to P2SConnectionConfigurations. + * + * @return the p2SConnectionConfigurations value. + */ + public List p2SConnectionConfigurations() { + return this.p2SConnectionConfigurations; + } + + /** + * Get the provisioningState property: The provisioning state of the VpnServerConfigurationPolicyGroup 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() { + if (policyMembers() != null) { + policyMembers().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeArrayField("policyMembers", this.policyMembers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigurationPolicyGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigurationPolicyGroupProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigurationPolicyGroupProperties. + */ + public static VpnServerConfigurationPolicyGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigurationPolicyGroupProperties deserializedVpnServerConfigurationPolicyGroupProperties + = new VpnServerConfigurationPolicyGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isDefault".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupProperties.isDefault + = reader.getNullable(JsonReader::getBoolean); + } else if ("priority".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupProperties.priority + = reader.getNullable(JsonReader::getInt); + } else if ("policyMembers".equals(fieldName)) { + List policyMembers + = reader.readArray(reader1 -> VpnServerConfigurationPolicyGroupMember.fromJson(reader1)); + deserializedVpnServerConfigurationPolicyGroupProperties.policyMembers = policyMembers; + } else if ("p2SConnectionConfigurations".equals(fieldName)) { + List p2SConnectionConfigurations + = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVpnServerConfigurationPolicyGroupProperties.p2SConnectionConfigurations + = p2SConnectionConfigurations; + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigurationPolicyGroupProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationProperties.java new file mode 100644 index 0000000000000..2e5b36c2fa33c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationProperties.java @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for VpnServerConfiguration. + */ +@Fluent +public final class VpnServerConfigurationProperties implements JsonSerializable { + /* + * The name of the VpnServerConfiguration that is unique within a resource group. + */ + private String name; + + /* + * VPN protocols for the VpnServerConfiguration. + */ + private List vpnProtocols; + + /* + * VPN authentication types for the VpnServerConfiguration. + */ + private List vpnAuthenticationTypes; + + /* + * VPN client root certificate of VpnServerConfiguration. + */ + private List vpnClientRootCertificates; + + /* + * VPN client revoked certificate of VpnServerConfiguration. + */ + private List vpnClientRevokedCertificates; + + /* + * Radius Server root certificate of VpnServerConfiguration. + */ + private List radiusServerRootCertificates; + + /* + * Radius client root certificate of VpnServerConfiguration. + */ + private List radiusClientRootCertificates; + + /* + * VpnClientIpsecPolicies for VpnServerConfiguration. + */ + private List vpnClientIpsecPolicies; + + /* + * The radius server address property of the VpnServerConfiguration resource for point to site client connection. + */ + private String radiusServerAddress; + + /* + * The radius secret property of the VpnServerConfiguration resource for point to site client connection. + */ + private String radiusServerSecret; + + /* + * Multiple Radius Server configuration for VpnServerConfiguration. + */ + private List radiusServers; + + /* + * The set of aad vpn authentication parameters. + */ + private AadAuthenticationParameters aadAuthenticationParameters; + + /* + * The provisioning state of the VpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', and + * 'Failed'. + */ + private String provisioningState; + + /* + * List of references to P2SVpnGateways. + */ + private List p2SVpnGateways; + + /* + * List of all VpnServerConfigurationPolicyGroups. + */ + private List configurationPolicyGroups; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VpnServerConfigurationProperties class. + */ + public VpnServerConfigurationProperties() { + } + + /** + * Get the name property: The name of the VpnServerConfiguration that is unique within a resource group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the VpnServerConfiguration that is unique within a resource group. + * + * @param name the name value to set. + * @return the VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties withName(String name) { + this.name = name; + 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties + 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties + 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties 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 VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties + 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 configurationPolicyGroups property: List of all VpnServerConfigurationPolicyGroups. + * + * @return the configurationPolicyGroups value. + */ + public List configurationPolicyGroups() { + return this.configurationPolicyGroups; + } + + /** + * Set the configurationPolicyGroups property: List of all VpnServerConfigurationPolicyGroups. + * + * @param configurationPolicyGroups the configurationPolicyGroups value to set. + * @return the VpnServerConfigurationProperties object itself. + */ + public VpnServerConfigurationProperties + withConfigurationPolicyGroups(List configurationPolicyGroups) { + this.configurationPolicyGroups = configurationPolicyGroups; + 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; + } + + /** + * 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()); + } + if (configurationPolicyGroups() != null) { + configurationPolicyGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("vpnProtocols", this.vpnProtocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("vpnAuthenticationTypes", this.vpnAuthenticationTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("vpnClientRootCertificates", this.vpnClientRootCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("vpnClientRevokedCertificates", this.vpnClientRevokedCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("radiusServerRootCertificates", this.radiusServerRootCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("radiusClientRootCertificates", this.radiusClientRootCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("vpnClientIpsecPolicies", this.vpnClientIpsecPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("radiusServerAddress", this.radiusServerAddress); + jsonWriter.writeStringField("radiusServerSecret", this.radiusServerSecret); + jsonWriter.writeArrayField("radiusServers", this.radiusServers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("aadAuthenticationParameters", this.aadAuthenticationParameters); + jsonWriter.writeArrayField("configurationPolicyGroups", this.configurationPolicyGroups, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigurationProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigurationProperties. + */ + public static VpnServerConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigurationProperties deserializedVpnServerConfigurationProperties + = new VpnServerConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnServerConfigurationProperties.name = reader.getString(); + } else if ("vpnProtocols".equals(fieldName)) { + List vpnProtocols + = reader.readArray(reader1 -> VpnGatewayTunnelingProtocol.fromString(reader1.getString())); + deserializedVpnServerConfigurationProperties.vpnProtocols = vpnProtocols; + } else if ("vpnAuthenticationTypes".equals(fieldName)) { + List vpnAuthenticationTypes + = reader.readArray(reader1 -> VpnAuthenticationType.fromString(reader1.getString())); + deserializedVpnServerConfigurationProperties.vpnAuthenticationTypes = vpnAuthenticationTypes; + } else if ("vpnClientRootCertificates".equals(fieldName)) { + List vpnClientRootCertificates + = reader.readArray(reader1 -> VpnServerConfigVpnClientRootCertificate.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.vpnClientRootCertificates = vpnClientRootCertificates; + } else if ("vpnClientRevokedCertificates".equals(fieldName)) { + List vpnClientRevokedCertificates + = reader.readArray(reader1 -> VpnServerConfigVpnClientRevokedCertificate.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.vpnClientRevokedCertificates + = vpnClientRevokedCertificates; + } else if ("radiusServerRootCertificates".equals(fieldName)) { + List radiusServerRootCertificates + = reader.readArray(reader1 -> VpnServerConfigRadiusServerRootCertificate.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.radiusServerRootCertificates + = radiusServerRootCertificates; + } else if ("radiusClientRootCertificates".equals(fieldName)) { + List radiusClientRootCertificates + = reader.readArray(reader1 -> VpnServerConfigRadiusClientRootCertificate.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.radiusClientRootCertificates + = radiusClientRootCertificates; + } else if ("vpnClientIpsecPolicies".equals(fieldName)) { + List vpnClientIpsecPolicies + = reader.readArray(reader1 -> IpsecPolicy.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + } else if ("radiusServerAddress".equals(fieldName)) { + deserializedVpnServerConfigurationProperties.radiusServerAddress = reader.getString(); + } else if ("radiusServerSecret".equals(fieldName)) { + deserializedVpnServerConfigurationProperties.radiusServerSecret = reader.getString(); + } else if ("radiusServers".equals(fieldName)) { + List radiusServers = reader.readArray(reader1 -> RadiusServer.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.radiusServers = radiusServers; + } else if ("aadAuthenticationParameters".equals(fieldName)) { + deserializedVpnServerConfigurationProperties.aadAuthenticationParameters + = AadAuthenticationParameters.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnServerConfigurationProperties.provisioningState = reader.getString(); + } else if ("p2SVpnGateways".equals(fieldName)) { + List p2SVpnGateways + = reader.readArray(reader1 -> P2SVpnGatewayInner.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.p2SVpnGateways = p2SVpnGateways; + } else if ("configurationPolicyGroups".equals(fieldName)) { + List configurationPolicyGroups + = reader.readArray(reader1 -> VpnServerConfigurationPolicyGroupInner.fromJson(reader1)); + deserializedVpnServerConfigurationProperties.configurationPolicyGroups = configurationPolicyGroups; + } else if ("etag".equals(fieldName)) { + deserializedVpnServerConfigurationProperties.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigurationProperties; + }); + } +} 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..a786ec158d9ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnServerConfigurationsResponseInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VpnServerConfigurations list associated with VirtualWan Response. + */ +@Fluent +public final class VpnServerConfigurationsResponseInner + implements JsonSerializable { + /* + * List of VpnServerConfigurations associated with VirtualWan. + */ + private List vpnServerConfigurationResourceIds; + + /** + * Creates an instance of VpnServerConfigurationsResponseInner class. + */ + public VpnServerConfigurationsResponseInner() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vpnServerConfigurationResourceIds", this.vpnServerConfigurationResourceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigurationsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigurationsResponseInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigurationsResponseInner. + */ + public static VpnServerConfigurationsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigurationsResponseInner deserializedVpnServerConfigurationsResponseInner + = new VpnServerConfigurationsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnServerConfigurationResourceIds".equals(fieldName)) { + List vpnServerConfigurationResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedVpnServerConfigurationsResponseInner.vpnServerConfigurationResourceIds + = vpnServerConfigurationResourceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigurationsResponseInner; + }); + } +} 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..22d7c5b5e6db7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * VpnSite Resource. + */ +@Fluent +public final class VpnSiteInner extends Resource { + /* + * Properties of the VPN site. + */ + private VpnSiteProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VpnSiteInner class. + */ + public VpnSiteInner() { + } + + /** + * Get the innerProperties property: Properties of the VPN site. + * + * @return the innerProperties value. + */ + private VpnSiteProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 VpnSiteInner object itself. + */ + public VpnSiteInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnSiteInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnSiteInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the virtualWan property: The VirtualWAN to which the vpnSite belongs. + * + * @return the virtualWan value. + */ + public SubResource virtualWan() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withVirtualWan(virtualWan); + return this; + } + + /** + * Get the deviceProperties property: The device properties. + * + * @return the deviceProperties value. + */ + public DeviceProperties deviceProperties() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withDeviceProperties(deviceProperties); + return this; + } + + /** + * Get the ipAddress property: The ip-address for the vpn-site. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withIpAddress(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withSiteKey(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withAddressSpace(addressSpace); + return this; + } + + /** + * Get the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + public BgpSettings bgpProperties() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withBgpProperties(bgpProperties); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VPN site resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the isSecuritySite property: IsSecuritySite flag. + * + * @return the isSecuritySite value. + */ + public Boolean isSecuritySite() { + return this.innerProperties() == null ? null : this.innerProperties().isSecuritySite(); + } + + /** + * Set the isSecuritySite property: IsSecuritySite flag. + * + * @param isSecuritySite the isSecuritySite value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withIsSecuritySite(Boolean isSecuritySite) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withIsSecuritySite(isSecuritySite); + return this; + } + + /** + * Get the vpnSiteLinks property: List of all vpn site links. + * + * @return the vpnSiteLinks value. + */ + public List vpnSiteLinks() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withVpnSiteLinks(vpnSiteLinks); + return this; + } + + /** + * Get the o365Policy property: Office365 Policy. + * + * @return the o365Policy value. + */ + public O365PolicyProperties o365Policy() { + return this.innerProperties() == null ? null : this.innerProperties().o365Policy(); + } + + /** + * Set the o365Policy property: Office365 Policy. + * + * @param o365Policy the o365Policy value to set. + * @return the VpnSiteInner object itself. + */ + public VpnSiteInner withO365Policy(O365PolicyProperties o365Policy) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteProperties(); + } + this.innerProperties().withO365Policy(o365Policy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnSiteInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnSiteInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VpnSiteInner. + */ + public static VpnSiteInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnSiteInner deserializedVpnSiteInner = new VpnSiteInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnSiteInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVpnSiteInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVpnSiteInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVpnSiteInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVpnSiteInner.innerProperties = VpnSiteProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVpnSiteInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedVpnSiteInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnSiteInner; + }); + } +} 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..ecb95c4ee47cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionInner.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 java.io.IOException; +import java.util.List; + +/** + * VpnSiteLinkConnection Resource. + */ +@Fluent +public final class VpnSiteLinkConnectionInner extends SubResource { + /* + * Properties of the VPN site link connection. + */ + private VpnSiteLinkConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of VpnSiteLinkConnectionInner class. + */ + public VpnSiteLinkConnectionInner() { + } + + /** + * Get the innerProperties property: Properties of the VPN site link connection. + * + * @return the innerProperties value. + */ + private VpnSiteLinkConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnSiteLinkConnectionInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the vpnSiteLink property: Id of the connected vpn site link. + * + * @return the vpnSiteLink value. + */ + public SubResource vpnSiteLink() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withVpnSiteLink(vpnSiteLink); + return this; + } + + /** + * Get the routingWeight property: Routing weight for vpn connection. + * + * @return the routingWeight value. + */ + public Integer routingWeight() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withRoutingWeight(routingWeight); + return this; + } + + /** + * Get the vpnLinkConnectionMode property: Vpn link connection mode. + * + * @return the vpnLinkConnectionMode value. + */ + public VpnLinkConnectionMode vpnLinkConnectionMode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withVpnLinkConnectionMode(vpnLinkConnectionMode); + return this; + } + + /** + * Get the connectionStatus property: The connection status. + * + * @return the connectionStatus value. + */ + public VpnConnectionStatus connectionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().connectionStatus(); + } + + /** + * Get the vpnConnectionProtocolType property: Connection protocol used for this connection. + * + * @return the vpnConnectionProtocolType value. + */ + public VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withVpnConnectionProtocolType(vpnConnectionProtocolType); + return this; + } + + /** + * Get the ingressBytesTransferred property: Ingress bytes transferred. + * + * @return the ingressBytesTransferred value. + */ + public Long ingressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().ingressBytesTransferred(); + } + + /** + * Get the egressBytesTransferred property: Egress bytes transferred. + * + * @return the egressBytesTransferred value. + */ + public Long egressBytesTransferred() { + return this.innerProperties() == null ? null : this.innerProperties().egressBytesTransferred(); + } + + /** + * Get the connectionBandwidth property: Expected bandwidth in MBPS. + * + * @return the connectionBandwidth value. + */ + public Integer connectionBandwidth() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withConnectionBandwidth(connectionBandwidth); + return this; + } + + /** + * Get the sharedKey property: SharedKey for the vpn connection. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withSharedKey(sharedKey); + return this; + } + + /** + * Get the enableBgp property: EnableBgp flag. + * + * @return the enableBgp value. + */ + public Boolean enableBgp() { + return this.innerProperties() == null ? null : this.innerProperties().enableBgp(); + } + + /** + * Set the enableBgp property: EnableBgp flag. + * + * @param enableBgp the enableBgp value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withEnableBgp(Boolean enableBgp) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withEnableBgp(enableBgp); + return this; + } + + /** + * Get the vpnGatewayCustomBgpAddresses property: vpnGatewayCustomBgpAddresses used by this connection. + * + * @return the vpnGatewayCustomBgpAddresses value. + */ + public List vpnGatewayCustomBgpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().vpnGatewayCustomBgpAddresses(); + } + + /** + * Set the vpnGatewayCustomBgpAddresses property: vpnGatewayCustomBgpAddresses used by this connection. + * + * @param vpnGatewayCustomBgpAddresses the vpnGatewayCustomBgpAddresses value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner + withVpnGatewayCustomBgpAddresses(List vpnGatewayCustomBgpAddresses) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withVpnGatewayCustomBgpAddresses(vpnGatewayCustomBgpAddresses); + return this; + } + + /** + * Get the usePolicyBasedTrafficSelectors property: Enable policy-based traffic selectors. + * + * @return the usePolicyBasedTrafficSelectors value. + */ + public Boolean usePolicyBasedTrafficSelectors() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withUsePolicyBasedTrafficSelectors(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withIpsecPolicies(ipsecPolicies); + return this; + } + + /** + * Get the enableRateLimiting property: EnableBgp flag. + * + * @return the enableRateLimiting value. + */ + public Boolean enableRateLimiting() { + return this.innerProperties() == null ? null : this.innerProperties().enableRateLimiting(); + } + + /** + * Set the enableRateLimiting property: EnableBgp flag. + * + * @param enableRateLimiting the enableRateLimiting value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withEnableRateLimiting(Boolean enableRateLimiting) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withEnableRateLimiting(enableRateLimiting); + return this; + } + + /** + * Get the useLocalAzureIpAddress property: Use local azure ip to initiate connection. + * + * @return the useLocalAzureIpAddress value. + */ + public Boolean useLocalAzureIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withUseLocalAzureIpAddress(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ingressNatRules property: List of ingress NatRules. + * + * @return the ingressNatRules value. + */ + public List ingressNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withIngressNatRules(ingressNatRules); + return this; + } + + /** + * Get the egressNatRules property: List of egress NatRules. + * + * @return the egressNatRules value. + */ + public List egressNatRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withEgressNatRules(egressNatRules); + return this; + } + + /** + * Get the dpdTimeoutSeconds property: Dead Peer Detection timeout in seconds for VpnLink connection. + * + * @return the dpdTimeoutSeconds value. + */ + public Integer dpdTimeoutSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().dpdTimeoutSeconds(); + } + + /** + * Set the dpdTimeoutSeconds property: Dead Peer Detection timeout in seconds for VpnLink connection. + * + * @param dpdTimeoutSeconds the dpdTimeoutSeconds value to set. + * @return the VpnSiteLinkConnectionInner object itself. + */ + public VpnSiteLinkConnectionInner withDpdTimeoutSeconds(Integer dpdTimeoutSeconds) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkConnectionProperties(); + } + this.innerProperties().withDpdTimeoutSeconds(dpdTimeoutSeconds); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnSiteLinkConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnSiteLinkConnectionInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnSiteLinkConnectionInner. + */ + public static VpnSiteLinkConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnSiteLinkConnectionInner deserializedVpnSiteLinkConnectionInner = new VpnSiteLinkConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnSiteLinkConnectionInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVpnSiteLinkConnectionInner.innerProperties + = VpnSiteLinkConnectionProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVpnSiteLinkConnectionInner.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVpnSiteLinkConnectionInner.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVpnSiteLinkConnectionInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnSiteLinkConnectionInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionProperties.java new file mode 100644 index 0000000000000..e28af64e81650 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkConnectionProperties.java @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for VpnConnection. + */ +@Fluent +public final class VpnSiteLinkConnectionProperties implements JsonSerializable { + /* + * Id of the connected vpn site link. + */ + private SubResource vpnSiteLink; + + /* + * Routing weight for vpn connection. + */ + private Integer routingWeight; + + /* + * Vpn link connection mode. + */ + private VpnLinkConnectionMode vpnLinkConnectionMode; + + /* + * The connection status. + */ + private VpnConnectionStatus connectionStatus; + + /* + * Connection protocol used for this connection. + */ + private VirtualNetworkGatewayConnectionProtocol vpnConnectionProtocolType; + + /* + * Ingress bytes transferred. + */ + private Long ingressBytesTransferred; + + /* + * Egress bytes transferred. + */ + private Long egressBytesTransferred; + + /* + * Expected bandwidth in MBPS. + */ + private Integer connectionBandwidth; + + /* + * SharedKey for the vpn connection. + */ + private String sharedKey; + + /* + * EnableBgp flag. + */ + private Boolean enableBgp; + + /* + * vpnGatewayCustomBgpAddresses used by this connection. + */ + private List vpnGatewayCustomBgpAddresses; + + /* + * Enable policy-based traffic selectors. + */ + private Boolean usePolicyBasedTrafficSelectors; + + /* + * The IPSec Policies to be considered by this connection. + */ + private List ipsecPolicies; + + /* + * EnableBgp flag. + */ + private Boolean enableRateLimiting; + + /* + * Use local azure ip to initiate connection. + */ + private Boolean useLocalAzureIpAddress; + + /* + * The provisioning state of the VPN site link connection resource. + */ + private ProvisioningState provisioningState; + + /* + * List of ingress NatRules. + */ + private List ingressNatRules; + + /* + * List of egress NatRules. + */ + private List egressNatRules; + + /* + * Dead Peer Detection timeout in seconds for VpnLink connection. + */ + private Integer dpdTimeoutSeconds; + + /** + * Creates an instance of VpnSiteLinkConnectionProperties class. + */ + public VpnSiteLinkConnectionProperties() { + } + + /** + * 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties + 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties withEnableBgp(Boolean enableBgp) { + this.enableBgp = enableBgp; + return this; + } + + /** + * Get the vpnGatewayCustomBgpAddresses property: vpnGatewayCustomBgpAddresses used by this connection. + * + * @return the vpnGatewayCustomBgpAddresses value. + */ + public List vpnGatewayCustomBgpAddresses() { + return this.vpnGatewayCustomBgpAddresses; + } + + /** + * Set the vpnGatewayCustomBgpAddresses property: vpnGatewayCustomBgpAddresses used by this connection. + * + * @param vpnGatewayCustomBgpAddresses the vpnGatewayCustomBgpAddresses value to set. + * @return the VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties + withVpnGatewayCustomBgpAddresses(List vpnGatewayCustomBgpAddresses) { + this.vpnGatewayCustomBgpAddresses = vpnGatewayCustomBgpAddresses; + 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties 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 VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties withEgressNatRules(List egressNatRules) { + this.egressNatRules = egressNatRules; + return this; + } + + /** + * Get the dpdTimeoutSeconds property: Dead Peer Detection timeout in seconds for VpnLink connection. + * + * @return the dpdTimeoutSeconds value. + */ + public Integer dpdTimeoutSeconds() { + return this.dpdTimeoutSeconds; + } + + /** + * Set the dpdTimeoutSeconds property: Dead Peer Detection timeout in seconds for VpnLink connection. + * + * @param dpdTimeoutSeconds the dpdTimeoutSeconds value to set. + * @return the VpnSiteLinkConnectionProperties object itself. + */ + public VpnSiteLinkConnectionProperties withDpdTimeoutSeconds(Integer dpdTimeoutSeconds) { + this.dpdTimeoutSeconds = dpdTimeoutSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vpnGatewayCustomBgpAddresses() != null) { + vpnGatewayCustomBgpAddresses().forEach(e -> e.validate()); + } + if (ipsecPolicies() != null) { + ipsecPolicies().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vpnSiteLink", this.vpnSiteLink); + jsonWriter.writeNumberField("routingWeight", this.routingWeight); + jsonWriter.writeStringField("vpnLinkConnectionMode", + this.vpnLinkConnectionMode == null ? null : this.vpnLinkConnectionMode.toString()); + jsonWriter.writeStringField("vpnConnectionProtocolType", + this.vpnConnectionProtocolType == null ? null : this.vpnConnectionProtocolType.toString()); + jsonWriter.writeNumberField("connectionBandwidth", this.connectionBandwidth); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeBooleanField("enableBgp", this.enableBgp); + jsonWriter.writeArrayField("vpnGatewayCustomBgpAddresses", this.vpnGatewayCustomBgpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("usePolicyBasedTrafficSelectors", this.usePolicyBasedTrafficSelectors); + jsonWriter.writeArrayField("ipsecPolicies", this.ipsecPolicies, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enableRateLimiting", this.enableRateLimiting); + jsonWriter.writeBooleanField("useLocalAzureIpAddress", this.useLocalAzureIpAddress); + jsonWriter.writeArrayField("ingressNatRules", this.ingressNatRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("egressNatRules", this.egressNatRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("dpdTimeoutSeconds", this.dpdTimeoutSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnSiteLinkConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnSiteLinkConnectionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnSiteLinkConnectionProperties. + */ + public static VpnSiteLinkConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnSiteLinkConnectionProperties deserializedVpnSiteLinkConnectionProperties + = new VpnSiteLinkConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnSiteLink".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.vpnSiteLink = SubResource.fromJson(reader); + } else if ("routingWeight".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.routingWeight = reader.getNullable(JsonReader::getInt); + } else if ("vpnLinkConnectionMode".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.vpnLinkConnectionMode + = VpnLinkConnectionMode.fromString(reader.getString()); + } else if ("connectionStatus".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.connectionStatus + = VpnConnectionStatus.fromString(reader.getString()); + } else if ("vpnConnectionProtocolType".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.vpnConnectionProtocolType + = VirtualNetworkGatewayConnectionProtocol.fromString(reader.getString()); + } else if ("ingressBytesTransferred".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.ingressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("egressBytesTransferred".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.egressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("connectionBandwidth".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.connectionBandwidth + = reader.getNullable(JsonReader::getInt); + } else if ("sharedKey".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.sharedKey = reader.getString(); + } else if ("enableBgp".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.enableBgp = reader.getNullable(JsonReader::getBoolean); + } else if ("vpnGatewayCustomBgpAddresses".equals(fieldName)) { + List vpnGatewayCustomBgpAddresses + = reader.readArray(reader1 -> GatewayCustomBgpIpAddressIpConfiguration.fromJson(reader1)); + deserializedVpnSiteLinkConnectionProperties.vpnGatewayCustomBgpAddresses + = vpnGatewayCustomBgpAddresses; + } else if ("usePolicyBasedTrafficSelectors".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.usePolicyBasedTrafficSelectors + = reader.getNullable(JsonReader::getBoolean); + } else if ("ipsecPolicies".equals(fieldName)) { + List ipsecPolicies = reader.readArray(reader1 -> IpsecPolicy.fromJson(reader1)); + deserializedVpnSiteLinkConnectionProperties.ipsecPolicies = ipsecPolicies; + } else if ("enableRateLimiting".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.enableRateLimiting + = reader.getNullable(JsonReader::getBoolean); + } else if ("useLocalAzureIpAddress".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.useLocalAzureIpAddress + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("ingressNatRules".equals(fieldName)) { + List ingressNatRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVpnSiteLinkConnectionProperties.ingressNatRules = ingressNatRules; + } else if ("egressNatRules".equals(fieldName)) { + List egressNatRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVpnSiteLinkConnectionProperties.egressNatRules = egressNatRules; + } else if ("dpdTimeoutSeconds".equals(fieldName)) { + deserializedVpnSiteLinkConnectionProperties.dpdTimeoutSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnSiteLinkConnectionProperties; + }); + } +} 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..0f601ac61aa95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkInner.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; + +/** + * VpnSiteLink Resource. + */ +@Fluent +public final class VpnSiteLinkInner extends SubResource { + /* + * Properties of the VPN site link. + */ + private VpnSiteLinkProperties innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of VpnSiteLinkInner class. + */ + public VpnSiteLinkInner() { + } + + /** + * Get the innerProperties property: Properties of the VPN site link. + * + * @return the innerProperties value. + */ + private VpnSiteLinkProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnSiteLinkInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the linkProperties property: The link provider properties. + * + * @return the linkProperties value. + */ + public VpnLinkProviderProperties linkProperties() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkProperties(); + } + this.innerProperties().withLinkProperties(linkProperties); + return this; + } + + /** + * Get the ipAddress property: The ip-address for the vpn-site-link. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkProperties(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the fqdn property: FQDN of vpn-site-link. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkProperties(); + } + this.innerProperties().withFqdn(fqdn); + return this; + } + + /** + * Get the bgpProperties property: The set of bgp properties. + * + * @return the bgpProperties value. + */ + public VpnLinkBgpSettings bgpProperties() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnSiteLinkProperties(); + } + this.innerProperties().withBgpProperties(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnSiteLinkInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnSiteLinkInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnSiteLinkInner. + */ + public static VpnSiteLinkInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnSiteLinkInner deserializedVpnSiteLinkInner = new VpnSiteLinkInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnSiteLinkInner.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVpnSiteLinkInner.innerProperties = VpnSiteLinkProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedVpnSiteLinkInner.etag = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVpnSiteLinkInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVpnSiteLinkInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnSiteLinkInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkProperties.java new file mode 100644 index 0000000000000..78a44528c155d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteLinkProperties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import java.io.IOException; + +/** + * Parameters for VpnSite. + */ +@Fluent +public final class VpnSiteLinkProperties implements JsonSerializable { + /* + * The link provider properties. + */ + private VpnLinkProviderProperties linkProperties; + + /* + * The ip-address for the vpn-site-link. + */ + private String ipAddress; + + /* + * FQDN of vpn-site-link. + */ + private String fqdn; + + /* + * The set of bgp properties. + */ + private VpnLinkBgpSettings bgpProperties; + + /* + * The provisioning state of the VPN site link resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of VpnSiteLinkProperties class. + */ + public VpnSiteLinkProperties() { + } + + /** + * 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 VpnSiteLinkProperties object itself. + */ + public VpnSiteLinkProperties 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 VpnSiteLinkProperties object itself. + */ + public VpnSiteLinkProperties 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 VpnSiteLinkProperties object itself. + */ + public VpnSiteLinkProperties 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 VpnSiteLinkProperties object itself. + */ + public VpnSiteLinkProperties 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; + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("linkProperties", this.linkProperties); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeJsonField("bgpProperties", this.bgpProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnSiteLinkProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnSiteLinkProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnSiteLinkProperties. + */ + public static VpnSiteLinkProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnSiteLinkProperties deserializedVpnSiteLinkProperties = new VpnSiteLinkProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("linkProperties".equals(fieldName)) { + deserializedVpnSiteLinkProperties.linkProperties = VpnLinkProviderProperties.fromJson(reader); + } else if ("ipAddress".equals(fieldName)) { + deserializedVpnSiteLinkProperties.ipAddress = reader.getString(); + } else if ("fqdn".equals(fieldName)) { + deserializedVpnSiteLinkProperties.fqdn = reader.getString(); + } else if ("bgpProperties".equals(fieldName)) { + deserializedVpnSiteLinkProperties.bgpProperties = VpnLinkBgpSettings.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnSiteLinkProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnSiteLinkProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteProperties.java new file mode 100644 index 0000000000000..0df1e2bd8258e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/VpnSiteProperties.java @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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 java.io.IOException; +import java.util.List; + +/** + * Parameters for VpnSite. + */ +@Fluent +public final class VpnSiteProperties implements JsonSerializable { + /* + * The VirtualWAN to which the vpnSite belongs. + */ + private SubResource virtualWan; + + /* + * The device properties. + */ + private DeviceProperties deviceProperties; + + /* + * The ip-address for the vpn-site. + */ + private String ipAddress; + + /* + * The key for vpn-site that can be used for connections. + */ + private String siteKey; + + /* + * The AddressSpace that contains an array of IP address ranges. + */ + private AddressSpace addressSpace; + + /* + * The set of bgp properties. + */ + private BgpSettings bgpProperties; + + /* + * The provisioning state of the VPN site resource. + */ + private ProvisioningState provisioningState; + + /* + * IsSecuritySite flag. + */ + private Boolean isSecuritySite; + + /* + * List of all vpn site links. + */ + private List vpnSiteLinks; + + /* + * Office365 Policy. + */ + private O365PolicyProperties o365Policy; + + /** + * Creates an instance of VpnSiteProperties class. + */ + public VpnSiteProperties() { + } + + /** + * 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties 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 VpnSiteProperties object itself. + */ + public VpnSiteProperties withO365Policy(O365PolicyProperties o365Policy) { + this.o365Policy = o365Policy; + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("virtualWan", this.virtualWan); + jsonWriter.writeJsonField("deviceProperties", this.deviceProperties); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeStringField("siteKey", this.siteKey); + jsonWriter.writeJsonField("addressSpace", this.addressSpace); + jsonWriter.writeJsonField("bgpProperties", this.bgpProperties); + jsonWriter.writeBooleanField("isSecuritySite", this.isSecuritySite); + jsonWriter.writeArrayField("vpnSiteLinks", this.vpnSiteLinks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("o365Policy", this.o365Policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnSiteProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnSiteProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnSiteProperties. + */ + public static VpnSiteProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnSiteProperties deserializedVpnSiteProperties = new VpnSiteProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualWan".equals(fieldName)) { + deserializedVpnSiteProperties.virtualWan = SubResource.fromJson(reader); + } else if ("deviceProperties".equals(fieldName)) { + deserializedVpnSiteProperties.deviceProperties = DeviceProperties.fromJson(reader); + } else if ("ipAddress".equals(fieldName)) { + deserializedVpnSiteProperties.ipAddress = reader.getString(); + } else if ("siteKey".equals(fieldName)) { + deserializedVpnSiteProperties.siteKey = reader.getString(); + } else if ("addressSpace".equals(fieldName)) { + deserializedVpnSiteProperties.addressSpace = AddressSpace.fromJson(reader); + } else if ("bgpProperties".equals(fieldName)) { + deserializedVpnSiteProperties.bgpProperties = BgpSettings.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVpnSiteProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("isSecuritySite".equals(fieldName)) { + deserializedVpnSiteProperties.isSecuritySite = reader.getNullable(JsonReader::getBoolean); + } else if ("vpnSiteLinks".equals(fieldName)) { + List vpnSiteLinks + = reader.readArray(reader1 -> VpnSiteLinkInner.fromJson(reader1)); + deserializedVpnSiteProperties.vpnSiteLinks = vpnSiteLinks; + } else if ("o365Policy".equals(fieldName)) { + deserializedVpnSiteProperties.o365Policy = O365PolicyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnSiteProperties; + }); + } +} 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..37a177cca3f20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayForContainersReferenceDefinition; +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 java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Defines web application firewall policy. + */ +@Fluent +public final class WebApplicationFirewallPolicyInner extends Resource { + /* + * Properties of the web application firewall policy. + */ + private WebApplicationFirewallPolicyPropertiesFormat innerProperties; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of WebApplicationFirewallPolicyInner class. + */ + public WebApplicationFirewallPolicyInner() { + } + + /** + * Get the innerProperties property: Properties of the web application firewall policy. + * + * @return the innerProperties value. + */ + private WebApplicationFirewallPolicyPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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 WebApplicationFirewallPolicyInner object itself. + */ + public WebApplicationFirewallPolicyInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public WebApplicationFirewallPolicyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public WebApplicationFirewallPolicyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the policySettings property: The PolicySettings for policy. + * + * @return the policySettings value. + */ + public PolicySettings policySettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebApplicationFirewallPolicyPropertiesFormat(); + } + this.innerProperties().withPolicySettings(policySettings); + return this; + } + + /** + * Get the customRules property: The custom rules inside the policy. + * + * @return the customRules value. + */ + public List customRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebApplicationFirewallPolicyPropertiesFormat(); + } + this.innerProperties().withCustomRules(customRules); + return this; + } + + /** + * Get the applicationGateways property: A collection of references to application gateways. + * + * @return the applicationGateways value. + */ + public List applicationGateways() { + return this.innerProperties() == null ? null : this.innerProperties().applicationGateways(); + } + + /** + * Get the provisioningState property: The provisioning state of the web application firewall policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceState property: Resource status of the policy. + * + * @return the resourceState value. + */ + public WebApplicationFirewallPolicyResourceState resourceState() { + return this.innerProperties() == null ? null : this.innerProperties().resourceState(); + } + + /** + * Get the managedRules property: Describes the managedRules structure. + * + * @return the managedRules value. + */ + public ManagedRulesDefinition managedRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WebApplicationFirewallPolicyPropertiesFormat(); + } + this.innerProperties().withManagedRules(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.innerProperties() == null ? null : this.innerProperties().httpListeners(); + } + + /** + * Get the pathBasedRules property: A collection of references to application gateway path rules. + * + * @return the pathBasedRules value. + */ + public List pathBasedRules() { + return this.innerProperties() == null ? null : this.innerProperties().pathBasedRules(); + } + + /** + * Get the applicationGatewayForContainers property: A collection of references to application gateway for + * containers. + * + * @return the applicationGatewayForContainers value. + */ + public List applicationGatewayForContainers() { + return this.innerProperties() == null ? null : this.innerProperties().applicationGatewayForContainers(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallPolicyInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WebApplicationFirewallPolicyInner. + */ + public static WebApplicationFirewallPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallPolicyInner deserializedWebApplicationFirewallPolicyInner + = new WebApplicationFirewallPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedWebApplicationFirewallPolicyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyInner.innerProperties + = WebApplicationFirewallPolicyPropertiesFormat.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyInner.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyInner.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallPolicyInner; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyPropertiesFormat.java new file mode 100644 index 0000000000000..3087a6e5b9c89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/models/WebApplicationFirewallPolicyPropertiesFormat.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayForContainersReferenceDefinition; +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 java.io.IOException; +import java.util.List; + +/** + * Defines web application firewall policy properties. + */ +@Fluent +public final class WebApplicationFirewallPolicyPropertiesFormat + implements JsonSerializable { + /* + * The PolicySettings for policy. + */ + private PolicySettings policySettings; + + /* + * The custom rules inside the policy. + */ + private List customRules; + + /* + * A collection of references to application gateways. + */ + private List applicationGateways; + + /* + * The provisioning state of the web application firewall policy resource. + */ + private ProvisioningState provisioningState; + + /* + * Resource status of the policy. + */ + private WebApplicationFirewallPolicyResourceState resourceState; + + /* + * Describes the managedRules structure. + */ + private ManagedRulesDefinition managedRules; + + /* + * A collection of references to application gateway http listeners. + */ + private List httpListeners; + + /* + * A collection of references to application gateway path rules. + */ + private List pathBasedRules; + + /* + * A collection of references to application gateway for containers. + */ + private List applicationGatewayForContainers; + + /** + * Creates an instance of WebApplicationFirewallPolicyPropertiesFormat class. + */ + public WebApplicationFirewallPolicyPropertiesFormat() { + } + + /** + * 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 WebApplicationFirewallPolicyPropertiesFormat object itself. + */ + public WebApplicationFirewallPolicyPropertiesFormat 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 WebApplicationFirewallPolicyPropertiesFormat object itself. + */ + public WebApplicationFirewallPolicyPropertiesFormat + 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 WebApplicationFirewallPolicyPropertiesFormat object itself. + */ + public WebApplicationFirewallPolicyPropertiesFormat 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 applicationGatewayForContainers property: A collection of references to application gateway for + * containers. + * + * @return the applicationGatewayForContainers value. + */ + public List applicationGatewayForContainers() { + return this.applicationGatewayForContainers; + } + + /** + * 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) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property managedRules in model WebApplicationFirewallPolicyPropertiesFormat")); + } else { + managedRules().validate(); + } + if (applicationGatewayForContainers() != null) { + applicationGatewayForContainers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebApplicationFirewallPolicyPropertiesFormat.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("managedRules", this.managedRules); + jsonWriter.writeJsonField("policySettings", this.policySettings); + jsonWriter.writeArrayField("customRules", this.customRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallPolicyPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallPolicyPropertiesFormat if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WebApplicationFirewallPolicyPropertiesFormat. + */ + public static WebApplicationFirewallPolicyPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallPolicyPropertiesFormat deserializedWebApplicationFirewallPolicyPropertiesFormat + = new WebApplicationFirewallPolicyPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managedRules".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyPropertiesFormat.managedRules + = ManagedRulesDefinition.fromJson(reader); + } else if ("policySettings".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyPropertiesFormat.policySettings + = PolicySettings.fromJson(reader); + } else if ("customRules".equals(fieldName)) { + List customRules + = reader.readArray(reader1 -> WebApplicationFirewallCustomRule.fromJson(reader1)); + deserializedWebApplicationFirewallPolicyPropertiesFormat.customRules = customRules; + } else if ("applicationGateways".equals(fieldName)) { + List applicationGateways + = reader.readArray(reader1 -> ApplicationGatewayInner.fromJson(reader1)); + deserializedWebApplicationFirewallPolicyPropertiesFormat.applicationGateways = applicationGateways; + } else if ("provisioningState".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("resourceState".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyPropertiesFormat.resourceState + = WebApplicationFirewallPolicyResourceState.fromString(reader.getString()); + } else if ("httpListeners".equals(fieldName)) { + List httpListeners = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedWebApplicationFirewallPolicyPropertiesFormat.httpListeners = httpListeners; + } else if ("pathBasedRules".equals(fieldName)) { + List pathBasedRules = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedWebApplicationFirewallPolicyPropertiesFormat.pathBasedRules = pathBasedRules; + } else if ("applicationGatewayForContainers".equals(fieldName)) { + List applicationGatewayForContainers = reader + .readArray(reader1 -> ApplicationGatewayForContainersReferenceDefinition.fromJson(reader1)); + deserializedWebApplicationFirewallPolicyPropertiesFormat.applicationGatewayForContainers + = applicationGatewayForContainers; + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallPolicyPropertiesFormat; + }); + } +} 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..5a148874415c1 --- /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,9 @@ +// 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..ee379c4ffc9a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/fluent/package-info.java @@ -0,0 +1,9 @@ +// 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/ActiveConnectivityConfigurationsListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ActiveConnectivityConfigurationsListResultImpl.java new file mode 100644 index 0000000000000..7a8c605affb00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ActiveConnectivityConfigurationsListResultImpl.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.ActiveConnectivityConfigurationsListResultInner; +import com.azure.resourcemanager.network.generated.models.ActiveConnectivityConfiguration; +import com.azure.resourcemanager.network.generated.models.ActiveConnectivityConfigurationsListResult; +import java.util.Collections; +import java.util.List; + +public final class ActiveConnectivityConfigurationsListResultImpl + implements ActiveConnectivityConfigurationsListResult { + private ActiveConnectivityConfigurationsListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ActiveConnectivityConfigurationsListResultImpl(ActiveConnectivityConfigurationsListResultInner 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 skipToken() { + return this.innerModel().skipToken(); + } + + public ActiveConnectivityConfigurationsListResultInner 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/ActiveSecurityAdminRulesListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ActiveSecurityAdminRulesListResultImpl.java new file mode 100644 index 0000000000000..64d0368f48fd3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ActiveSecurityAdminRulesListResultImpl.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.resourcemanager.network.generated.fluent.models.ActiveSecurityAdminRulesListResultInner; +import com.azure.resourcemanager.network.generated.models.ActiveBaseSecurityAdminRule; +import com.azure.resourcemanager.network.generated.models.ActiveSecurityAdminRulesListResult; +import java.util.Collections; +import java.util.List; + +public final class ActiveSecurityAdminRulesListResultImpl implements ActiveSecurityAdminRulesListResult { + private ActiveSecurityAdminRulesListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ActiveSecurityAdminRulesListResultImpl(ActiveSecurityAdminRulesListResultInner 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 skipToken() { + return this.innerModel().skipToken(); + } + + public ActiveSecurityAdminRulesListResultInner 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/AdminRuleCollectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionImpl.java new file mode 100644 index 0000000000000..f96d925dfa5b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionImpl.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AdminRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.AdminRuleCollection; +import com.azure.resourcemanager.network.generated.models.NetworkManagerSecurityGroupItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class AdminRuleCollectionImpl + implements AdminRuleCollection, AdminRuleCollection.Definition, AdminRuleCollection.Update { + private AdminRuleCollectionInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public List appliesToGroups() { + List inner = this.innerModel().appliesToGroups(); + 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 resourceGroupName() { + return resourceGroupName; + } + + public AdminRuleCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + private String ruleCollectionName; + + public AdminRuleCollectionImpl withExistingSecurityAdminConfiguration(String resourceGroupName, + String networkManagerName, String configurationName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + this.configurationName = configurationName; + return this; + } + + public AdminRuleCollection create() { + this.innerObject = serviceManager.serviceClient() + .getAdminRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AdminRuleCollection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAdminRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + AdminRuleCollectionImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new AdminRuleCollectionInner(); + this.serviceManager = serviceManager; + this.ruleCollectionName = name; + } + + public AdminRuleCollectionImpl update() { + return this; + } + + public AdminRuleCollection apply() { + this.innerObject = serviceManager.serviceClient() + .getAdminRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AdminRuleCollection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAdminRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + AdminRuleCollectionImpl(AdminRuleCollectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityAdminConfigurations"); + this.ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ruleCollections"); + } + + public AdminRuleCollection refresh() { + this.innerObject = serviceManager.serviceClient() + .getAdminRuleCollections() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, Context.NONE) + .getValue(); + return this; + } + + public AdminRuleCollection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAdminRuleCollections() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, context) + .getValue(); + return this; + } + + public AdminRuleCollectionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public AdminRuleCollectionImpl withAppliesToGroups(List appliesToGroups) { + this.innerModel().withAppliesToGroups(appliesToGroups); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsClientImpl.java new file mode 100644 index 0000000000000..5d0f6d8c42863 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsClientImpl.java @@ -0,0 +1,1042 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.AdminRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AdminRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.AdminRuleCollectionListResult; +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 AdminRuleCollectionsClient. + */ +public final class AdminRuleCollectionsClientImpl implements AdminRuleCollectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AdminRuleCollectionsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AdminRuleCollectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AdminRuleCollectionsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(AdminRuleCollectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAdminRuleCollections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface AdminRuleCollectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, + @BodyParam("application/json") AdminRuleCollectionInner ruleCollection, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 admin configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, top, skipToken, accept, context)) + .>map(res -> new 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 rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 admin configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 admin configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security admin configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 admin configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, + skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security admin configuration rule collection list result as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken)); + } + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 admin configuration rule collection list result as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken, context)); + } + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security admin configuration rule collection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security admin configuration rule collection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, accept, context); + } + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security admin configuration rule collection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security admin configuration rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + context).block(); + } + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security admin configuration rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdminRuleCollectionInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + Context.NONE).getValue(); + } + + /** + * Creates or updates an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the admin rule collection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + AdminRuleCollectionInner ruleCollection) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleCollection == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleCollection is required and cannot be null.")); + } else { + ruleCollection.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleCollection, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the admin rule collection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + AdminRuleCollectionInner ruleCollection, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleCollection == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleCollection is required and cannot be null.")); + } else { + ruleCollection.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleCollection, accept, + context); + } + + /** + * Creates or updates an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the admin rule collection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, AdminRuleCollectionInner ruleCollection) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleCollection).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the admin rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + AdminRuleCollectionInner ruleCollection, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleCollection, context).block(); + } + + /** + * Creates or updates an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the admin rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AdminRuleCollectionInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, AdminRuleCollectionInner ruleCollection) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleCollection, Context.NONE).getValue(); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Boolean force, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, force, accept, context); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Boolean force = null; + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .getSyncPoller(); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, + context) + .getSyncPoller(); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).block(); + } + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security admin configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 admin configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsImpl.java new file mode 100644 index 0000000000000..4d56fc82cf4c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRuleCollectionsImpl.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.AdminRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.AdminRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.AdminRuleCollection; +import com.azure.resourcemanager.network.generated.models.AdminRuleCollections; + +public final class AdminRuleCollectionsImpl implements AdminRuleCollections { + private static final ClientLogger LOGGER = new ClientLogger(AdminRuleCollectionsImpl.class); + + private final AdminRuleCollectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AdminRuleCollectionsImpl(AdminRuleCollectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, configurationName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AdminRuleCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, networkManagerName, configurationName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AdminRuleCollectionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AdminRuleCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AdminRuleCollection get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + AdminRuleCollectionInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + if (inner != null) { + return new AdminRuleCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context); + } + + public AdminRuleCollection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, localForce, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context); + } + + private AdminRuleCollectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public AdminRuleCollectionImpl define(String name) { + return new AdminRuleCollectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesClientImpl.java new file mode 100644 index 0000000000000..3136c196d9379 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesClientImpl.java @@ -0,0 +1,1098 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.AdminRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import com.azure.resourcemanager.network.generated.models.AdminRuleListResult; +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 AdminRulesClient. + */ +public final class AdminRulesClientImpl implements AdminRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final AdminRulesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of AdminRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AdminRulesClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(AdminRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientAdminRules to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface AdminRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @BodyParam("application/json") BaseAdminRuleInner adminRule, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @QueryParam("force") Boolean force, @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 network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, accept, + context)) + .>map(res -> new 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 network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Integer top, String skipToken, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken)); + } + + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken, context)); + } + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, ruleName, accept, context); + } + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, context).block(); + } + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BaseAdminRuleInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + Context.NONE).getValue(); + } + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base admin rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + BaseAdminRuleInner adminRule) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (adminRule == null) { + return Mono.error(new IllegalArgumentException("Parameter adminRule is required and cannot be null.")); + } else { + adminRule.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, adminRule, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base admin rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + BaseAdminRuleInner adminRule, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (adminRule == null) { + return Mono.error(new IllegalArgumentException("Parameter adminRule is required and cannot be null.")); + } else { + adminRule.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, adminRule, accept, + context); + } + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base admin rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, adminRule).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base admin rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, adminRule, context).block(); + } + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 base admin rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BaseAdminRuleInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, adminRule, Context.NONE).getValue(); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, Boolean force, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, ruleName, force, accept, context); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + final Boolean force = null; + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force) + .getSyncPoller(); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force, context) + .getSyncPoller(); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force) + .block(); + } + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security configuration admin rule list result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 configuration admin rule list result along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesImpl.java new file mode 100644 index 0000000000000..262432fbba2cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AdminRulesImpl.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.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.AdminRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import com.azure.resourcemanager.network.generated.models.AdminRules; +import com.azure.resourcemanager.network.generated.models.BaseAdminRule; + +public final class AdminRulesImpl implements AdminRules { + private static final ClientLogger LOGGER = new ClientLogger(AdminRulesImpl.class); + + private final AdminRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public AdminRulesImpl(AdminRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BaseAdminRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BaseAdminRuleImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BaseAdminRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BaseAdminRule get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + BaseAdminRuleInner inner = this.serviceClient() + .get(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName); + if (inner != null) { + return new BaseAdminRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule, + Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, adminRule, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BaseAdminRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BaseAdminRule createOrUpdate(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule) { + BaseAdminRuleInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + adminRule); + if (inner != null) { + return new BaseAdminRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context); + } + + private AdminRulesClient 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/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..55b8d7d8fb54e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableSslOptionsImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 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..7fbca4935833f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayAvailableWafRuleSetsResultImpl.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.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..2c0ba76457bf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthImpl.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.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..dd4e724fdd446 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthOnDemandImpl.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.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..c508ccb9d9d9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayBackendHealthServerImpl.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.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..2b0987f7a7634 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayImpl.java @@ -0,0 +1,699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ApplicationGatewayBackendSettings; +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.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayLoadDistributionPolicy; +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.ApplicationGatewayRoutingRule; +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.ApplicationGatewaySslPolicyName; +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 String id() { + return this.innerModel().id(); + } + + 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 backendSettingsCollection() { + List inner = this.innerModel().backendSettingsCollection(); + 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 listeners() { + List inner = this.innerModel().listeners(); + 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 routingRules() { + List inner = this.innerModel().routingRules(); + 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 List loadDistributionPolicies() { + List inner = this.innerModel().loadDistributionPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ApplicationGatewayGlobalConfiguration globalConfiguration() { + return this.innerModel().globalConfiguration(); + } + + public ApplicationGatewaySslPolicyName defaultPredefinedSslPolicy() { + return this.innerModel().defaultPredefinedSslPolicy(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationGatewayName + = ResourceManagerUtils.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() { + 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) { + 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 + withBackendSettingsCollection(List backendSettingsCollection) { + this.innerModel().withBackendSettingsCollection(backendSettingsCollection); + return this; + } + + public ApplicationGatewayImpl withHttpListeners(List httpListeners) { + this.innerModel().withHttpListeners(httpListeners); + return this; + } + + public ApplicationGatewayImpl withListeners(List listeners) { + this.innerModel().withListeners(listeners); + 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 withRoutingRules(List routingRules) { + this.innerModel().withRoutingRules(routingRules); + 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; + } + + public ApplicationGatewayImpl + withLoadDistributionPolicies(List loadDistributionPolicies) { + this.innerModel().withLoadDistributionPolicies(loadDistributionPolicies); + return this; + } + + public ApplicationGatewayImpl withGlobalConfiguration(ApplicationGatewayGlobalConfiguration globalConfiguration) { + this.innerModel().withGlobalConfiguration(globalConfiguration); + 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..e6648dc3f5e29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionImpl.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.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/ApplicationGatewayPrivateEndpointConnectionPropertiesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionPropertiesImpl.java new file mode 100644 index 0000000000000..159cc37224f3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionPropertiesImpl.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.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionPropertiesInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayPrivateEndpointConnectionProperties; +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 ApplicationGatewayPrivateEndpointConnectionPropertiesImpl + implements ApplicationGatewayPrivateEndpointConnectionProperties { + private ApplicationGatewayPrivateEndpointConnectionPropertiesInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayPrivateEndpointConnectionPropertiesImpl( + ApplicationGatewayPrivateEndpointConnectionPropertiesInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 ApplicationGatewayPrivateEndpointConnectionPropertiesInner 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..838b24f210176 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,974 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName, + String connectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName, + String connectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 the {@link SyncPoller} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate(String resourceGroupName, String applicationGatewayName, String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters) { + return this.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 the {@link SyncPoller} for polling of private Endpoint connection on an application gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ApplicationGatewayPrivateEndpointConnectionInner> + beginUpdate(String resourceGroupName, String applicationGatewayName, String connectionName, + ApplicationGatewayPrivateEndpointConnectionInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, + String applicationGatewayName, String connectionName) { + return getWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String applicationGatewayName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, applicationGatewayName, connectionName, 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) + public ApplicationGatewayPrivateEndpointConnectionInner get(String resourceGroupName, String applicationGatewayName, + String connectionName) { + return getWithResponse(resourceGroupName, applicationGatewayName, connectionName, Context.NONE).getValue(); + } + + /** + * 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateEndpointConnection API service call along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..f46f734d9e989 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateEndpointConnectionsImpl.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.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; + +public final class ApplicationGatewayPrivateEndpointConnectionsImpl + implements ApplicationGatewayPrivateEndpointConnections { + private static 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 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 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 PagedIterable list(String resourceGroupName, + String applicationGatewayName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, applicationGatewayName); + return ResourceManagerUtils.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 ResourceManagerUtils.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..e66d88a104cca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourceImpl.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.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..cb103d9ec395b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayPrivateLinkResourcesClientImpl.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGatewayPrivateLinkResources API service call along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..4d623c4e9bc1c --- /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; + +public final class ApplicationGatewayPrivateLinkResourcesImpl implements ApplicationGatewayPrivateLinkResources { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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..6ab9b5f21879c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaySslPredefinedPolicyImpl.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.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/ApplicationGatewayWafDynamicManifestResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestResultImpl.java new file mode 100644 index 0000000000000..3e50876b2e25d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestResultImpl.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.ApplicationGatewayWafDynamicManifestResultInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallManifestRuleSet; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifestResult; +import java.util.Collections; +import java.util.List; + +public final class ApplicationGatewayWafDynamicManifestResultImpl + implements ApplicationGatewayWafDynamicManifestResult { + private ApplicationGatewayWafDynamicManifestResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ApplicationGatewayWafDynamicManifestResultImpl(ApplicationGatewayWafDynamicManifestResultInner 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 List availableRuleSets() { + List inner = this.innerModel().availableRuleSets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String ruleSetType() { + return this.innerModel().ruleSetType(); + } + + public String ruleSetVersion() { + return this.innerModel().ruleSetVersion(); + } + + public ApplicationGatewayWafDynamicManifestResultInner 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/ApplicationGatewayWafDynamicManifestsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsClientImpl.java new file mode 100644 index 0000000000000..7b0ee4eacab04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsClientImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.network.generated.fluent.ApplicationGatewayWafDynamicManifestsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifestResultList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayWafDynamicManifestsClient. + */ +public final class ApplicationGatewayWafDynamicManifestsClientImpl + implements ApplicationGatewayWafDynamicManifestsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApplicationGatewayWafDynamicManifestsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewayWafDynamicManifestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewayWafDynamicManifestsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ApplicationGatewayWafDynamicManifestsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGatewayWafDynamicManifests to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ApplicationGatewayWafDynamicManifestsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@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> getNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(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 the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSinglePageAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get(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 the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync(String location) { + return new PagedFlux<>(() -> getSinglePageAsync(location), nextLink -> getNextSinglePageAsync(nextLink)); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAsync(String location, Context context) { + return new PagedFlux<>(() -> getSinglePageAsync(location, context), + nextLink -> getNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get(String location) { + return new PagedIterable<>(getAsync(location)); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable get(String location, Context context) { + return new PagedIterable<>(getAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayWafDynamicManifests API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getNextSinglePageAsync(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.getNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayWafDynamicManifests API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNextSinglePageAsync(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.getNext(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/ApplicationGatewayWafDynamicManifestsDefaultsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsClientImpl.java new file mode 100644 index 0000000000000..ec5f65a3c15be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsClientImpl.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.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.resourcemanager.network.generated.fluent.ApplicationGatewayWafDynamicManifestsDefaultsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ApplicationGatewayWafDynamicManifestsDefaultsClient. + */ +public final class ApplicationGatewayWafDynamicManifestsDefaultsClientImpl + implements ApplicationGatewayWafDynamicManifestsDefaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ApplicationGatewayWafDynamicManifestsDefaultsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ApplicationGatewayWafDynamicManifestsDefaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationGatewayWafDynamicManifestsDefaultsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ApplicationGatewayWafDynamicManifestsDefaultsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientApplicationGatewayWafDynamicManifestsDefaults + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ApplicationGatewayWafDynamicManifestsDefaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), location, apiVersion, + this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, + context); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location) { + return getWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, Context context) { + return getWithResponseAsync(location, context).block(); + } + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationGatewayWafDynamicManifestResultInner get(String location) { + return getWithResponse(location, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsImpl.java new file mode 100644 index 0000000000000..f7b863de6f761 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsDefaultsImpl.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.ApplicationGatewayWafDynamicManifestsDefaultsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifestResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifestsDefaults; + +public final class ApplicationGatewayWafDynamicManifestsDefaultsImpl + implements ApplicationGatewayWafDynamicManifestsDefaults { + private static final ClientLogger LOGGER + = new ClientLogger(ApplicationGatewayWafDynamicManifestsDefaultsImpl.class); + + private final ApplicationGatewayWafDynamicManifestsDefaultsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewayWafDynamicManifestsDefaultsImpl( + ApplicationGatewayWafDynamicManifestsDefaultsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, Context context) { + Response inner + = this.serviceClient().getWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApplicationGatewayWafDynamicManifestResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationGatewayWafDynamicManifestResult get(String location) { + ApplicationGatewayWafDynamicManifestResultInner inner = this.serviceClient().get(location); + if (inner != null) { + return new ApplicationGatewayWafDynamicManifestResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private ApplicationGatewayWafDynamicManifestsDefaultsClient 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/ApplicationGatewayWafDynamicManifestsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsImpl.java new file mode 100644 index 0000000000000..fdfb09e2d491c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewayWafDynamicManifestsImpl.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.ApplicationGatewayWafDynamicManifestsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifestResult; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayWafDynamicManifests; + +public final class ApplicationGatewayWafDynamicManifestsImpl implements ApplicationGatewayWafDynamicManifests { + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayWafDynamicManifestsImpl.class); + + private final ApplicationGatewayWafDynamicManifestsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ApplicationGatewayWafDynamicManifestsImpl(ApplicationGatewayWafDynamicManifestsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable get(String location) { + PagedIterable inner = this.serviceClient().get(location); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ApplicationGatewayWafDynamicManifestResultImpl(inner1, this.manager())); + } + + public PagedIterable get(String location, Context context) { + PagedIterable inner + = this.serviceClient().get(location, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ApplicationGatewayWafDynamicManifestResultImpl(inner1, this.manager())); + } + + private ApplicationGatewayWafDynamicManifestsClient 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/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..3aa3f0046f846 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysClientImpl.java @@ -0,0 +1,3093 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String applicationGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String applicationGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) { + return getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of application gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of application gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of application gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return this.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 the {@link SyncPoller} for polling of application gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String applicationGatewayName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, applicationGatewayName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String applicationGatewayName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, applicationGatewayName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the backend health of the specified application gateway in a + * resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the backend health of the specified application gateway in a + * resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationGatewayBackendHealthInner> + beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName) { + final String expand = null; + Mono>> mono + = backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthInner.class, + ApplicationGatewayBackendHealthInner.class, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the backend health of the specified application gateway in a + * resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the backend health of the specified application gateway in a + * resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName) { + final String expand = null; + return this.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 {@link SyncPoller} for polling of the backend health of the specified application gateway in a + * resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationGatewayBackendHealthInner> + beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context) { + return this.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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the backend health for given combination of backend pool and http + * setting of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the backend health for given combination of backend pool and http + * setting of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest) { + final String expand = null; + Mono>> mono + = backendHealthOnDemandWithResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthOnDemandInner.class, + ApplicationGatewayBackendHealthOnDemandInner.class, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the backend health for given combination of backend pool and http + * setting of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the backend health for given combination of backend pool and http + * setting of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand(String resourceGroupName, String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest) { + final String expand = null; + return this.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 {@link SyncPoller} for polling of the backend health for given combination of backend pool and http + * setting of the specified application gateway in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ApplicationGatewayBackendHealthOnDemandInner> + beginBackendHealthOnDemand(String resourceGroupName, String applicationGatewayName, + ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableServerVariablesAsync() { + return listAvailableServerVariablesWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableServerVariablesWithResponse(Context context) { + return listAvailableServerVariablesWithResponseAsync(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) + public List listAvailableServerVariables() { + return listAvailableServerVariablesWithResponse(Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableRequestHeadersAsync() { + return listAvailableRequestHeadersWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableRequestHeadersWithResponse(Context context) { + return listAvailableRequestHeadersWithResponseAsync(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) + public List listAvailableRequestHeaders() { + return listAvailableRequestHeadersWithResponse(Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAvailableResponseHeadersAsync() { + return listAvailableResponseHeadersWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listAvailableResponseHeadersWithResponse(Context context) { + return listAvailableResponseHeadersWithResponseAsync(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) + public List listAvailableResponseHeaders() { + return listAvailableResponseHeadersWithResponse(Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableWafRuleSetsAsync() { + return listAvailableWafRuleSetsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listAvailableWafRuleSetsWithResponse(Context context) { + return listAvailableWafRuleSetsWithResponseAsync(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) + public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() { + return listAvailableWafRuleSetsWithResponse(Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAvailableSslOptionsAsync() { + return listAvailableSslOptionsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAvailableSslOptionsWithResponse(Context context) { + return listAvailableSslOptionsWithResponseAsync(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) + public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() { + return listAvailableSslOptionsWithResponse(Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSslPredefinedPolicyAsync(String predefinedPolicyName) { + return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + getSslPredefinedPolicyWithResponse(String predefinedPolicyName, Context context) { + return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName, context).block(); + } + + /** + * 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 getSslPredefinedPolicyWithResponse(predefinedPolicyName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListApplicationGateways API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ApplicationGatewayAvailableSslOptions API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..c20ce727139a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationGatewaysImpl.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.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 java.util.Collections; +import java.util.List; + +public final class ApplicationGatewaysImpl implements ApplicationGateways { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.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) { + 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) { + 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 Response> listAvailableServerVariablesWithResponse(Context context) { + return this.serviceClient().listAvailableServerVariablesWithResponse(context); + } + + public List listAvailableServerVariables() { + List inner = this.serviceClient().listAvailableServerVariables(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableRequestHeadersWithResponse(Context context) { + return this.serviceClient().listAvailableRequestHeadersWithResponse(context); + } + + public List listAvailableRequestHeaders() { + List inner = this.serviceClient().listAvailableRequestHeaders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Response> listAvailableResponseHeadersWithResponse(Context context) { + return this.serviceClient().listAvailableResponseHeadersWithResponse(context); + } + + public List listAvailableResponseHeaders() { + List inner = this.serviceClient().listAvailableResponseHeaders(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 ApplicationGatewayAvailableWafRuleSetsResult listAvailableWafRuleSets() { + ApplicationGatewayAvailableWafRuleSetsResultInner inner = this.serviceClient().listAvailableWafRuleSets(); + if (inner != null) { + return new ApplicationGatewayAvailableWafRuleSetsResultImpl(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 ApplicationGatewayAvailableSslOptions listAvailableSslOptions() { + ApplicationGatewayAvailableSslOptionsInner inner = this.serviceClient().listAvailableSslOptions(); + if (inner != null) { + return new ApplicationGatewayAvailableSslOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAvailableSslPredefinedPolicies() { + PagedIterable inner + = this.serviceClient().listAvailableSslPredefinedPolicies(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listAvailableSslPredefinedPolicies(Context context) { + PagedIterable inner + = this.serviceClient().listAvailableSslPredefinedPolicies(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ApplicationGatewaySslPredefinedPolicyImpl(inner1, this.manager())); + } + + 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 ApplicationGatewaySslPredefinedPolicy getSslPredefinedPolicy(String predefinedPolicyName) { + ApplicationGatewaySslPredefinedPolicyInner inner + = this.serviceClient().getSslPredefinedPolicy(predefinedPolicyName); + if (inner != null) { + return new ApplicationGatewaySslPredefinedPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApplicationGateway getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationGatewayName = ResourceManagerUtils.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..6e35de46635cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupImpl.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.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 id() { + return this.innerModel().id(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.applicationSecurityGroupName + = ResourceManagerUtils.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..db7adc825ec2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsClientImpl.java @@ -0,0 +1,1221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String applicationSecurityGroupName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationSecurityGroupName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String applicationSecurityGroupName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, applicationSecurityGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String applicationSecurityGroupName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public ApplicationSecurityGroupInner getByResourceGroup(String resourceGroupName, + String applicationSecurityGroupName) { + return getByResourceGroupWithResponse(resourceGroupName, applicationSecurityGroupName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters) { + return this.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 the {@link SyncPoller} for polling of an application security group in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, + String applicationSecurityGroupName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, applicationSecurityGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String applicationSecurityGroupName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public ApplicationSecurityGroupInner updateTags(String resourceGroupName, String applicationSecurityGroupName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, applicationSecurityGroupName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of application security groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of application security groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of application security groups along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..7a6983738315e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ApplicationSecurityGroupsImpl.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.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; + +public final class ApplicationSecurityGroupsImpl implements ApplicationSecurityGroups { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationSecurityGroupImpl(inner1, this.manager())); + } + + public ApplicationSecurityGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName + = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName + = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName + = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String applicationSecurityGroupName + = ResourceManagerUtils.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..691e101ddafc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AutoApprovedPrivateLinkServiceImpl.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.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..65adf32a2807c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationImpl.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.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..02222e29fa284 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsClientImpl.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available delegations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..5afaa4c754776 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableDelegationsImpl.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.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; + +public final class AvailableDelegationsImpl implements AvailableDelegations { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableDelegationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.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..b6c497052a0e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesClientImpl.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListAvailableEndpointServices API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..a2dec40fbeb1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableEndpointServicesImpl.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.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; + +public final class AvailableEndpointServicesImpl implements AvailableEndpointServices { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointServiceResultImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.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..c5ca1c2dbf831 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypeImpl.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.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..d9d931a8b3d26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesClientImpl.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available PrivateEndpoint types along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..a41f9ea02933f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailablePrivateEndpointTypesImpl.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.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; + +public final class AvailablePrivateEndpointTypesImpl implements AvailablePrivateEndpointTypes { + private static 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 ResourceManagerUtils.mapPage(inner, + inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new AvailablePrivateEndpointTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String location, String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(location, resourceGroupName); + return ResourceManagerUtils.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 ResourceManagerUtils.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..365e73dd59aa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableProvidersListImpl.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.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..ed45b7178da7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available delegations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..7a4193006f6d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableResourceGroupDelegationsImpl.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.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; + +public final class AvailableResourceGroupDelegationsImpl implements AvailableResourceGroupDelegations { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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..0947ef541f458 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasImpl.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.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..213b76e4ba447 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesClientImpl.java @@ -0,0 +1,485 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of available service aliases along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..6a8e8e6f40c63 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AvailableServiceAliasesImpl.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.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; + +public final class AvailableServiceAliasesImpl implements AvailableServiceAliases { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AvailableServiceAliasImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String location) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, location); + return ResourceManagerUtils.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 ResourceManagerUtils.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..0cfcb14059075 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagImpl.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.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 String id() { + return this.innerModel().id(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String fqdnTagName() { + return this.innerModel().fqdnTagName(); + } + + 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..ea5f9128030a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewallFqdnTags API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..4c3851050626f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallFqdnTagsImpl.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.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; + +public final class AzureFirewallFqdnTagsImpl implements AzureFirewallFqdnTags { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new AzureFirewallFqdnTagImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.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..bb1767f138b19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallImpl.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.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.AzureFirewallAutoscaleConfiguration; +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.FirewallPacketCaptureParameters; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.IpPrefixesList; +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 String id() { + return this.innerModel().id(); + } + + 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 AzureFirewallAutoscaleConfiguration autoscaleConfiguration() { + return this.innerModel().autoscaleConfiguration(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.azureFirewallName = ResourceManagerUtils.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 IpPrefixesList listLearnedPrefixes() { + return serviceManager.azureFirewalls().listLearnedPrefixes(resourceGroupName, azureFirewallName); + } + + public IpPrefixesList listLearnedPrefixes(Context context) { + return serviceManager.azureFirewalls().listLearnedPrefixes(resourceGroupName, azureFirewallName, context); + } + + public void packetCapture(FirewallPacketCaptureParameters parameters) { + serviceManager.azureFirewalls().packetCapture(resourceGroupName, azureFirewallName, parameters); + } + + public void packetCapture(FirewallPacketCaptureParameters parameters, Context context) { + serviceManager.azureFirewalls().packetCapture(resourceGroupName, azureFirewallName, parameters, context); + } + + 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; + } + + public AzureFirewallImpl withAutoscaleConfiguration(AzureFirewallAutoscaleConfiguration autoscaleConfiguration) { + this.innerModel().withAutoscaleConfiguration(autoscaleConfiguration); + 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..c9bff8765a729 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsClientImpl.java @@ -0,0 +1,1758 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.fluent.models.IpPrefixesListInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallListResult; +import com.azure.resourcemanager.network.generated.models.FirewallPacketCaptureParameters; +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 { + /** + * 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") + public 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listLearnedPrefixes(@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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/packetCapture") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> packetCapture(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureFirewallName") String azureFirewallName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") FirewallPacketCaptureParameters parameters, + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String azureFirewallName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureFirewallName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String azureFirewallName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public AzureFirewallInner getByResourceGroup(String resourceGroupName, String azureFirewallName) { + return getByResourceGroupWithResponse(resourceGroupName, azureFirewallName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginCreateOrUpdate(String resourceGroupName, + String azureFirewallName, AzureFirewallInner parameters) { + return this.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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginCreateOrUpdate(String resourceGroupName, + String azureFirewallName, AzureFirewallInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginUpdateTags(String resourceGroupName, + String azureFirewallName, TagsObject parameters) { + return this.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 the {@link SyncPoller} for polling of azure Firewall resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureFirewallInner> beginUpdateTags(String resourceGroupName, + String azureFirewallName, TagsObject parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listLearnedPrefixesWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listLearnedPrefixes(this.client.getEndpoint(), resourceGroupName, + azureFirewallName, apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listLearnedPrefixesWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listLearnedPrefixes(this.client.getEndpoint(), resourceGroupName, azureFirewallName, apiVersion, + this.client.getSubscriptionId(), accept, context); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 {@link PollerFlux} for polling of list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpPrefixesListInner> + beginListLearnedPrefixesAsync(String resourceGroupName, String azureFirewallName) { + Mono>> mono + = listLearnedPrefixesWithResponseAsync(resourceGroupName, azureFirewallName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IpPrefixesListInner.class, IpPrefixesListInner.class, this.client.getContext()); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 {@link PollerFlux} for polling of list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IpPrefixesListInner> + beginListLearnedPrefixesAsync(String resourceGroupName, String azureFirewallName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = listLearnedPrefixesWithResponseAsync(resourceGroupName, azureFirewallName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + IpPrefixesListInner.class, IpPrefixesListInner.class, context); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 {@link SyncPoller} for polling of list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpPrefixesListInner> + beginListLearnedPrefixes(String resourceGroupName, String azureFirewallName) { + return this.beginListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).getSyncPoller(); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 {@link SyncPoller} for polling of list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpPrefixesListInner> + beginListLearnedPrefixes(String resourceGroupName, String azureFirewallName, Context context) { + return this.beginListLearnedPrefixesAsync(resourceGroupName, azureFirewallName, context).getSyncPoller(); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLearnedPrefixesAsync(String resourceGroupName, String azureFirewallName) { + return beginListLearnedPrefixesAsync(resourceGroupName, azureFirewallName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listLearnedPrefixesAsync(String resourceGroupName, String azureFirewallName, + Context context) { + return beginListLearnedPrefixesAsync(resourceGroupName, azureFirewallName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixesListInner listLearnedPrefixes(String resourceGroupName, String azureFirewallName) { + return listLearnedPrefixesAsync(resourceGroupName, azureFirewallName).block(); + } + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpPrefixesListInner listLearnedPrefixes(String resourceGroupName, String azureFirewallName, + Context context) { + return listLearnedPrefixesAsync(resourceGroupName, azureFirewallName, context).block(); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> packetCaptureWithResponseAsync(String resourceGroupName, + String azureFirewallName, FirewallPacketCaptureParameters 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.packetCapture(this.client.getEndpoint(), resourceGroupName, + azureFirewallName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> packetCaptureWithResponseAsync(String resourceGroupName, + String azureFirewallName, FirewallPacketCaptureParameters 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.packetCapture(this.client.getEndpoint(), resourceGroupName, azureFirewallName, apiVersion, + this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPacketCaptureAsync(String resourceGroupName, + String azureFirewallName, FirewallPacketCaptureParameters parameters) { + Mono>> mono + = packetCaptureWithResponseAsync(resourceGroupName, azureFirewallName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginPacketCaptureAsync(String resourceGroupName, + String azureFirewallName, FirewallPacketCaptureParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = packetCaptureWithResponseAsync(resourceGroupName, azureFirewallName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPacketCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters) { + return this.beginPacketCaptureAsync(resourceGroupName, azureFirewallName, parameters).getSyncPoller(); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPacketCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters, Context context) { + return this.beginPacketCaptureAsync(resourceGroupName, azureFirewallName, parameters, context).getSyncPoller(); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono packetCaptureAsync(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters) { + return beginPacketCaptureAsync(resourceGroupName, azureFirewallName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono packetCaptureAsync(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters, Context context) { + return beginPacketCaptureAsync(resourceGroupName, azureFirewallName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters) { + packetCaptureAsync(resourceGroupName, azureFirewallName, parameters).block(); + } + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters, Context context) { + packetCaptureAsync(resourceGroupName, azureFirewallName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureFirewalls API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..52ee39823774d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureFirewallsImpl.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.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.fluent.models.IpPrefixesListInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import com.azure.resourcemanager.network.generated.models.AzureFirewalls; +import com.azure.resourcemanager.network.generated.models.FirewallPacketCaptureParameters; +import com.azure.resourcemanager.network.generated.models.IpPrefixesList; + +public final class AzureFirewallsImpl implements AzureFirewalls { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureFirewallImpl(inner1, this.manager())); + } + + public IpPrefixesList listLearnedPrefixes(String resourceGroupName, String azureFirewallName) { + IpPrefixesListInner inner = this.serviceClient().listLearnedPrefixes(resourceGroupName, azureFirewallName); + if (inner != null) { + return new IpPrefixesListImpl(inner, this.manager()); + } else { + return null; + } + } + + public IpPrefixesList listLearnedPrefixes(String resourceGroupName, String azureFirewallName, Context context) { + IpPrefixesListInner inner + = this.serviceClient().listLearnedPrefixes(resourceGroupName, azureFirewallName, context); + if (inner != null) { + return new IpPrefixesListImpl(inner, this.manager()); + } else { + return null; + } + } + + public void packetCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters) { + this.serviceClient().packetCapture(resourceGroupName, azureFirewallName, parameters); + } + + public void packetCapture(String resourceGroupName, String azureFirewallName, + FirewallPacketCaptureParameters parameters, Context context) { + this.serviceClient().packetCapture(resourceGroupName, azureFirewallName, parameters, context); + } + + public AzureFirewall getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureFirewallName = ResourceManagerUtils.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..211bb0f35eec1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/AzureReachabilityReportImpl.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.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..6bccd107ddefa --- /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/BackendAddressInboundNatRulePortMappingsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressInboundNatRulePortMappingsImpl.java new file mode 100644 index 0000000000000..8f66f7077f3e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressInboundNatRulePortMappingsImpl.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.BackendAddressInboundNatRulePortMappingsInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressInboundNatRulePortMappings; +import com.azure.resourcemanager.network.generated.models.InboundNatRulePortMapping; +import java.util.Collections; +import java.util.List; + +public final class BackendAddressInboundNatRulePortMappingsImpl implements BackendAddressInboundNatRulePortMappings { + private BackendAddressInboundNatRulePortMappingsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BackendAddressInboundNatRulePortMappingsImpl(BackendAddressInboundNatRulePortMappingsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List inboundNatRulePortMappings() { + List inner = this.innerModel().inboundNatRulePortMappings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public BackendAddressInboundNatRulePortMappingsInner 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..be16cd2e08188 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BackendAddressPoolImpl.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.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 com.azure.resourcemanager.network.generated.models.SyncMode; +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 List inboundNatRules() { + List inner = this.innerModel().inboundNatRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer drainPeriodInSeconds() { + return this.innerModel().drainPeriodInSeconds(); + } + + public SubResource virtualNetwork() { + return this.innerModel().virtualNetwork(); + } + + public SyncMode syncMode() { + return this.innerModel().syncMode(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + this.backendAddressPoolName + = ResourceManagerUtils.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; + } + + public BackendAddressPoolImpl withDrainPeriodInSeconds(Integer drainPeriodInSeconds) { + this.innerModel().withDrainPeriodInSeconds(drainPeriodInSeconds); + return this; + } + + public BackendAddressPoolImpl withVirtualNetwork(SubResource virtualNetwork) { + this.innerModel().withVirtualNetwork(virtualNetwork); + return this; + } + + public BackendAddressPoolImpl withSyncMode(SyncMode syncMode) { + this.innerModel().withSyncMode(syncMode); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BaseAdminRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BaseAdminRuleImpl.java new file mode 100644 index 0000000000000..9520d9578f8a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BaseAdminRuleImpl.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.core.management.SystemData; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import com.azure.resourcemanager.network.generated.models.AdminRuleKind; +import com.azure.resourcemanager.network.generated.models.BaseAdminRule; + +public final class BaseAdminRuleImpl implements BaseAdminRule { + private BaseAdminRuleInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + BaseAdminRuleImpl(BaseAdminRuleInner 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 AdminRuleKind kind() { + return this.innerModel().kind(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BaseAdminRuleInner 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/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..02e520e9b6939 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionActiveSessionImpl.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.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..9221b8cd71256 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostImpl.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.management.Region; +import com.azure.core.management.SubResource; +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.BastionHostPropertiesFormatNetworkAcls; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Sku; +import com.azure.resourcemanager.network.generated.models.TagsObject; +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 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 Sku sku() { + return this.innerModel().sku(); + } + + public String id() { + return this.innerModel().id(); + } + + 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 SubResource virtualNetwork() { + return this.innerModel().virtualNetwork(); + } + + public BastionHostPropertiesFormatNetworkAcls networkAcls() { + return this.innerModel().networkAcls(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer scaleUnits() { + return this.innerModel().scaleUnits(); + } + + public Boolean disableCopyPaste() { + return this.innerModel().disableCopyPaste(); + } + + public Boolean enableFileCopy() { + return this.innerModel().enableFileCopy(); + } + + public Boolean enableIpConnect() { + return this.innerModel().enableIpConnect(); + } + + public Boolean enableShareableLink() { + return this.innerModel().enableShareableLink(); + } + + public Boolean enableTunneling() { + return this.innerModel().enableTunneling(); + } + + public Boolean enableKerberos() { + return this.innerModel().enableKerberos(); + } + + public Boolean enableSessionRecording() { + return this.innerModel().enableSessionRecording(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BastionHostInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String bastionHostname; + + private TagsObject updateParameters; + + 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() { + this.updateParameters = new TagsObject(); + return this; + } + + public BastionHost apply() { + this.innerObject = serviceManager.serviceClient() + .getBastionHosts() + .updateTags(resourceGroupName, bastionHostname, updateParameters, Context.NONE); + return this; + } + + public BastionHost apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getBastionHosts() + .updateTags(resourceGroupName, bastionHostname, updateParameters, context); + return this; + } + + BastionHostImpl(BastionHostInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.bastionHostname = ResourceManagerUtils.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) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public BastionHostImpl withZones(List zones) { + this.innerModel().withZones(zones); + 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; + } + + public BastionHostImpl withVirtualNetwork(SubResource virtualNetwork) { + this.innerModel().withVirtualNetwork(virtualNetwork); + return this; + } + + public BastionHostImpl withNetworkAcls(BastionHostPropertiesFormatNetworkAcls networkAcls) { + this.innerModel().withNetworkAcls(networkAcls); + return this; + } + + public BastionHostImpl withScaleUnits(Integer scaleUnits) { + this.innerModel().withScaleUnits(scaleUnits); + return this; + } + + public BastionHostImpl withDisableCopyPaste(Boolean disableCopyPaste) { + this.innerModel().withDisableCopyPaste(disableCopyPaste); + return this; + } + + public BastionHostImpl withEnableFileCopy(Boolean enableFileCopy) { + this.innerModel().withEnableFileCopy(enableFileCopy); + return this; + } + + public BastionHostImpl withEnableIpConnect(Boolean enableIpConnect) { + this.innerModel().withEnableIpConnect(enableIpConnect); + return this; + } + + public BastionHostImpl withEnableShareableLink(Boolean enableShareableLink) { + this.innerModel().withEnableShareableLink(enableShareableLink); + return this; + } + + public BastionHostImpl withEnableTunneling(Boolean enableTunneling) { + this.innerModel().withEnableTunneling(enableTunneling); + return this; + } + + public BastionHostImpl withEnableKerberos(Boolean enableKerberos) { + this.innerModel().withEnableKerberos(enableKerberos); + return this; + } + + public BastionHostImpl withEnableSessionRecording(Boolean enableSessionRecording) { + this.innerModel().withEnableSessionRecording(enableSessionRecording); + 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/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..782b90d044226 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsClientImpl.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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.BastionHostsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import com.azure.resourcemanager.network.generated.models.BastionHostListResult; +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 BastionHostsClient. + */ +public final class BastionHostsClientImpl implements BastionHostsClient { + /** + * 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") + public 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" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsObject 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String bastionHostname) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String bastionHostname, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String bastionHostname) { + return getByResourceGroupWithResponseAsync(resourceGroupName, bastionHostname) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String bastionHostname, + Context context) { + return getByResourceGroupWithResponseAsync(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) + public BastionHostInner getByResourceGroup(String resourceGroupName, String bastionHostname) { + return getByResourceGroupWithResponse(resourceGroupName, bastionHostname, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginCreateOrUpdate(String resourceGroupName, + String bastionHostname, BastionHostInner parameters) { + return this.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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginCreateOrUpdate(String resourceGroupName, + String bastionHostname, BastionHostInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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(); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync(String resourceGroupName, + String bastionHostname, 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 (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateTags(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, bastionHostname, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync(String resourceGroupName, + String bastionHostname, 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 (bastionHostname == null) { + return Mono + .error(new IllegalArgumentException("Parameter bastionHostname 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.updateTags(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + bastionHostname, apiVersion, parameters, accept, context); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 the {@link PollerFlux} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BastionHostInner> beginUpdateTagsAsync(String resourceGroupName, + String bastionHostname, TagsObject parameters) { + Mono>> mono + = updateTagsWithResponseAsync(resourceGroupName, bastionHostname, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BastionHostInner.class, BastionHostInner.class, this.client.getContext()); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 the {@link PollerFlux} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BastionHostInner> beginUpdateTagsAsync(String resourceGroupName, + String bastionHostname, TagsObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateTagsWithResponseAsync(resourceGroupName, bastionHostname, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + BastionHostInner.class, BastionHostInner.class, context); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginUpdateTags(String resourceGroupName, + String bastionHostname, TagsObject parameters) { + return this.beginUpdateTagsAsync(resourceGroupName, bastionHostname, parameters).getSyncPoller(); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 the {@link SyncPoller} for polling of bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BastionHostInner> beginUpdateTags(String resourceGroupName, + String bastionHostname, TagsObject parameters, Context context) { + return this.beginUpdateTagsAsync(resourceGroupName, bastionHostname, parameters, context).getSyncPoller(); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String bastionHostname, + TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, bastionHostname, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String bastionHostname, + TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, bastionHostname, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner updateTags(String resourceGroupName, String bastionHostname, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, bastionHostname, parameters).block(); + } + + /** + * Updates Tags for BastionHost resource. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param parameters Parameters supplied to update BastionHost 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 bastion Host resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BastionHostInner updateTags(String resourceGroupName, String bastionHostname, TagsObject parameters, + Context context) { + return updateTagsAsync(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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBastionHosts API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..93811a8696617 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionHostsImpl.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.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; + +public final class BastionHostsImpl implements BastionHosts { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BastionHostImpl(inner1, this.manager())); + } + + public BastionHost getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String bastionHostname = ResourceManagerUtils.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..2b5f89233f5b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionSessionStateImpl.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.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..a865a8e9bbd60 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BastionShareableLinkImpl.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.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..e9ddb3ba3a972 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpConnectionImpl.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.implementation; + +import com.azure.core.management.SubResource; +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 SubResource hubVirtualNetworkConnection() { + return this.innerModel().hubVirtualNetworkConnection(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public HubBgpConnectionStatus connectionState() { + return this.innerModel().connectionState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.connectionName = ResourceManagerUtils.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; + } + + public BgpConnectionImpl withHubVirtualNetworkConnection(SubResource hubVirtualNetworkConnection) { + this.innerModel().withHubVirtualNetworkConnection(hubVirtualNetworkConnection); + 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..c63fcba9f7da5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpPeerStatusListResultImpl.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.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..df3249c3f870a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..43286db39bc53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunitiesImpl.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.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; + +public final class BgpServiceCommunitiesImpl implements BgpServiceCommunities { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new BgpServiceCommunityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.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..a49702ab9af55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/BgpServiceCommunityImpl.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.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 id() { + return this.innerModel().id(); + } + + 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 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/ConfigurationPolicyGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConfigurationPolicyGroupsClientImpl.java new file mode 100644 index 0000000000000..7ec08d9b8d5a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConfigurationPolicyGroupsClientImpl.java @@ -0,0 +1,1011 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ConfigurationPolicyGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import com.azure.resourcemanager.network.generated.models.ListVpnServerConfigurationPolicyGroupsResult; +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 ConfigurationPolicyGroupsClient. + */ +public final class ConfigurationPolicyGroupsClientImpl implements ConfigurationPolicyGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConfigurationPolicyGroupsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationPolicyGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationPolicyGroupsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ConfigurationPolicyGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientConfigurationPolicyGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ConfigurationPolicyGroupsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @PathParam("configurationPolicyGroupName") String configurationPolicyGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}") + @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, + @PathParam("configurationPolicyGroupName") String configurationPolicyGroupName, + @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/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("vpnServerConfigurationName") String vpnServerConfigurationName, + @PathParam("configurationPolicyGroupName") String configurationPolicyGroupName, + @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/{vpnServerConfigurationName}/configurationPolicyGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnServerConfiguration( + @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("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVpnServerConfigurationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (configurationPolicyGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationPolicyGroupName is required and cannot be null.")); + } + if (vpnServerConfigurationPolicyGroupParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter vpnServerConfigurationPolicyGroupParameters is required and cannot be null.")); + } else { + vpnServerConfigurationPolicyGroupParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, apiVersion, + vpnServerConfigurationPolicyGroupParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, 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 (configurationPolicyGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationPolicyGroupName is required and cannot be null.")); + } + if (vpnServerConfigurationPolicyGroupParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter vpnServerConfigurationPolicyGroupParameters is required and cannot be null.")); + } else { + vpnServerConfigurationPolicyGroupParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vpnServerConfigurationName, configurationPolicyGroupName, apiVersion, + vpnServerConfigurationPolicyGroupParameters, accept, context); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VpnServerConfigurationPolicyGroupInner> + beginCreateOrUpdateAsync(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), VpnServerConfigurationPolicyGroupInner.class, + VpnServerConfigurationPolicyGroupInner.class, this.client.getContext()); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VpnServerConfigurationPolicyGroupInner> + beginCreateOrUpdateAsync(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, vpnServerConfigurationName, + configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), VpnServerConfigurationPolicyGroupInner.class, + VpnServerConfigurationPolicyGroupInner.class, context); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationPolicyGroupInner> + beginCreateOrUpdate(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters) + .getSyncPoller(); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationPolicyGroupInner> + beginCreateOrUpdate(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters, context) + .getSyncPoller(); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationPolicyGroupInner createOrUpdate(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters) { + return createOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters).block(); + } + + /** + * Creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationPolicyGroupParameters Parameters supplied to create or update a + * VpnServerConfiguration PolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationPolicyGroupInner createOrUpdate(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, + VpnServerConfigurationPolicyGroupInner vpnServerConfigurationPolicyGroupParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + vpnServerConfigurationPolicyGroupParameters, context).block(); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (configurationPolicyGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationPolicyGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vpnServerConfigurationName, configurationPolicyGroupName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, 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 (configurationPolicyGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationPolicyGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vpnServerConfigurationName, configurationPolicyGroupName, apiVersion, accept, context); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, vpnServerConfigurationName, + configurationPolicyGroupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName) { + return this.beginDeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName) + .getSyncPoller(); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, context) + .getSyncPoller(); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, + String configurationPolicyGroupName) { + deleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName).block(); + } + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, String configurationPolicyGroupName, + Context context) { + deleteAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, context).block(); + } + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (configurationPolicyGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationPolicyGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vpnServerConfigurationName, configurationPolicyGroupName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, 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 (configurationPolicyGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter configurationPolicyGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vpnServerConfigurationName, configurationPolicyGroupName, apiVersion, accept, context); + } + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName) { + return getWithResponseAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + context).block(); + } + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnServerConfigurationPolicyGroupInner get(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName) { + return getWithResponse(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + Context.NONE).getValue(); + } + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByVpnServerConfigurationSinglePageAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByVpnServerConfiguration(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, vpnServerConfigurationName, 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 configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVpnServerConfigurationSinglePageAsync( + 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVpnServerConfiguration(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vpnServerConfigurationName, apiVersion, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux + listByVpnServerConfigurationAsync(String resourceGroupName, String vpnServerConfigurationName) { + return new PagedFlux<>( + () -> listByVpnServerConfigurationSinglePageAsync(resourceGroupName, vpnServerConfigurationName), + nextLink -> listByVpnServerConfigurationNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVpnServerConfigurationAsync( + String resourceGroupName, String vpnServerConfigurationName, Context context) { + return new PagedFlux<>( + () -> listByVpnServerConfigurationSinglePageAsync(resourceGroupName, vpnServerConfigurationName, context), + nextLink -> listByVpnServerConfigurationNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName) { + return new PagedIterable<>(listByVpnServerConfigurationAsync(resourceGroupName, vpnServerConfigurationName)); + } + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName, Context context) { + return new PagedIterable<>( + listByVpnServerConfigurationAsync(resourceGroupName, vpnServerConfigurationName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnServerConfigurationPolicyGroups along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByVpnServerConfigurationNextSinglePageAsync(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.listByVpnServerConfigurationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 VpnServerConfigurationPolicyGroups along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByVpnServerConfigurationNextSinglePageAsync(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.listByVpnServerConfigurationNext(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/ConfigurationPolicyGroupsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConfigurationPolicyGroupsImpl.java new file mode 100644 index 0000000000000..304e0c1037ed0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConfigurationPolicyGroupsImpl.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.ConfigurationPolicyGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import com.azure.resourcemanager.network.generated.models.ConfigurationPolicyGroups; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroup; + +public final class ConfigurationPolicyGroupsImpl implements ConfigurationPolicyGroups { + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationPolicyGroupsImpl.class); + + private final ConfigurationPolicyGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ConfigurationPolicyGroupsImpl(ConfigurationPolicyGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName) { + this.serviceClient().delete(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName); + } + + public void delete(String resourceGroupName, String vpnServerConfigurationName, String configurationPolicyGroupName, + Context context) { + this.serviceClient() + .delete(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, context); + } + + public Response getWithResponse(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new VpnServerConfigurationPolicyGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VpnServerConfigurationPolicyGroup get(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName) { + VpnServerConfigurationPolicyGroupInner inner + = this.serviceClient().get(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName); + if (inner != null) { + return new VpnServerConfigurationPolicyGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName) { + PagedIterable inner + = this.serviceClient().listByVpnServerConfiguration(resourceGroupName, vpnServerConfigurationName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new VpnServerConfigurationPolicyGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName, Context context) { + PagedIterable inner + = this.serviceClient().listByVpnServerConfiguration(resourceGroupName, vpnServerConfigurationName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new VpnServerConfigurationPolicyGroupImpl(inner1, this.manager())); + } + + public VpnServerConfigurationPolicyGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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))); + } + String configurationPolicyGroupName + = ResourceManagerUtils.getValueFromIdByName(id, "configurationPolicyGroups"); + if (configurationPolicyGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'configurationPolicyGroups'.", id))); + } + return this + .getWithResponse(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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))); + } + String configurationPolicyGroupName + = ResourceManagerUtils.getValueFromIdByName(id, "configurationPolicyGroups"); + if (configurationPolicyGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'configurationPolicyGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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))); + } + String configurationPolicyGroupName + = ResourceManagerUtils.getValueFromIdByName(id, "configurationPolicyGroups"); + if (configurationPolicyGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'configurationPolicyGroups'.", id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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))); + } + String configurationPolicyGroupName + = ResourceManagerUtils.getValueFromIdByName(id, "configurationPolicyGroups"); + if (configurationPolicyGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'configurationPolicyGroups'.", id))); + } + this.delete(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, context); + } + + private ConfigurationPolicyGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public VpnServerConfigurationPolicyGroupImpl define(String name) { + return new VpnServerConfigurationPolicyGroupImpl(name, this.manager()); + } +} 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..f902a452ca74b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorQueryResultImpl.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.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..7f2a2bf0517bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorResultImpl.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + this.connectionMonitorName = ResourceManagerUtils.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..6d3f41543ca7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsClientImpl.java @@ -0,0 +1,1853 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectionMonitorResultInner> beginCreateOrUpdateAsync( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, + ConnectionMonitor parameters) { + final String migrate = null; + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, + connectionMonitorName, parameters, migrate); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConnectionMonitorResultInner.class, ConnectionMonitorResultInner.class, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, + ConnectionMonitor parameters) { + final String migrate = null; + return this + .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 the {@link SyncPoller} for polling of information about the connection monitor. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorResultInner> beginCreateOrUpdate( + String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitor parameters, + String migrate, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkWatcherName, + String connectionMonitorName) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, Context context) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, 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) + public ConnectionMonitorResultInner get(String resourceGroupName, String networkWatcherName, + String connectionMonitorName) { + return getWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName, + String connectionMonitorName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 updateTagsWithResponse(resourceGroupName, networkWatcherName, connectionMonitorName, parameters, + Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String networkWatcherName, + String connectionMonitorName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String networkWatcherName, + String connectionMonitorName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorQueryResultInner> + beginQuery(String resourceGroupName, String networkWatcherName, String connectionMonitorName) { + return this.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 the {@link SyncPoller} for polling of list of connection states snapshots. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionMonitorQueryResultInner> + beginQuery(String resourceGroupName, String networkWatcherName, String connectionMonitorName, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..f0308e6c0df1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionMonitorsImpl.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.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; + +public final class ConnectionMonitorsImpl implements ConnectionMonitors { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectionMonitorResultImpl(inner1, this.manager())); + } + + public ConnectionMonitorResult getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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..a17eb5f230da3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionResetSharedKeyImpl.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.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..07e0269c15daa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyImpl.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.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/ConnectionSharedKeyResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyResultImpl.java new file mode 100644 index 0000000000000..73b05f167fff5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectionSharedKeyResultImpl.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.ConnectionSharedKeyResultInner; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKeyResult; +import com.azure.resourcemanager.network.generated.models.SharedKeyProperties; + +public final class ConnectionSharedKeyResultImpl implements ConnectionSharedKeyResult { + private ConnectionSharedKeyResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ConnectionSharedKeyResultImpl(ConnectionSharedKeyResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public SharedKeyProperties properties() { + return this.innerModel().properties(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ConnectionSharedKeyResultInner 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/ConnectivityConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationImpl.java new file mode 100644 index 0000000000000..576a5a0a3772e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationImpl.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ConnectivityConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectivityGroupItem; +import com.azure.resourcemanager.network.generated.models.ConnectivityTopology; +import com.azure.resourcemanager.network.generated.models.DeleteExistingPeering; +import com.azure.resourcemanager.network.generated.models.Hub; +import com.azure.resourcemanager.network.generated.models.IsGlobal; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ConnectivityConfigurationImpl + implements ConnectivityConfiguration, ConnectivityConfiguration.Definition, ConnectivityConfiguration.Update { + private ConnectivityConfigurationInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public ConnectivityTopology connectivityTopology() { + return this.innerModel().connectivityTopology(); + } + + public List hubs() { + List inner = this.innerModel().hubs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IsGlobal isGlobal() { + return this.innerModel().isGlobal(); + } + + public List appliesToGroups() { + List inner = this.innerModel().appliesToGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public DeleteExistingPeering deleteExistingPeering() { + return this.innerModel().deleteExistingPeering(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConnectivityConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + public ConnectivityConfigurationImpl withExistingNetworkManager(String resourceGroupName, + String networkManagerName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + return this; + } + + public ConnectivityConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getConnectivityConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ConnectivityConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnectivityConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + ConnectivityConfigurationImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ConnectivityConfigurationInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public ConnectivityConfigurationImpl update() { + return this; + } + + public ConnectivityConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getConnectivityConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ConnectivityConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnectivityConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + ConnectivityConfigurationImpl(ConnectivityConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connectivityConfigurations"); + } + + public ConnectivityConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getConnectivityConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public ConnectivityConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnectivityConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, context) + .getValue(); + return this; + } + + public ConnectivityConfigurationImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public ConnectivityConfigurationImpl withConnectivityTopology(ConnectivityTopology connectivityTopology) { + this.innerModel().withConnectivityTopology(connectivityTopology); + return this; + } + + public ConnectivityConfigurationImpl withHubs(List hubs) { + this.innerModel().withHubs(hubs); + return this; + } + + public ConnectivityConfigurationImpl withIsGlobal(IsGlobal isGlobal) { + this.innerModel().withIsGlobal(isGlobal); + return this; + } + + public ConnectivityConfigurationImpl withAppliesToGroups(List appliesToGroups) { + this.innerModel().withAppliesToGroups(appliesToGroups); + return this; + } + + public ConnectivityConfigurationImpl withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering) { + this.innerModel().withDeleteExistingPeering(deleteExistingPeering); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsClientImpl.java new file mode 100644 index 0000000000000..272c56c2dfb68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsClientImpl.java @@ -0,0 +1,992 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ConnectivityConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ConnectivityConfigurationListResult; +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 ConnectivityConfigurationsClient. + */ +public final class ConnectivityConfigurationsClientImpl implements ConnectivityConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConnectivityConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ConnectivityConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectivityConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ConnectivityConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientConnectivityConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ConnectivityConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") ConnectivityConfigurationInner connectivityConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, accept, context); + } + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, context).block(); + } + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectivityConfigurationInner get(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + /** + * Creates/Updates a new network manager connectivity configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param connectivityConfiguration Parameters supplied to create/update a network manager connectivity + * 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 network manager connectivity configuration resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, ConnectivityConfigurationInner connectivityConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (connectivityConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter connectivityConfiguration is required and cannot be null.")); + } else { + connectivityConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + connectivityConfiguration, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates/Updates a new network manager connectivity configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param connectivityConfiguration Parameters supplied to create/update a network manager connectivity + * 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 network manager connectivity configuration resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, ConnectivityConfigurationInner connectivityConfiguration, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (connectivityConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter connectivityConfiguration is required and cannot be null.")); + } else { + connectivityConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, connectivityConfiguration, accept, context); + } + + /** + * Creates/Updates a new network manager connectivity configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param connectivityConfiguration Parameters supplied to create/update a network manager connectivity + * 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 network manager connectivity configuration resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String networkManagerName, String configurationName, ConnectivityConfigurationInner connectivityConfiguration) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + connectivityConfiguration).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates/Updates a new network manager connectivity configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param connectivityConfiguration Parameters supplied to create/update a network manager connectivity + * 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 network manager connectivity configuration resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, ConnectivityConfigurationInner connectivityConfiguration, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + connectivityConfiguration, context).block(); + } + + /** + * Creates/Updates a new network manager connectivity configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param connectivityConfiguration Parameters supplied to create/update a network manager connectivity + * 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 network manager connectivity configuration resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectivityConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, ConnectivityConfigurationInner connectivityConfiguration) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, + connectivityConfiguration, Context.NONE).getValue(); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, force, accept, context); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).getSyncPoller(); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context) + .getSyncPoller(); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 networkManagerName, String configurationName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, force).block(); + } + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).block(); + } + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, top, skipToken, accept, context)) + .>map(res -> new 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 network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken)); + } + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list network manager connectivity configurations along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 manager connectivity configurations along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsImpl.java new file mode 100644 index 0000000000000..47034c8b33a15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityConfigurationsImpl.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.ConnectivityConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ConnectivityConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectivityConfigurations; + +public final class ConnectivityConfigurationsImpl implements ConnectivityConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityConfigurationsImpl.class); + + private final ConnectivityConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ConnectivityConfigurationsImpl(ConnectivityConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectivityConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConnectivityConfiguration get(String resourceGroupName, String networkManagerName, + String configurationName) { + ConnectivityConfigurationInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, configurationName); + if (inner != null) { + return new ConnectivityConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectivityConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectivityConfigurationImpl(inner1, this.manager())); + } + + public ConnectivityConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "connectivityConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'connectivityConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "connectivityConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'connectivityConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "connectivityConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'connectivityConfigurations'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "connectivityConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'connectivityConfigurations'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + private ConnectivityConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ConnectivityConfigurationImpl define(String name) { + return new ConnectivityConfigurationImpl(name, this.manager()); + } +} 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..d98a9cdd98e92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ConnectivityInformationImpl.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.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..d904d20ead3d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixImpl.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.CustomIpPrefixType; +import com.azure.resourcemanager.network.generated.models.ExtendedLocation; +import com.azure.resourcemanager.network.generated.models.Geo; +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 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 id() { + return this.innerModel().id(); + } + + public String asn() { + return this.innerModel().asn(); + } + + public String cidr() { + return this.innerModel().cidr(); + } + + public String signedMessage() { + return this.innerModel().signedMessage(); + } + + public String authorizationMessage() { + return this.innerModel().authorizationMessage(); + } + + public SubResource customIpPrefixParent() { + return this.innerModel().customIpPrefixParent(); + } + + public List childCustomIpPrefixes() { + List inner = this.innerModel().childCustomIpPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CommissionedState commissionedState() { + return this.innerModel().commissionedState(); + } + + public Boolean expressRouteAdvertise() { + return this.innerModel().expressRouteAdvertise(); + } + + public Geo geo() { + return this.innerModel().geo(); + } + + public Boolean noInternetAdvertise() { + return this.innerModel().noInternetAdvertise(); + } + + public CustomIpPrefixType prefixType() { + return this.innerModel().prefixType(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.customIpPrefixName = ResourceManagerUtils.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 withAsn(String asn) { + this.innerModel().withAsn(asn); + 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(SubResource customIpPrefixParent) { + this.innerModel().withCustomIpPrefixParent(customIpPrefixParent); + return this; + } + + public CustomIpPrefixImpl withCommissionedState(CommissionedState commissionedState) { + this.innerModel().withCommissionedState(commissionedState); + return this; + } + + public CustomIpPrefixImpl withExpressRouteAdvertise(Boolean expressRouteAdvertise) { + this.innerModel().withExpressRouteAdvertise(expressRouteAdvertise); + return this; + } + + public CustomIpPrefixImpl withGeo(Geo geo) { + this.innerModel().withGeo(geo); + return this; + } + + public CustomIpPrefixImpl withNoInternetAdvertise(Boolean noInternetAdvertise) { + this.innerModel().withNoInternetAdvertise(noInternetAdvertise); + return this; + } + + public CustomIpPrefixImpl withPrefixType(CustomIpPrefixType prefixType) { + this.innerModel().withPrefixType(prefixType); + 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..61e6acf2dc603 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String customIpPrefixName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String customIpPrefixName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String customIpPrefixName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, customIpPrefixName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String customIpPrefixName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, customIpPrefixName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, customIpPrefixName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomIpPrefixInner> + beginCreateOrUpdate(String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters) { + return this.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 the {@link SyncPoller} for polling of custom IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String customIpPrefixName, CustomIpPrefixInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String customIpPrefixName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, customIpPrefixName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String customIpPrefixName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public CustomIpPrefixInner updateTags(String resourceGroupName, String customIpPrefixName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, customIpPrefixName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListCustomIpPrefixes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListCustomIpPrefixes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListCustomIpPrefixes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..3e0963ecf6be8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/CustomIpPrefixesImpl.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.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; + +public final class CustomIpPrefixesImpl implements CustomIpPrefixes { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomIpPrefixImpl(inner1, this.manager())); + } + + public CustomIpPrefix getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String customIpPrefixName = ResourceManagerUtils.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..5345006f91f36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesClientImpl.java @@ -0,0 +1,822 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosCustomPolicyName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosCustomPolicyName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ddosCustomPolicyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosCustomPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String ddosCustomPolicyName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public DdosCustomPolicyInner getByResourceGroup(String resourceGroupName, String ddosCustomPolicyName) { + return getByResourceGroupWithResponse(resourceGroupName, ddosCustomPolicyName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosCustomPolicyInner> + beginCreateOrUpdate(String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters) { + return this.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 the {@link SyncPoller} for polling of a DDoS custom policy in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosCustomPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String ddosCustomPolicyName, DdosCustomPolicyInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String ddosCustomPolicyName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, ddosCustomPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String ddosCustomPolicyName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public DdosCustomPolicyInner updateTags(String resourceGroupName, String ddosCustomPolicyName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, ddosCustomPolicyName, parameters, Context.NONE).getValue(); + } +} 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..1d6aaacf95bff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPoliciesImpl.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.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; + +public final class DdosCustomPoliciesImpl implements DdosCustomPolicies { + private static 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 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 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 DdosCustomPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosCustomPolicyName = ResourceManagerUtils.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..82798a848e859 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosCustomPolicyImpl.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.implementation; + +import com.azure.core.management.Region; +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.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import java.util.Collections; +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 id() { + return this.innerModel().id(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosCustomPolicyName = ResourceManagerUtils.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; + } + } + + 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..6c93dd5bac2bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlanImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 publicIpAddresses() { + List inner = this.innerModel().publicIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ddosProtectionPlanName + = ResourceManagerUtils.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..db00693da7c37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansClientImpl.java @@ -0,0 +1,1209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosProtectionPlanName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ddosProtectionPlanName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String ddosProtectionPlanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ddosProtectionPlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String ddosProtectionPlanName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public DdosProtectionPlanInner getByResourceGroup(String resourceGroupName, String ddosProtectionPlanName) { + return getByResourceGroupWithResponse(resourceGroupName, ddosProtectionPlanName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters) { + return this.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 the {@link SyncPoller} for polling of a DDoS protection plan in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DdosProtectionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String ddosProtectionPlanName, DdosProtectionPlanInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String ddosProtectionPlanName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, ddosProtectionPlanName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String ddosProtectionPlanName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public DdosProtectionPlanInner updateTags(String resourceGroupName, String ddosProtectionPlanName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, ddosProtectionPlanName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of DDoS protection plans along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..148059b4b64bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DdosProtectionPlansImpl.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.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; + +public final class DdosProtectionPlansImpl implements DdosProtectionPlans { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DdosProtectionPlanImpl(inner1, this.manager())); + } + + public DdosProtectionPlan getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ddosProtectionPlanName = ResourceManagerUtils.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..cbac1a895f01f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesClientImpl.java @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkSecurityGroupName, + String defaultSecurityRuleName) { + return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkSecurityGroupName, + String defaultSecurityRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, context) + .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getWithResponse(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityRule API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..ddfedcf8ef476 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DefaultSecurityRulesImpl.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.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; + +public final class DefaultSecurityRulesImpl implements DefaultSecurityRules { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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..d5aef722dd2e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DnsNameAvailabilityResultImpl.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.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..004648bb3e7ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationImpl.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.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.QosDefinition; +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 String id() { + return this.innerModel().id(); + } + + 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 List qosDefinitionCollection() { + List inner = this.innerModel().qosDefinitionCollection(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.dscpConfigurationName = ResourceManagerUtils.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; + } + + public DscpConfigurationImpl withQosDefinitionCollection(List qosDefinitionCollection) { + this.innerModel().withQosDefinitionCollection(qosDefinitionCollection); + 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..29778567f2a1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsClientImpl.java @@ -0,0 +1,1055 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 differentiated Services Code Point configuration for any given network interface along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 differentiated Services Code Point configuration for any given network interface along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of differentiated Services Code Point configuration for any given + * network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of differentiated Services Code Point configuration for any given + * network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of differentiated Services Code Point configuration for any given + * network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DscpConfigurationInner> + beginCreateOrUpdate(String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters) { + return this.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 the {@link SyncPoller} for polling of differentiated Services Code Point configuration for any given + * network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DscpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String dscpConfigurationName, DscpConfigurationInner parameters, Context context) { + return this.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 differentiated Services Code Point configuration for any given network interface on successful completion + * of {@link Mono}. + */ + @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 differentiated Services Code Point configuration for any given network interface on successful completion + * of {@link Mono}. + */ + @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 differentiated Services Code Point configuration for any given network interface. + */ + @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 differentiated Services Code Point configuration for any given network interface. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dscpConfigurationName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String dscpConfigurationName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String dscpConfigurationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, dscpConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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. + * @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 getByResourceGroupWithResponse(resourceGroupName, dscpConfigurationName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the DscpConfigurationList API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..195c328aae12f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/DscpConfigurationsImpl.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.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; + +public final class DscpConfigurationsImpl implements DscpConfigurations { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DscpConfigurationImpl(inner1, this.manager())); + } + + public DscpConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String dscpConfigurationName = ResourceManagerUtils.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..5e9472f4a463e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveNetworkSecurityGroupListResultImpl.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.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..94ea8fab6b0f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteListResultImpl.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.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/EffectiveRouteMapRouteListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteMapRouteListImpl.java new file mode 100644 index 0000000000000..835d74fe0d659 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EffectiveRouteMapRouteListImpl.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.EffectiveRouteMapRouteListInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteMapRoute; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteMapRouteList; +import java.util.Collections; +import java.util.List; + +public final class EffectiveRouteMapRouteListImpl implements EffectiveRouteMapRouteList { + private EffectiveRouteMapRouteListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + EffectiveRouteMapRouteListImpl(EffectiveRouteMapRouteListInner 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 EffectiveRouteMapRouteListInner 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..c4f76962457e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/EndpointServiceResultImpl.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.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..15832e7205fe0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationImpl.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.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 String connectionResourceUri() { + return this.innerModel().connectionResourceUri(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.authorizationName = ResourceManagerUtils.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..35cb97fa27ce2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsClientImpl.java @@ -0,0 +1,961 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, + String authorizationName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, + String authorizationName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String circuitName, + String authorizationName) { + return getWithResponseAsync(resourceGroupName, circuitName, authorizationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String circuitName, + String authorizationName, Context context) { + return getWithResponseAsync(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) + public ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, + String authorizationName) { + return getWithResponse(resourceGroupName, circuitName, authorizationName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return this.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 the {@link SyncPoller} for polling of authorization in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitAuthorizationInner> + beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, + ExpressRouteCircuitAuthorizationInner authorizationParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAuthorizations API service call retrieves all authorizations that belongs to an + * ExpressRouteCircuit along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..d869c02c9d3ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitAuthorizationsImpl.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.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; + +public final class ExpressRouteCircuitAuthorizationsImpl implements ExpressRouteCircuitAuthorizations { + private static 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 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 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 PagedIterable list(String resourceGroupName, String circuitName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, circuitName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteCircuitAuthorizationImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitAuthorization getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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..b8118735beb45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "peerings"); + this.connectionName = ResourceManagerUtils.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..60b0a8508c05d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsClientImpl.java @@ -0,0 +1,1039 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, + String peeringName, String connectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, + String peeringName, String connectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String circuitName, + String peeringName, String connectionName) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @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 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 getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters) { + return this + .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 the {@link SyncPoller} for polling of express Route Circuit Connection in an ExpressRouteCircuitPeering + * resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, String connectionName, + ExpressRouteCircuitConnectionInner expressRouteCircuitConnectionParameters, Context context) { + return this + .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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated + * response with {@link PagedFlux}. + */ + @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 as paginated + * response with {@link PagedFlux}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListConnections API service call retrieves all global reach connections that belongs to a + * Private Peering for an ExpressRouteCircuit along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..9776d13a1f197 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitConnectionsImpl.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.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; + +public final class ExpressRouteCircuitConnectionsImpl implements ExpressRouteCircuitConnections { + private static 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 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 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 PagedIterable list(String resourceGroupName, String circuitName, + String peeringName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, circuitName, peeringName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteCircuitConnectionImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.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..cfa06d0ca65b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 authorizationKey() { + return this.innerModel().authorizationKey(); + } + + public String authorizationStatus() { + return this.innerModel().authorizationStatus(); + } + + public Boolean enableDirectPortRateLimit() { + return this.innerModel().enableDirectPortRateLimit(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = ResourceManagerUtils.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; + } + + public ExpressRouteCircuitImpl withAuthorizationKey(String authorizationKey) { + this.innerModel().withAuthorizationKey(authorizationKey); + return this; + } + + public ExpressRouteCircuitImpl withEnableDirectPortRateLimit(Boolean enableDirectPortRateLimit) { + this.innerModel().withEnableDirectPortRateLimit(enableDirectPortRateLimit); + 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..b85db8b843618 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.circuitName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "expressRouteCircuits"); + this.peeringName = ResourceManagerUtils.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/ExpressRouteCircuitPeeringPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringPropertiesFormatImpl.java new file mode 100644 index 0000000000000..974ae28c86561 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringPropertiesFormatImpl.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.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringPropertiesFormatInner; +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.ExpressRouteCircuitPeeringConfig; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringPropertiesFormat; +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 ExpressRouteCircuitPeeringPropertiesFormatImpl + implements ExpressRouteCircuitPeeringPropertiesFormat { + private ExpressRouteCircuitPeeringPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteCircuitPeeringPropertiesFormatImpl(ExpressRouteCircuitPeeringPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 ExpressRouteCircuitPeeringPropertiesFormatInner 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/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..b8b088defcafa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsClientImpl.java @@ -0,0 +1,935 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, + String peeringName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, + String peeringName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String circuitName, + String peeringName) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String circuitName, + String peeringName, Context context) { + return getWithResponseAsync(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) + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) { + return getWithResponse(resourceGroupName, circuitName, peeringName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters) { + return this.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 the {@link SyncPoller} for polling of peering in an ExpressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, String peeringName, + ExpressRouteCircuitPeeringInner peeringParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..80c7a7d261047 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitPeeringsImpl.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.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; + +public final class ExpressRouteCircuitPeeringsImpl implements ExpressRouteCircuitPeerings { + private static 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 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 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 PagedIterable list(String resourceGroupName, String circuitName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, circuitName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteCircuitPeeringImpl(inner1, this.manager())); + } + + public ExpressRouteCircuitPeering getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.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..21cf7f00d1fbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitStatsImpl.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.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..c877e75b0a193 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsArpTableListResultImpl.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.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..42d341dbf53d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsClientImpl.java @@ -0,0 +1,2291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String circuitName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String circuitName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, circuitName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String circuitName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public ExpressRouteCircuitInner getByResourceGroup(String resourceGroupName, String circuitName) { + return getByResourceGroupWithResponse(resourceGroupName, circuitName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitInner> + beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return this.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 the {@link SyncPoller} for polling of expressRouteCircuit resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCircuitInner> beginCreateOrUpdate( + String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String circuitName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, circuitName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String circuitName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public ExpressRouteCircuitInner updateTags(String resourceGroupName, String circuitName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, circuitName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the currently advertised ARP table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the currently advertised ARP table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return this.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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath, + Context context) { + return this.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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the currently advertised routes table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the currently advertised routes table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return this.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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath, + Context context) { + return this.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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the currently advertised routes table summary associated with the + * express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the currently advertised routes table summary associated with the + * express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 {@link SyncPoller} for polling of the currently advertised routes table summary associated with the + * express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, + String devicePath) { + return this.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 {@link SyncPoller} for polling of the currently advertised routes table summary associated with the + * express route circuit in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStatsAsync(String resourceGroupName, String circuitName) { + return getStatsWithResponseAsync(resourceGroupName, circuitName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStatsWithResponse(String resourceGroupName, String circuitName, + Context context) { + return getStatsWithResponseAsync(resourceGroupName, circuitName, 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) + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) { + return getStatsWithResponse(resourceGroupName, circuitName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPeeringStatsAsync(String resourceGroupName, String circuitName, + String peeringName) { + return getPeeringStatsWithResponseAsync(resourceGroupName, circuitName, peeringName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPeeringStatsWithResponse(String resourceGroupName, + String circuitName, String peeringName, Context context) { + return getPeeringStatsWithResponseAsync(resourceGroupName, circuitName, peeringName, 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) + public ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, + String peeringName) { + return getPeeringStatsWithResponse(resourceGroupName, circuitName, peeringName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCircuit API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..0e72a2ac386bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsImpl.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.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; + +public final class ExpressRouteCircuitsImpl implements ExpressRouteCircuits { + private static 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 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 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 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 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 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRouteCircuitImpl(inner1, this.manager())); + } + + public ExpressRouteCircuit getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String circuitName = ResourceManagerUtils.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..554043da456e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCircuitsRoutesTableListResultImpl.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.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..e1163f604fc3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionImpl.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.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 Boolean enablePrivateLinkFastPath() { + return this.innerModel().enablePrivateLinkFastPath(); + } + + 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..6a2176d62bb71 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionListImpl.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.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..27f77598a5c2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsClientImpl.java @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String expressRouteGatewayName, String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters) { + return this + .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 the {@link SyncPoller} for polling of expressRouteConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String expressRouteGatewayName, String connectionName, + ExpressRouteConnectionInner putExpressRouteConnectionParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String expressRouteGatewayName, + String connectionName) { + return getWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String expressRouteGatewayName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, expressRouteGatewayName, connectionName, 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) + public ExpressRouteConnectionInner get(String resourceGroupName, String expressRouteGatewayName, + String connectionName) { + return getWithResponse(resourceGroupName, expressRouteGatewayName, connectionName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRouteGatewayName, + String connectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRouteGatewayName, + String connectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String expressRouteGatewayName) { + return listWithResponseAsync(resourceGroupName, expressRouteGatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String expressRouteGatewayName, Context context) { + return listWithResponseAsync(resourceGroupName, expressRouteGatewayName, 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) + public ExpressRouteConnectionListInner list(String resourceGroupName, String expressRouteGatewayName) { + return listWithResponse(resourceGroupName, expressRouteGatewayName, Context.NONE).getValue(); + } +} 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..6ae552c9d9de0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteConnectionsImpl.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.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; + +public final class ExpressRouteConnectionsImpl implements ExpressRouteConnections { + private static 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 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 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 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 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; + } + } + + 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; + } + } + + 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..82ae26df5bda1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.crossConnectionName + = ResourceManagerUtils.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..0ba707b68d9b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringImpl.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.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..6fe407ef52e09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java @@ -0,0 +1,970 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String crossConnectionName, + String peeringName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String crossConnectionName, + String peeringName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String crossConnectionName, + String peeringName) { + return getWithResponseAsync(resourceGroupName, crossConnectionName, peeringName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String crossConnectionName, String peeringName, Context context) { + return getWithResponseAsync(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) + public ExpressRouteCrossConnectionPeeringInner get(String resourceGroupName, String crossConnectionName, + String peeringName) { + return getWithResponse(resourceGroupName, crossConnectionName, peeringName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters) { + return this.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 the {@link SyncPoller} for polling of peering in an ExpressRoute Cross Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionPeeringInner> + beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, String peeringName, + ExpressRouteCrossConnectionPeeringInner peeringParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPeering API service call retrieves all peerings that belong to an + * ExpressRouteCrossConnection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..4bfee714a2de0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionPeeringsImpl.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.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; + +public final class ExpressRouteCrossConnectionPeeringsImpl implements ExpressRouteCrossConnectionPeerings { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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 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 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 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..5862658b668ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsClientImpl.java @@ -0,0 +1,1903 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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, + @QueryParam("$filter") String filter, @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. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=name eq + * '{circuitServiceKey}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + filter, accept, context)) + .>map(res -> new 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 filter The filter to apply on the operation. For example, you can use $filter=name eq + * '{circuitServiceKey}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, 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. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=name eq + * '{circuitServiceKey}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=name eq + * '{circuitServiceKey}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=name eq + * '{circuitServiceKey}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String crossConnectionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String crossConnectionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, crossConnectionName, context).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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, crossConnectionName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, + ExpressRouteCrossConnectionInner parameters) { + return this.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 the {@link SyncPoller} for polling of expressRouteCrossConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteCrossConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String crossConnectionName, + ExpressRouteCrossConnectionInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String crossConnectionName, + TagsObject crossConnectionParameters) { + return updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String crossConnectionName, TagsObject crossConnectionParameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, crossConnectionName, crossConnectionParameters, 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) + public ExpressRouteCrossConnectionInner updateTags(String resourceGroupName, String crossConnectionName, + TagsObject crossConnectionParameters) { + return updateTagsWithResponse(resourceGroupName, crossConnectionName, crossConnectionParameters, Context.NONE) + .getValue(); + } + + /** + * 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 + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the currently advertised ARP table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the currently advertised ARP table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) { + return this.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 {@link SyncPoller} for polling of the currently advertised ARP table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsArpTableListResultInner> + beginListArpTable(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath, + Context context) { + return this.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 + * on successful completion of {@link Mono}. + */ + @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 + * on successful completion of {@link Mono}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the route table summary associated with the express route cross + * connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the route table summary associated with the express route cross + * connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 {@link SyncPoller} for polling of the route table summary associated with the express route cross + * connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, + String devicePath) { + return this.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 {@link SyncPoller} for polling of the route table summary associated with the express route cross + * connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner> + beginListRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, + String devicePath, Context context) { + return this + .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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the currently advertised routes table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the currently advertised routes table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, + String devicePath) { + return this.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 {@link SyncPoller} for polling of the currently advertised routes table associated with the express + * route cross connection in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ExpressRouteCircuitsRoutesTableListResultInner> + beginListRoutesTable(String resourceGroupName, String crossConnectionName, String peeringName, + String devicePath, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteCrossConnection API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..9395dcba286f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteCrossConnectionsImpl.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.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; + +public final class ExpressRouteCrossConnectionsImpl implements ExpressRouteCrossConnections { + private static 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 ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteCrossConnectionImpl(inner1, this.manager())); + } + + 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 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 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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String crossConnectionName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String crossConnectionName = ResourceManagerUtils.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..553d3595bcc52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Boolean allowNonVirtualWanTraffic() { + return this.innerModel().allowNonVirtualWanTraffic(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRouteGatewayName + = ResourceManagerUtils.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 + withExpressRouteConnections(List expressRouteConnections) { + this.innerModel().withExpressRouteConnections(expressRouteConnections); + return this; + } + + public ExpressRouteGatewayImpl withVirtualHub(VirtualHubId virtualHub) { + this.innerModel().withVirtualHub(virtualHub); + return this; + } + + public ExpressRouteGatewayImpl withAllowNonVirtualWanTraffic(Boolean allowNonVirtualWanTraffic) { + this.innerModel().withAllowNonVirtualWanTraffic(allowNonVirtualWanTraffic); + 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..a0390f97ee27a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewayListImpl.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.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..03970cb3d9e89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysClientImpl.java @@ -0,0 +1,1163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listBySubscriptionAsync() { + return listBySubscriptionWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBySubscriptionWithResponse(Context context) { + return listBySubscriptionWithResponseAsync(context).block(); + } + + /** + * 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 listBySubscriptionWithResponse(Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByResourceGroupWithResponse(String resourceGroupName, + Context context) { + return listByResourceGroupWithResponseAsync(resourceGroupName, 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) + public ExpressRouteGatewayListInner listByResourceGroup(String resourceGroupName) { + return listByResourceGroupWithResponse(resourceGroupName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters) { + return this + .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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String expressRouteGatewayName, + ExpressRouteGatewayInner putExpressRouteGatewayParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters) { + return this.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 the {@link SyncPoller} for polling of expressRoute gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRouteGatewayInner> beginUpdateTags( + String resourceGroupName, String expressRouteGatewayName, TagsObject expressRouteGatewayParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String expressRouteGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRouteGatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String expressRouteGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRouteGatewayName, 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) + public ExpressRouteGatewayInner getByResourceGroup(String resourceGroupName, String expressRouteGatewayName) { + return getByResourceGroupWithResponse(resourceGroupName, expressRouteGatewayName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRouteGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRouteGatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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..1c50391004dbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteGatewaysImpl.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.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; + +public final class ExpressRouteGatewaysImpl implements ExpressRouteGateways { + private static 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 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 listBySubscription() { + ExpressRouteGatewayListInner inner = this.serviceClient().listBySubscription(); + 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 ExpressRouteGatewayList listByResourceGroup(String resourceGroupName) { + ExpressRouteGatewayListInner inner = this.serviceClient().listByResourceGroup(resourceGroupName); + if (inner != null) { + return new ExpressRouteGatewayListImpl(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 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 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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRouteGatewayName = ResourceManagerUtils.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..c50f01c80e621 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinkImpl.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.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 String coloLocation() { + return this.innerModel().coloLocation(); + } + + 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..e0a430fab8014 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksClientImpl.java @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String expressRoutePortName, + String linkName) { + return getWithResponseAsync(resourceGroupName, expressRoutePortName, linkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String expressRoutePortName, + String linkName, Context context) { + return getWithResponseAsync(resourceGroupName, expressRoutePortName, linkName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteLinkInner get(String resourceGroupName, String expressRoutePortName, String linkName) { + return getWithResponse(resourceGroupName, expressRoutePortName, linkName, Context.NONE).getValue(); + } + + /** + * 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 expressRouteLink List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRouteLink List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRouteLink List Result as paginated response with {@link PagedFlux}. + */ + @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 expressRouteLink List Result as paginated response with {@link PagedFlux}. + */ + @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 expressRouteLink List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRouteLink List Result as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteLink List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..1fd00530d8afe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteLinksImpl.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.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; + +public final class ExpressRouteLinksImpl implements ExpressRouteLinks { + private static 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 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 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 PagedIterable list(String resourceGroupName, String expressRoutePortName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, expressRoutePortName); + return ResourceManagerUtils.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 ResourceManagerUtils.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/ExpressRoutePortAuthorizationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationImpl.java new file mode 100644 index 0000000000000..6a9ddf8bc6d87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorization; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizationUseStatus; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class ExpressRoutePortAuthorizationImpl implements ExpressRoutePortAuthorization, + ExpressRoutePortAuthorization.Definition, ExpressRoutePortAuthorization.Update { + private ExpressRoutePortAuthorizationInner 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 ExpressRoutePortAuthorizationUseStatus authorizationUseStatus() { + return this.innerModel().authorizationUseStatus(); + } + + public String circuitResourceUri() { + return this.innerModel().circuitResourceUri(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ExpressRoutePortAuthorizationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String expressRoutePortName; + + private String authorizationName; + + public ExpressRoutePortAuthorizationImpl withExistingExpressRoutePort(String resourceGroupName, + String expressRoutePortName) { + this.resourceGroupName = resourceGroupName; + this.expressRoutePortName = expressRoutePortName; + return this; + } + + public ExpressRoutePortAuthorization create() { + this.innerObject = serviceManager.serviceClient() + .getExpressRoutePortAuthorizations() + .createOrUpdate(resourceGroupName, expressRoutePortName, authorizationName, this.innerModel(), + Context.NONE); + return this; + } + + public ExpressRoutePortAuthorization create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExpressRoutePortAuthorizations() + .createOrUpdate(resourceGroupName, expressRoutePortName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRoutePortAuthorizationImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ExpressRoutePortAuthorizationInner(); + this.serviceManager = serviceManager; + this.authorizationName = name; + } + + public ExpressRoutePortAuthorizationImpl update() { + return this; + } + + public ExpressRoutePortAuthorization apply() { + this.innerObject = serviceManager.serviceClient() + .getExpressRoutePortAuthorizations() + .createOrUpdate(resourceGroupName, expressRoutePortName, authorizationName, this.innerModel(), + Context.NONE); + return this; + } + + public ExpressRoutePortAuthorization apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExpressRoutePortAuthorizations() + .createOrUpdate(resourceGroupName, expressRoutePortName, authorizationName, this.innerModel(), context); + return this; + } + + ExpressRoutePortAuthorizationImpl(ExpressRoutePortAuthorizationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRoutePortName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "expressRoutePorts"); + this.authorizationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "authorizations"); + } + + public ExpressRoutePortAuthorization refresh() { + this.innerObject = serviceManager.serviceClient() + .getExpressRoutePortAuthorizations() + .getWithResponse(resourceGroupName, expressRoutePortName, authorizationName, Context.NONE) + .getValue(); + return this; + } + + public ExpressRoutePortAuthorization refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExpressRoutePortAuthorizations() + .getWithResponse(resourceGroupName, expressRoutePortName, authorizationName, context) + .getValue(); + return this; + } + + public ExpressRoutePortAuthorizationImpl withName(String name) { + this.innerModel().withName(name); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsClientImpl.java new file mode 100644 index 0000000000000..b619429023c5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsClientImpl.java @@ -0,0 +1,980 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizationListResult; +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 ExpressRoutePortAuthorizationsClient. + */ +public final class ExpressRoutePortAuthorizationsClientImpl implements ExpressRoutePortAuthorizationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ExpressRoutePortAuthorizationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRoutePortAuthorizationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRoutePortAuthorizationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ExpressRoutePortAuthorizationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRoutePortAuthorizations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ExpressRoutePortAuthorizationsService { + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @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/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @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/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @PathParam("authorizationName") String authorizationName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ExpressRoutePortAuthorizationInner authorizationParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("expressRoutePortName") String expressRoutePortName, + @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 port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String expressRoutePortName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, expressRoutePortName, + 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 port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String expressRoutePortName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, expressRoutePortName, authorizationName, + apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String expressRoutePortName, + String authorizationName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, expressRoutePortName, authorizationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String expressRoutePortName, + String authorizationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, expressRoutePortName, authorizationName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName, + String authorizationName) { + return this.beginDeleteAsync(resourceGroupName, expressRoutePortName, authorizationName).getSyncPoller(); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName, + String authorizationName, Context context) { + return this.beginDeleteAsync(resourceGroupName, expressRoutePortName, authorizationName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String expressRoutePortName, String authorizationName) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName, authorizationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String expressRoutePortName, String authorizationName, + Context context) { + return beginDeleteAsync(resourceGroupName, expressRoutePortName, authorizationName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 expressRoutePortName, String authorizationName) { + deleteAsync(resourceGroupName, expressRoutePortName, authorizationName).block(); + } + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 expressRoutePortName, String authorizationName, + Context context) { + deleteAsync(resourceGroupName, expressRoutePortName, authorizationName, context).block(); + } + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String expressRoutePortName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, expressRoutePortName, + 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 port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String expressRoutePortName, 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, expressRoutePortName, authorizationName, + apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String expressRoutePortName, + String authorizationName) { + return getWithResponseAsync(resourceGroupName, expressRoutePortName, authorizationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String expressRoutePortName, String authorizationName, Context context) { + return getWithResponseAsync(resourceGroupName, expressRoutePortName, authorizationName, context).block(); + } + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortAuthorizationInner get(String resourceGroupName, String expressRoutePortName, + String authorizationName) { + return getWithResponse(resourceGroupName, expressRoutePortName, authorizationName, Context.NONE).getValue(); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + expressRoutePortName, 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 port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner 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 (expressRoutePortName == null) { + return Mono + .error(new IllegalArgumentException("Parameter expressRoutePortName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, expressRoutePortName, + authorizationName, apiVersion, this.client.getSubscriptionId(), authorizationParameters, accept, context); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 the {@link PollerFlux} for polling of expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExpressRoutePortAuthorizationInner> + beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, expressRoutePortName, + authorizationName, authorizationParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ExpressRoutePortAuthorizationInner.class, + ExpressRoutePortAuthorizationInner.class, this.client.getContext()); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 the {@link PollerFlux} for polling of expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExpressRoutePortAuthorizationInner> + beginCreateOrUpdateAsync(String resourceGroupName, String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, expressRoutePortName, + authorizationName, authorizationParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ExpressRoutePortAuthorizationInner.class, + ExpressRoutePortAuthorizationInner.class, context); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 the {@link SyncPoller} for polling of expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortAuthorizationInner> + beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, + authorizationParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 the {@link SyncPoller} for polling of expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortAuthorizationInner> + beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, + authorizationParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, + authorizationParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String expressRoutePortName, String authorizationName, + ExpressRoutePortAuthorizationInner authorizationParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, + authorizationParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortAuthorizationInner createOrUpdate(String resourceGroupName, String expressRoutePortName, + String authorizationName, ExpressRoutePortAuthorizationInner authorizationParameters) { + return createOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters) + .block(); + } + + /** + * Creates or updates an authorization in the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create or update express route port 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 expressRoute Port Authorization. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortAuthorizationInner createOrUpdate(String resourceGroupName, String expressRoutePortName, + String authorizationName, ExpressRoutePortAuthorizationInner authorizationParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters, + context).block(); + } + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 port along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 (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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, expressRoutePortName, + 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 port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 port along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 (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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceGroupName, expressRoutePortName, 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 port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 port as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String expressRoutePortName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, expressRoutePortName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 port as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String expressRoutePortName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, expressRoutePortName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 port as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String expressRoutePortName) { + return new PagedIterable<>(listAsync(resourceGroupName, expressRoutePortName)); + } + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 port as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port Authorization List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Port Authorization List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsImpl.java new file mode 100644 index 0000000000000..0f88672d6727a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortAuthorizationsImpl.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.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.ExpressRoutePortAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorization; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortAuthorizations; + +public final class ExpressRoutePortAuthorizationsImpl implements ExpressRoutePortAuthorizations { + private static final ClientLogger LOGGER = new ClientLogger(ExpressRoutePortAuthorizationsImpl.class); + + private final ExpressRoutePortAuthorizationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRoutePortAuthorizationsImpl(ExpressRoutePortAuthorizationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String expressRoutePortName, String authorizationName) { + this.serviceClient().delete(resourceGroupName, expressRoutePortName, authorizationName); + } + + public void delete(String resourceGroupName, String expressRoutePortName, String authorizationName, + Context context) { + this.serviceClient().delete(resourceGroupName, expressRoutePortName, authorizationName, context); + } + + public Response getWithResponse(String resourceGroupName, + String expressRoutePortName, String authorizationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, expressRoutePortName, authorizationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExpressRoutePortAuthorizationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRoutePortAuthorization get(String resourceGroupName, String expressRoutePortName, + String authorizationName) { + ExpressRoutePortAuthorizationInner inner + = this.serviceClient().get(resourceGroupName, expressRoutePortName, authorizationName); + if (inner != null) { + return new ExpressRoutePortAuthorizationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String expressRoutePortName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, expressRoutePortName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRoutePortAuthorizationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String expressRoutePortName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, expressRoutePortName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRoutePortAuthorizationImpl(inner1, this.manager())); + } + + public ExpressRoutePortAuthorization getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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))); + } + String authorizationName = ResourceManagerUtils.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, expressRoutePortName, authorizationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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))); + } + String authorizationName = ResourceManagerUtils.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, expressRoutePortName, authorizationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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))); + } + String authorizationName = ResourceManagerUtils.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, expressRoutePortName, authorizationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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))); + } + String authorizationName = ResourceManagerUtils.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, expressRoutePortName, authorizationName, context); + } + + private ExpressRoutePortAuthorizationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ExpressRoutePortAuthorizationImpl define(String name) { + return new ExpressRoutePortAuthorizationImpl(name, this.manager()); + } +} 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..957422b46eb4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortImpl.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.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.ExpressRoutePortsBillingType; +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 id() { + return this.innerModel().id(); + } + + 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 ExpressRoutePortsBillingType billingType() { + return this.innerModel().billingType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.expressRoutePortName = ResourceManagerUtils.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; + } + + public ExpressRoutePortImpl withBillingType(ExpressRoutePortsBillingType billingType) { + this.innerModel().withBillingType(billingType); + 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..e819a00877925 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsClientImpl.java @@ -0,0 +1,1350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String expressRoutePortName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRoute Port on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, expressRoutePortName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 expressRoute Port along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String expressRoutePortName, Context context) { + return getByResourceGroupWithResponseAsync(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 expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) { + return getByResourceGroupWithResponse(resourceGroupName, expressRoutePortName, Context.NONE).getValue(); + } + + /** + * 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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortInner> + beginCreateOrUpdate(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) { + return this.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 the {@link SyncPoller} for polling of expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExpressRoutePortInner> beginCreateOrUpdate( + String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters, Context context) { + return this.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 expressRoute Port on successful completion of {@link Mono}. + */ + @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 expressRoute Port on successful completion of {@link Mono}. + */ + @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 expressRoute Port. + */ + @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 expressRoute Port. + */ + @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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRoute Port along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRoute Port on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String expressRoutePortName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, expressRoutePortName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 expressRoute Port along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String expressRoutePortName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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 expressRoute Port. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortInner updateTags(String resourceGroupName, String expressRoutePortName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, expressRoutePortName, parameters, Context.NONE).getValue(); + } + + /** + * 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 expressRoute Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 expressRoute Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 expressRoute Port List Result as paginated response with {@link PagedFlux}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoute Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 expressRoute Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 expressRoute Port List Result as paginated response with {@link PagedFlux}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedFlux}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateLoaAsync(String resourceGroupName, + String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request) { + return generateLoaWithResponseAsync(resourceGroupName, expressRoutePortName, request) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response generateLoaWithResponse(String resourceGroupName, + String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request, Context context) { + return generateLoaWithResponseAsync(resourceGroupName, expressRoutePortName, request, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 generateLoaWithResponse(resourceGroupName, expressRoutePortName, request, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoute Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Port List Result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..bb430d9411c6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsImpl.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.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; + +public final class ExpressRoutePortsImpl implements ExpressRoutePorts { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRoutePortImpl(inner1, this.manager())); + } + + 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 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 ExpressRoutePort getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String expressRoutePortName = ResourceManagerUtils.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..615dda271fd81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationImpl.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.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 id() { + return this.innerModel().id(); + } + + 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 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..61a94507c3359 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsClientImpl.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.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 expressRoutePorts Location List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 expressRoutePorts Location List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 expressRoutePorts Location List Result as paginated response with {@link PagedFlux}. + */ + @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 expressRoutePorts Location List Result as paginated response with {@link PagedFlux}. + */ + @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 expressRoutePorts Location List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoutePorts Location List Result as paginated response with {@link PagedIterable}. + */ + @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 expressRoutePorts Peering Location along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRoutePorts Peering Location along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 expressRoutePorts Peering Location on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String locationName) { + return getWithResponseAsync(locationName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 expressRoutePorts Peering Location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String locationName, Context context) { + return getWithResponseAsync(locationName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRoutePortsLocationInner get(String locationName) { + return getWithResponse(locationName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Location List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Location List Result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..b667cc8d7864c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRoutePortsLocationsImpl.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.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; + +public final class ExpressRoutePortsLocationsImpl implements ExpressRoutePortsLocations { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExpressRoutePortsLocationImpl(inner1, this.manager())); + } + + 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; + } + } + + public ExpressRoutePortsLocation get(String locationName) { + ExpressRoutePortsLocationInner inner = this.serviceClient().get(locationName); + if (inner != null) { + return new ExpressRoutePortsLocationImpl(inner, 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/ExpressRouteProviderPortImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortImpl.java new file mode 100644 index 0000000000000..8a8eb79297259 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortImpl.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.implementation; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteProviderPort; +import java.util.Collections; +import java.util.Map; + +public final class ExpressRouteProviderPortImpl implements ExpressRouteProviderPort { + private ExpressRouteProviderPortInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteProviderPortImpl(ExpressRouteProviderPortInner 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 id() { + return this.innerModel().id(); + } + + public String portPairDescriptor() { + return this.innerModel().portPairDescriptor(); + } + + public String primaryAzurePort() { + return this.innerModel().primaryAzurePort(); + } + + public String secondaryAzurePort() { + return this.innerModel().secondaryAzurePort(); + } + + public String peeringLocation() { + return this.innerModel().peeringLocation(); + } + + public Integer overprovisionFactor() { + return this.innerModel().overprovisionFactor(); + } + + public Integer portBandwidthInMbps() { + return this.innerModel().portBandwidthInMbps(); + } + + public Integer usedBandwidthInMbps() { + return this.innerModel().usedBandwidthInMbps(); + } + + public Integer remainingBandwidthInMbps() { + return this.innerModel().remainingBandwidthInMbps(); + } + + public ExpressRouteProviderPortInner 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/ExpressRouteProviderPortListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortListResultImpl.java new file mode 100644 index 0000000000000..a40ef9586a3ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortListResultImpl.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.ExpressRouteProviderPortInner; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteProviderPort; +import com.azure.resourcemanager.network.generated.models.ExpressRouteProviderPortListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ExpressRouteProviderPortListResultImpl implements ExpressRouteProviderPortListResult { + private ExpressRouteProviderPortListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ExpressRouteProviderPortListResultImpl(ExpressRouteProviderPortListResultInner 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 ExpressRouteProviderPortImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ExpressRouteProviderPortListResultInner 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/ExpressRouteProviderPortsLocationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsClientImpl.java new file mode 100644 index 0000000000000..8f7d057bcd270 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsClientImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.network.generated.fluent.ExpressRouteProviderPortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortListResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExpressRouteProviderPortsLocationsClient. + */ +public final class ExpressRouteProviderPortsLocationsClientImpl implements ExpressRouteProviderPortsLocationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ExpressRouteProviderPortsLocationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ExpressRouteProviderPortsLocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExpressRouteProviderPortsLocationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ExpressRouteProviderPortsLocationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientExpressRouteProviderPortsLocations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ExpressRouteProviderPortsLocationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves all the ExpressRouteProviderPorts in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=location eq '{state}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteProviderPort API service call along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + filter, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves all the ExpressRouteProviderPorts in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=location eq '{state}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteProviderPort API service call along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String filter, + 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, + context); + } + + /** + * Retrieves all the ExpressRouteProviderPorts 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 ListExpressRouteProviderPort API service call on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + final String filter = null; + return listWithResponseAsync(filter).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves all the ExpressRouteProviderPorts in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=location eq '{state}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteProviderPort API service call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String filter, Context context) { + return listWithResponseAsync(filter, context).block(); + } + + /** + * Retrieves all the ExpressRouteProviderPorts 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 ListExpressRouteProviderPort API service call. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteProviderPortListResultInner list() { + final String filter = null; + return listWithResponse(filter, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsImpl.java new file mode 100644 index 0000000000000..8ee6f5b939af2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteProviderPortsLocationsImpl.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.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.ExpressRouteProviderPortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortListResultInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteProviderPortListResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteProviderPortsLocations; + +public final class ExpressRouteProviderPortsLocationsImpl implements ExpressRouteProviderPortsLocations { + private static final ClientLogger LOGGER = new ClientLogger(ExpressRouteProviderPortsLocationsImpl.class); + + private final ExpressRouteProviderPortsLocationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ExpressRouteProviderPortsLocationsImpl(ExpressRouteProviderPortsLocationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String filter, Context context) { + Response inner + = this.serviceClient().listWithResponse(filter, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExpressRouteProviderPortListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteProviderPortListResult list() { + ExpressRouteProviderPortListResultInner inner = this.serviceClient().list(); + if (inner != null) { + return new ExpressRouteProviderPortListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private ExpressRouteProviderPortsLocationsClient 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..344ece57f8284 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProviderImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 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..4871a85de7005 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ExpressRouteServiceProvidersClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..80fe27419ac7b --- /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; + +public final class ExpressRouteServiceProvidersImpl implements ExpressRouteServiceProviders { + private static 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 ResourceManagerUtils.mapPage(inner, + inner1 -> new ExpressRouteServiceProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.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..74a06320b78e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesClientImpl.java @@ -0,0 +1,1199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 FirewallPoliciesClient. + */ +public final class FirewallPoliciesClientImpl implements FirewallPoliciesClient { + /** + * 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") + public 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" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, @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/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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String firewallPolicyName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String firewallPolicyName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String firewallPolicyName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, firewallPolicyName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String firewallPolicyName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, firewallPolicyName, expand, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, firewallPolicyName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyInner> + beginCreateOrUpdate(String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters) { + return this.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 the {@link SyncPoller} for polling of firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String firewallPolicyName, FirewallPolicyInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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(); + } + + /** + * Updates tags of a Azure Firewall Policy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to update Azure Firewall 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 firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync(String resourceGroupName, + String firewallPolicyName, 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 (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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags of a Azure Firewall Policy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to update Azure Firewall 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 firewallPolicy Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync(String resourceGroupName, + String firewallPolicyName, 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 (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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.updateTags(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, apiVersion, + this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Updates tags of a Azure Firewall Policy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to update Azure Firewall 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 firewallPolicy Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String firewallPolicyName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, firewallPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates tags of a Azure Firewall Policy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to update Azure Firewall 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 firewallPolicy Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String firewallPolicyName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, firewallPolicyName, parameters, context).block(); + } + + /** + * Updates tags of a Azure Firewall Policy resource. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Parameters supplied to update Azure Firewall 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 firewallPolicy Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyInner updateTags(String resourceGroupName, String firewallPolicyName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, firewallPolicyName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicies API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..e194ec7376b6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPoliciesImpl.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.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; + +public final class FirewallPoliciesImpl implements FirewallPolicies { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallPolicyImpl(inner1, this.manager())); + } + + public FirewallPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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/FirewallPolicyDeploymentsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDeploymentsClientImpl.java new file mode 100644 index 0000000000000..e043399e55a8f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDeploymentsClientImpl.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.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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyDeploymentsClient; +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 FirewallPolicyDeploymentsClient. + */ +public final class FirewallPolicyDeploymentsClientImpl implements FirewallPolicyDeploymentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FirewallPolicyDeploymentsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyDeploymentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyDeploymentsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FirewallPolicyDeploymentsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyDeployments to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface FirewallPolicyDeploymentsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/deploy") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deploy(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deployWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deploy(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deployWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deploy(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeployAsync(String resourceGroupName, String firewallPolicyName) { + Mono>> mono = deployWithResponseAsync(resourceGroupName, firewallPolicyName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeployAsync(String resourceGroupName, String firewallPolicyName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deployWithResponseAsync(resourceGroupName, firewallPolicyName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeploy(String resourceGroupName, String firewallPolicyName) { + return this.beginDeployAsync(resourceGroupName, firewallPolicyName).getSyncPoller(); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeploy(String resourceGroupName, String firewallPolicyName, + Context context) { + return this.beginDeployAsync(resourceGroupName, firewallPolicyName, context).getSyncPoller(); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deployAsync(String resourceGroupName, String firewallPolicyName) { + return beginDeployAsync(resourceGroupName, firewallPolicyName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deployAsync(String resourceGroupName, String firewallPolicyName, Context context) { + return beginDeployAsync(resourceGroupName, firewallPolicyName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 deploy(String resourceGroupName, String firewallPolicyName) { + deployAsync(resourceGroupName, firewallPolicyName).block(); + } + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 deploy(String resourceGroupName, String firewallPolicyName, Context context) { + deployAsync(resourceGroupName, firewallPolicyName, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDeploymentsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDeploymentsImpl.java new file mode 100644 index 0000000000000..9750b823d8732 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDeploymentsImpl.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.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyDeploymentsClient; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyDeployments; + +public final class FirewallPolicyDeploymentsImpl implements FirewallPolicyDeployments { + private static final ClientLogger LOGGER = new ClientLogger(FirewallPolicyDeploymentsImpl.class); + + private final FirewallPolicyDeploymentsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyDeploymentsImpl(FirewallPolicyDeploymentsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deploy(String resourceGroupName, String firewallPolicyName) { + this.serviceClient().deploy(resourceGroupName, firewallPolicyName); + } + + public void deploy(String resourceGroupName, String firewallPolicyName, Context context) { + this.serviceClient().deploy(resourceGroupName, firewallPolicyName, context); + } + + private FirewallPolicyDeploymentsClient 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/FirewallPolicyDraftImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftImpl.java new file mode 100644 index 0000000000000..987958d537867 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftImpl.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.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyDraftInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyDraft; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import java.util.Collections; +import java.util.Map; + +public final class FirewallPolicyDraftImpl implements FirewallPolicyDraft { + private FirewallPolicyDraftInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FirewallPolicyDraftImpl(FirewallPolicyDraftInner 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 id() { + return this.innerModel().id(); + } + + public SubResource basePolicy() { + return this.innerModel().basePolicy(); + } + + 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 FirewallPolicySql sql() { + return this.innerModel().sql(); + } + + public DnsSettings dnsSettings() { + return this.innerModel().dnsSettings(); + } + + public ExplicitProxy explicitProxy() { + return this.innerModel().explicitProxy(); + } + + public FirewallPolicyIntrusionDetection intrusionDetection() { + return this.innerModel().intrusionDetection(); + } + + public FirewallPolicyDraftInner 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/FirewallPolicyDraftsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftsClientImpl.java new file mode 100644 index 0000000000000..a94e8159f55a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftsClientImpl.java @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyDraftsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyDraftInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FirewallPolicyDraftsClient. + */ +public final class FirewallPolicyDraftsClientImpl implements FirewallPolicyDraftsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FirewallPolicyDraftsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyDraftsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyDraftsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FirewallPolicyDraftsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyDrafts to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface FirewallPolicyDraftsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") FirewallPolicyDraftInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @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/firewallPolicies/{firewallPolicyName}/firewallPolicyDrafts/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create or update a draft 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 Draft operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String firewallPolicyName, FirewallPolicyDraftInner 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + firewallPolicyName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a draft 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 Draft operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String firewallPolicyName, FirewallPolicyDraftInner 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + } + + /** + * Create or update a draft 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 Draft operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, firewallPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a draft 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 Draft operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String firewallPolicyName, FirewallPolicyDraftInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, firewallPolicyName, parameters, context).block(); + } + + /** + * Create or update a draft 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 Draft operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FirewallPolicyDraftInner createOrUpdate(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, firewallPolicyName, parameters, Context.NONE).getValue(); + } + + /** + * Delete a draft 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a draft 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context); + } + + /** + * Delete a draft 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String firewallPolicyName) { + return deleteWithResponseAsync(resourceGroupName, firewallPolicyName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a draft 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String firewallPolicyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, firewallPolicyName, context).block(); + } + + /** + * Delete a draft 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) { + deleteWithResponse(resourceGroupName, firewallPolicyName, Context.NONE); + } + + /** + * Get a draft 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 a draft Firewall Policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a draft 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 a draft Firewall Policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context); + } + + /** + * Get a draft 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 a draft Firewall Policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String firewallPolicyName) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a draft 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 a draft Firewall Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String firewallPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName, context).block(); + } + + /** + * Get a draft 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 a draft Firewall Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyDraftInner get(String resourceGroupName, String firewallPolicyName) { + return getWithResponse(resourceGroupName, firewallPolicyName, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftsImpl.java new file mode 100644 index 0000000000000..72e5797e5c49c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyDraftsImpl.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.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.FirewallPolicyDraftsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyDraftInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyDraft; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyDrafts; + +public final class FirewallPolicyDraftsImpl implements FirewallPolicyDrafts { + private static final ClientLogger LOGGER = new ClientLogger(FirewallPolicyDraftsImpl.class); + + private final FirewallPolicyDraftsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyDraftsImpl(FirewallPolicyDraftsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response createOrUpdateWithResponse(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, firewallPolicyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FirewallPolicyDraftImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FirewallPolicyDraft createOrUpdate(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters) { + FirewallPolicyDraftInner inner + = this.serviceClient().createOrUpdate(resourceGroupName, firewallPolicyName, parameters); + if (inner != null) { + return new FirewallPolicyDraftImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String firewallPolicyName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, firewallPolicyName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String firewallPolicyName) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName); + } + + public Response getWithResponse(String resourceGroupName, String firewallPolicyName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, firewallPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FirewallPolicyDraftImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FirewallPolicyDraft get(String resourceGroupName, String firewallPolicyName) { + FirewallPolicyDraftInner inner = this.serviceClient().get(resourceGroupName, firewallPolicyName); + if (inner != null) { + return new FirewallPolicyDraftImpl(inner, this.manager()); + } else { + return null; + } + } + + private FirewallPolicyDraftsClient 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/FirewallPolicyIdpsSignaturesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesClientImpl.java new file mode 100644 index 0000000000000..5dfa8916ae6e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesClientImpl.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesClient; +import com.azure.resourcemanager.network.generated.fluent.models.QueryResultsInner; +import com.azure.resourcemanager.network.generated.models.IdpsQueryObject; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FirewallPolicyIdpsSignaturesClient. + */ +public final class FirewallPolicyIdpsSignaturesClientImpl implements FirewallPolicyIdpsSignaturesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FirewallPolicyIdpsSignaturesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyIdpsSignaturesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyIdpsSignaturesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FirewallPolicyIdpsSignaturesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyIdpsSignatures to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface FirewallPolicyIdpsSignaturesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") IdpsQueryObject parameters, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 query result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String firewallPolicyName, + IdpsQueryObject 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 query result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, String firewallPolicyName, + IdpsQueryObject 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + } + + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 query result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String firewallPolicyName, + IdpsQueryObject parameters) { + return listWithResponseAsync(resourceGroupName, firewallPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 query result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String firewallPolicyName, + IdpsQueryObject parameters, Context context) { + return listWithResponseAsync(resourceGroupName, firewallPolicyName, parameters, context).block(); + } + + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 query result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QueryResultsInner list(String resourceGroupName, String firewallPolicyName, IdpsQueryObject parameters) { + return listWithResponse(resourceGroupName, firewallPolicyName, parameters, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesClientImpl.java new file mode 100644 index 0000000000000..eb7e007d8f53e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesClientImpl.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesFilterValuesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SignatureOverridesFilterValuesResponseInner; +import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesQuery; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * FirewallPolicyIdpsSignaturesFilterValuesClient. + */ +public final class FirewallPolicyIdpsSignaturesFilterValuesClientImpl + implements FirewallPolicyIdpsSignaturesFilterValuesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FirewallPolicyIdpsSignaturesFilterValuesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyIdpsSignaturesFilterValuesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyIdpsSignaturesFilterValuesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FirewallPolicyIdpsSignaturesFilterValuesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyIdpsSignaturesFilterValues to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface FirewallPolicyIdpsSignaturesFilterValuesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SignatureOverridesFilterValuesQuery parameters, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 describes the list of all possible values for a specific filter value along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String firewallPolicyName, SignatureOverridesFilterValuesQuery 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 describes the list of all possible values for a specific filter value along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String firewallPolicyName, SignatureOverridesFilterValuesQuery 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + } + + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 describes the list of all possible values for a specific filter value on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, + String firewallPolicyName, SignatureOverridesFilterValuesQuery parameters) { + return listWithResponseAsync(resourceGroupName, firewallPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 describes the list of all possible values for a specific filter value along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String firewallPolicyName, SignatureOverridesFilterValuesQuery parameters, Context context) { + return listWithResponseAsync(resourceGroupName, firewallPolicyName, parameters, context).block(); + } + + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters 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 describes the list of all possible values for a specific filter value. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignatureOverridesFilterValuesResponseInner list(String resourceGroupName, String firewallPolicyName, + SignatureOverridesFilterValuesQuery parameters) { + return listWithResponse(resourceGroupName, firewallPolicyName, parameters, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesImpl.java new file mode 100644 index 0000000000000..3fc9a76999946 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesFilterValuesImpl.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.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.FirewallPolicyIdpsSignaturesFilterValuesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SignatureOverridesFilterValuesResponseInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesFilterValues; +import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesQuery; +import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesResponse; + +public final class FirewallPolicyIdpsSignaturesFilterValuesImpl implements FirewallPolicyIdpsSignaturesFilterValues { + private static final ClientLogger LOGGER = new ClientLogger(FirewallPolicyIdpsSignaturesFilterValuesImpl.class); + + private final FirewallPolicyIdpsSignaturesFilterValuesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyIdpsSignaturesFilterValuesImpl(FirewallPolicyIdpsSignaturesFilterValuesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, + String firewallPolicyName, SignatureOverridesFilterValuesQuery parameters, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, firewallPolicyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SignatureOverridesFilterValuesResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SignatureOverridesFilterValuesResponse list(String resourceGroupName, String firewallPolicyName, + SignatureOverridesFilterValuesQuery parameters) { + SignatureOverridesFilterValuesResponseInner inner + = this.serviceClient().list(resourceGroupName, firewallPolicyName, parameters); + if (inner != null) { + return new SignatureOverridesFilterValuesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private FirewallPolicyIdpsSignaturesFilterValuesClient 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/FirewallPolicyIdpsSignaturesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesImpl.java new file mode 100644 index 0000000000000..c05c33a182623 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesImpl.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.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.FirewallPolicyIdpsSignaturesClient; +import com.azure.resourcemanager.network.generated.fluent.models.QueryResultsInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignatures; +import com.azure.resourcemanager.network.generated.models.IdpsQueryObject; +import com.azure.resourcemanager.network.generated.models.QueryResults; + +public final class FirewallPolicyIdpsSignaturesImpl implements FirewallPolicyIdpsSignatures { + private static final ClientLogger LOGGER = new ClientLogger(FirewallPolicyIdpsSignaturesImpl.class); + + private final FirewallPolicyIdpsSignaturesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyIdpsSignaturesImpl(FirewallPolicyIdpsSignaturesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, String firewallPolicyName, + IdpsQueryObject parameters, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, firewallPolicyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QueryResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public QueryResults list(String resourceGroupName, String firewallPolicyName, IdpsQueryObject parameters) { + QueryResultsInner inner = this.serviceClient().list(resourceGroupName, firewallPolicyName, parameters); + if (inner != null) { + return new QueryResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + private FirewallPolicyIdpsSignaturesClient 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/FirewallPolicyIdpsSignaturesOverridesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesClientImpl.java new file mode 100644 index 0000000000000..5c72b72649138 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesClientImpl.java @@ -0,0 +1,638 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesOverridesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesListInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * FirewallPolicyIdpsSignaturesOverridesClient. + */ +public final class FirewallPolicyIdpsSignaturesOverridesClientImpl + implements FirewallPolicyIdpsSignaturesOverridesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FirewallPolicyIdpsSignaturesOverridesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyIdpsSignaturesOverridesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyIdpsSignaturesOverridesClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FirewallPolicyIdpsSignaturesOverridesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyIdpsSignaturesOverrides to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface FirewallPolicyIdpsSignaturesOverridesService { + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SignaturesOverridesInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> put(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SignaturesOverridesInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @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/firewallPolicies/{firewallPolicyName}/signatureOverrides") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync(String resourceGroupName, + String firewallPolicyName, SignaturesOverridesInner 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patch(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync(String resourceGroupName, + String firewallPolicyName, SignaturesOverridesInner 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.patch(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + } + + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters) { + return patchWithResponseAsync(resourceGroupName, firewallPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context) { + return patchWithResponseAsync(resourceGroupName, firewallPolicyName, parameters, context).block(); + } + + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignaturesOverridesInner patch(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters) { + return patchWithResponse(resourceGroupName, firewallPolicyName, parameters, Context.NONE).getValue(); + } + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, + String firewallPolicyName, SignaturesOverridesInner 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> putWithResponseAsync(String resourceGroupName, + String firewallPolicyName, SignaturesOverridesInner 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.put(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + } + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters) { + return putWithResponseAsync(resourceGroupName, firewallPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response putWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context) { + return putWithResponseAsync(resourceGroupName, firewallPolicyName, parameters, context).block(); + } + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignaturesOverridesInner put(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters) { + return putWithResponse(resourceGroupName, firewallPolicyName, parameters, Context.NONE).getValue(); + } + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context); + } + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String firewallPolicyName) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String firewallPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName, context).block(); + } + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignaturesOverridesInner get(String resourceGroupName, String firewallPolicyName) { + return getWithResponse(resourceGroupName, firewallPolicyName, Context.NONE).getValue(); + } + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + this.client.getSubscriptionId(), apiVersion, accept, context); + } + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String firewallPolicyName) { + return listWithResponseAsync(resourceGroupName, firewallPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String firewallPolicyName, + Context context) { + return listWithResponseAsync(resourceGroupName, firewallPolicyName, context).block(); + } + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignaturesOverridesListInner list(String resourceGroupName, String firewallPolicyName) { + return listWithResponse(resourceGroupName, firewallPolicyName, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesImpl.java new file mode 100644 index 0000000000000..95979b5cf97dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyIdpsSignaturesOverridesImpl.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.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.FirewallPolicyIdpsSignaturesOverridesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesListInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsSignaturesOverrides; +import com.azure.resourcemanager.network.generated.models.SignaturesOverrides; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesList; + +public final class FirewallPolicyIdpsSignaturesOverridesImpl implements FirewallPolicyIdpsSignaturesOverrides { + private static final ClientLogger LOGGER = new ClientLogger(FirewallPolicyIdpsSignaturesOverridesImpl.class); + + private final FirewallPolicyIdpsSignaturesOverridesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyIdpsSignaturesOverridesImpl(FirewallPolicyIdpsSignaturesOverridesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response patchWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context) { + Response inner + = this.serviceClient().patchWithResponse(resourceGroupName, firewallPolicyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SignaturesOverridesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SignaturesOverrides patch(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters) { + SignaturesOverridesInner inner = this.serviceClient().patch(resourceGroupName, firewallPolicyName, parameters); + if (inner != null) { + return new SignaturesOverridesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response putWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context) { + Response inner + = this.serviceClient().putWithResponse(resourceGroupName, firewallPolicyName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SignaturesOverridesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SignaturesOverrides put(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters) { + SignaturesOverridesInner inner = this.serviceClient().put(resourceGroupName, firewallPolicyName, parameters); + if (inner != null) { + return new SignaturesOverridesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, String firewallPolicyName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, firewallPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SignaturesOverridesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SignaturesOverrides get(String resourceGroupName, String firewallPolicyName) { + SignaturesOverridesInner inner = this.serviceClient().get(resourceGroupName, firewallPolicyName); + if (inner != null) { + return new SignaturesOverridesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String firewallPolicyName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, firewallPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SignaturesOverridesListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SignaturesOverridesList list(String resourceGroupName, String firewallPolicyName) { + SignaturesOverridesListInner inner = this.serviceClient().list(resourceGroupName, firewallPolicyName); + if (inner != null) { + return new SignaturesOverridesListImpl(inner, this.manager()); + } else { + return null; + } + } + + private FirewallPolicyIdpsSignaturesOverridesClient 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/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..3df66cd6b6f81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyImpl.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ExplicitProxy; +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.FirewallPolicySql; +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.azure.resourcemanager.network.generated.models.TagsObject; +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 String id() { + return this.innerModel().id(); + } + + public String size() { + return this.innerModel().size(); + } + + 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 FirewallPolicySql sql() { + return this.innerModel().sql(); + } + + public DnsSettings dnsSettings() { + return this.innerModel().dnsSettings(); + } + + public ExplicitProxy explicitProxy() { + return this.innerModel().explicitProxy(); + } + + public FirewallPolicyIntrusionDetection intrusionDetection() { + return this.innerModel().intrusionDetection(); + } + + public FirewallPolicyTransportSecurity transportSecurity() { + return this.innerModel().transportSecurity(); + } + + public FirewallPolicySku sku() { + return this.innerModel().sku(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FirewallPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String firewallPolicyName; + + private TagsObject updateParameters; + + 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() { + this.updateParameters = new TagsObject(); + return this; + } + + public FirewallPolicy apply() { + this.innerObject = serviceManager.serviceClient() + .getFirewallPolicies() + .updateTagsWithResponse(resourceGroupName, firewallPolicyName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public FirewallPolicy apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFirewallPolicies() + .updateTagsWithResponse(resourceGroupName, firewallPolicyName, updateParameters, context) + .getValue(); + return this; + } + + FirewallPolicyImpl(FirewallPolicyInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = ResourceManagerUtils.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) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.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 withSql(FirewallPolicySql sql) { + this.innerModel().withSql(sql); + return this; + } + + public FirewallPolicyImpl withDnsSettings(DnsSettings dnsSettings) { + this.innerModel().withDnsSettings(dnsSettings); + return this; + } + + public FirewallPolicyImpl withExplicitProxy(ExplicitProxy explicitProxy) { + this.innerModel().withExplicitProxy(explicitProxy); + 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; + } + + 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/FirewallPolicyRuleCollectionGroupDraftImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftImpl.java new file mode 100644 index 0000000000000..cd1187954bb49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftImpl.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.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroupDraft; +import java.util.Collections; +import java.util.List; + +public final class FirewallPolicyRuleCollectionGroupDraftImpl implements FirewallPolicyRuleCollectionGroupDraft { + private FirewallPolicyRuleCollectionGroupDraftInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FirewallPolicyRuleCollectionGroupDraftImpl(FirewallPolicyRuleCollectionGroupDraftInner 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 size() { + return this.innerModel().size(); + } + + 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 FirewallPolicyRuleCollectionGroupDraftInner 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/FirewallPolicyRuleCollectionGroupDraftsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftsClientImpl.java new file mode 100644 index 0000000000000..41e73687a1b48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftsClientImpl.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.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyRuleCollectionGroupDraftsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * FirewallPolicyRuleCollectionGroupDraftsClient. + */ +public final class FirewallPolicyRuleCollectionGroupDraftsClientImpl + implements FirewallPolicyRuleCollectionGroupDraftsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FirewallPolicyRuleCollectionGroupDraftsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of FirewallPolicyRuleCollectionGroupDraftsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FirewallPolicyRuleCollectionGroupDraftsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(FirewallPolicyRuleCollectionGroupDraftsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientFirewallPolicyRuleCollectionGroupDrafts to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface FirewallPolicyRuleCollectionGroupDraftsService { + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default") + @ExpectedResponses({ 200, 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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default") + @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") FirewallPolicyRuleCollectionGroupDraftInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}/ruleCollectionGroupDrafts/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("firewallPolicyName") String firewallPolicyName, + @PathParam("ruleCollectionGroupName") String ruleCollectionGroupName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Delete Rule Collection Group Draft. + * + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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())); + } + + /** + * Delete Rule Collection Group Draft. + * + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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); + } + + /** + * Delete Rule Collection Group Draft. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName) { + return deleteWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete Rule Collection Group Draft. + * + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context).block(); + } + + /** + * Delete Rule Collection Group Draft. + * + * @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) { + deleteWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE); + } + + /** + * Create or Update Rule Collection Group Draft. + * + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner 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 = "2024-03-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())); + } + + /** + * Create or Update Rule Collection Group Draft. + * + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner 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 = "2024-03-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); + } + + /** + * Create or Update Rule Collection Group Draft. + * + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update Rule Collection Group Draft. + * + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, + parameters, context).block(); + } + + /** + * Create or Update Rule Collection Group Draft. + * + * @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 FirewallPolicyRuleCollectionGroupDraftInner createOrUpdate(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, + Context.NONE).getValue(); + } + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, + ruleCollectionGroupName, this.client.getSubscriptionId(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, firewallPolicyName, ruleCollectionGroupName, + this.client.getSubscriptionId(), apiVersion, accept, context); + } + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context).block(); + } + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FirewallPolicyRuleCollectionGroupDraftInner get(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName) { + return getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftsImpl.java new file mode 100644 index 0000000000000..cd65d74603d73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupDraftsImpl.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.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.FirewallPolicyRuleCollectionGroupDraftsClient; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroupDraft; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleCollectionGroupDrafts; + +public final class FirewallPolicyRuleCollectionGroupDraftsImpl implements FirewallPolicyRuleCollectionGroupDrafts { + private static final ClientLogger LOGGER = new ClientLogger(FirewallPolicyRuleCollectionGroupDraftsImpl.class); + + private final FirewallPolicyRuleCollectionGroupDraftsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public FirewallPolicyRuleCollectionGroupDraftsImpl(FirewallPolicyRuleCollectionGroupDraftsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteWithResponse(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, context); + } + + public void delete(String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName) { + this.serviceClient().delete(resourceGroupName, firewallPolicyName, ruleCollectionGroupName); + } + + public Response createOrUpdateWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner parameters, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FirewallPolicyRuleCollectionGroupDraftImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FirewallPolicyRuleCollectionGroupDraft createOrUpdate(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, FirewallPolicyRuleCollectionGroupDraftInner parameters) { + FirewallPolicyRuleCollectionGroupDraftInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters); + if (inner != null) { + return new FirewallPolicyRuleCollectionGroupDraftImpl(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 FirewallPolicyRuleCollectionGroupDraftImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public FirewallPolicyRuleCollectionGroupDraft get(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName) { + FirewallPolicyRuleCollectionGroupDraftInner inner + = this.serviceClient().get(resourceGroupName, firewallPolicyName, ruleCollectionGroupName); + if (inner != null) { + return new FirewallPolicyRuleCollectionGroupDraftImpl(inner, this.manager()); + } else { + return null; + } + } + + private FirewallPolicyRuleCollectionGroupDraftsClient 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/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..2eae82662a51c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupImpl.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.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 String size() { + return this.innerModel().size(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.firewallPolicyName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "firewallPolicies"); + this.ruleCollectionGroupName + = ResourceManagerUtils.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..159cd8af2fa82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsClientImpl.java @@ -0,0 +1,969 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName) { + return getWithResponseAsync(resourceGroupName, firewallPolicyName, ruleCollectionGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, Context context) { + return getWithResponseAsync(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) + public FirewallPolicyRuleCollectionGroupInner get(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName) { + return getWithResponse(resourceGroupName, firewallPolicyName, ruleCollectionGroupName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate(String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters) { + return this.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 the {@link SyncPoller} for polling of rule Collection Group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FirewallPolicyRuleCollectionGroupInner> + beginCreateOrUpdate(String resourceGroupName, String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupInner parameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFirewallPolicyRuleCollectionGroups API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..29b5b7011d2a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FirewallPolicyRuleCollectionGroupsImpl.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.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; + +public final class FirewallPolicyRuleCollectionGroupsImpl implements FirewallPolicyRuleCollectionGroups { + private static 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 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 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 PagedIterable list(String resourceGroupName, String firewallPolicyName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, firewallPolicyName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new FirewallPolicyRuleCollectionGroupImpl(inner1, this.manager())); + } + + public FirewallPolicyRuleCollectionGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String firewallPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.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..dc8665cc21087 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ManagedServiceIdentity; +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 ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String id() { + return this.innerModel().id(); + } + + public String targetResourceId() { + return this.innerModel().targetResourceId(); + } + + public String targetResourceGuid() { + return this.innerModel().targetResourceGuid(); + } + + public String storageId() { + return this.innerModel().storageId(); + } + + public String enabledFilteringCriteria() { + return this.innerModel().enabledFilteringCriteria(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkWatchers"); + this.flowLogName = ResourceManagerUtils.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 withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + 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 withEnabledFilteringCriteria(String enabledFilteringCriteria) { + this.innerModel().withEnabledFilteringCriteria(enabledFilteringCriteria); + 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..b266afa89993c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogInformationImpl.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.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.ManagedServiceIdentity; +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 ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String storageId() { + return this.innerModel().storageId(); + } + + public String enabledFilteringCriteria() { + return this.innerModel().enabledFilteringCriteria(); + } + + 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..fe92000dc84dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsClientImpl.java @@ -0,0 +1,1090 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a flow log resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a flow log resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a flow log resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInner> beginCreateOrUpdate(String resourceGroupName, + String networkWatcherName, String flowLogName, FlowLogInner parameters) { + return this.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 the {@link SyncPoller} for polling of a flow log resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInner> beginCreateOrUpdate(String resourceGroupName, + String networkWatcherName, String flowLogName, FlowLogInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String networkWatcherName, String flowLogName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 updateTagsWithResponse(resourceGroupName, networkWatcherName, flowLogName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkWatcherName, String flowLogName) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkWatcherName, + String flowLogName, Context context) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, flowLogName, 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) + public FlowLogInner get(String resourceGroupName, String networkWatcherName, String flowLogName) { + return getWithResponse(resourceGroupName, networkWatcherName, flowLogName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName, + String flowLogName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName, + String flowLogName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of flow logs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..afd0dc542c6ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FlowLogsImpl.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.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; + +public final class FlowLogsImpl implements FlowLogs { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new FlowLogImpl(inner1, this.manager())); + } + + public FlowLog getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.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..718d4c8d26519 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationImpl.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.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/FrontendIpConfigurationPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationPropertiesFormatImpl.java new file mode 100644 index 0000000000000..81a9d00c5622d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/FrontendIpConfigurationPropertiesFormatImpl.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationPropertiesFormatInner; +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.FrontendIpConfigurationPropertiesFormat; +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 FrontendIpConfigurationPropertiesFormatImpl implements FrontendIpConfigurationPropertiesFormat { + private FrontendIpConfigurationPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + FrontendIpConfigurationPropertiesFormatImpl(FrontendIpConfigurationPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 FrontendIpConfigurationPropertiesFormatInner 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..f1efb1ef177d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GatewayRouteListResultImpl.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.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..2af0f8ef0a15d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/GenerateExpressRoutePortsLoaResultImpl.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.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..3a79e50313ce4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.ipConfigName = ResourceManagerUtils.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/HubIpConfigurationPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationPropertiesFormatImpl.java new file mode 100644 index 0000000000000..4d5fa292c73ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubIpConfigurationPropertiesFormatImpl.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.resourcemanager.network.generated.fluent.models.HubIpConfigurationPropertiesFormatInner; +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.HubIpConfigurationPropertiesFormat; +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 HubIpConfigurationPropertiesFormatImpl implements HubIpConfigurationPropertiesFormat { + private HubIpConfigurationPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + HubIpConfigurationPropertiesFormatImpl(HubIpConfigurationPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 HubIpConfigurationPropertiesFormatInner 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/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..52557f8cba267 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTableImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routeTableName = ResourceManagerUtils.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..f3a40e184c992 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesClientImpl.java @@ -0,0 +1,939 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubRouteTableInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routeTableName, HubRouteTableInner routeTableParameters) { + return this.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 the {@link SyncPoller} for polling of routeTable resource in a virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubRouteTableInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routeTableName, HubRouteTableInner routeTableParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, String routeTableName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String virtualHubName, + String routeTableName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName, 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) + public HubRouteTableInner get(String resourceGroupName, String virtualHubName, String routeTableName) { + return getWithResponse(resourceGroupName, virtualHubName, routeTableName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routeTableName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routeTableName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteTables and a URL nextLink to get the next set of results along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..f10b8a9babac8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubRouteTablesImpl.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.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; + +public final class HubRouteTablesImpl implements HubRouteTables { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new HubRouteTableImpl(inner1, this.manager())); + } + + public HubRouteTable getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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..5046f5fda17e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionImpl.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.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..8efe9ff7c2a79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsClientImpl.java @@ -0,0 +1,967 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubVirtualNetworkConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String virtualHubName, String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters) { + return this + .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 the {@link SyncPoller} for polling of hubVirtualNetworkConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubVirtualNetworkConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String virtualHubName, String connectionName, + HubVirtualNetworkConnectionInner hubVirtualNetworkConnectionParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String connectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String connectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, + String connectionName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getWithResponse(resourceGroupName, virtualHubName, connectionName, Context.NONE).getValue(); + } + + /** + * 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated + * response with {@link PagedFlux}. + */ + @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 as paginated + * response with {@link PagedFlux}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of HubVirtualNetworkConnections and a URL nextLink to get the next set of results along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..b071371740778 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/HubVirtualNetworkConnectionsImpl.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.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; + +public final class HubVirtualNetworkConnectionsImpl implements HubVirtualNetworkConnections { + private static 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 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 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 PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, virtualHubName); + return ResourceManagerUtils.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 ResourceManagerUtils.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..ed7d407c08e73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRuleImpl.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.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 Integer frontendPortRangeStart() { + return this.innerModel().frontendPortRangeStart(); + } + + public Integer frontendPortRangeEnd() { + return this.innerModel().frontendPortRangeEnd(); + } + + public SubResource backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "loadBalancers"); + this.inboundNatRuleName = ResourceManagerUtils.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; + } + + public InboundNatRuleImpl withFrontendPortRangeStart(Integer frontendPortRangeStart) { + this.innerModel().withFrontendPortRangeStart(frontendPortRangeStart); + return this; + } + + public InboundNatRuleImpl withFrontendPortRangeEnd(Integer frontendPortRangeEnd) { + this.innerModel().withFrontendPortRangeEnd(frontendPortRangeEnd); + return this; + } + + public InboundNatRuleImpl withBackendAddressPool(SubResource backendAddressPool) { + this.innerModel().withBackendAddressPool(backendAddressPool); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulePropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulePropertiesFormatImpl.java new file mode 100644 index 0000000000000..4f561b81439c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulePropertiesFormatImpl.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.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRulePropertiesFormatInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.models.InboundNatRulePropertiesFormat; +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 InboundNatRulePropertiesFormatImpl implements InboundNatRulePropertiesFormat { + private InboundNatRulePropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + InboundNatRulePropertiesFormatImpl(InboundNatRulePropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 Integer frontendPortRangeStart() { + return this.innerModel().frontendPortRangeStart(); + } + + public Integer frontendPortRangeEnd() { + return this.innerModel().frontendPortRangeEnd(); + } + + public SubResource backendAddressPool() { + return this.innerModel().backendAddressPool(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public InboundNatRulePropertiesFormatInner 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/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..9c9e8c7ce0997 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesClientImpl.java @@ -0,0 +1,964 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName, + String inboundNatRuleName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName, + String inboundNatRuleName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String loadBalancerName, + String inboundNatRuleName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, loadBalancerName, inboundNatRuleName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 getWithResponse(resourceGroupName, loadBalancerName, inboundNatRuleName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters) { + return this + .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 the {@link SyncPoller} for polling of inbound NAT rule of the load balancer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, String inboundNatRuleName, + InboundNatRuleInner inboundNatRuleParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListInboundNatRule API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..968285505ff3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundNatRulesImpl.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.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; + +public final class InboundNatRulesImpl implements InboundNatRules { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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 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 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 InboundNatRule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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..b4af899b577a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleImpl.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.InboundSecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRule; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleType; +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 InboundSecurityRuleType ruleType() { + return this.innerModel().ruleType(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "inboundSecurityRules"); + } + + public InboundSecurityRule refresh() { + this.innerObject = serviceManager.serviceClient() + .getInboundSecurityRuleOperations() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, Context.NONE) + .getValue(); + return this; + } + + public InboundSecurityRule refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getInboundSecurityRuleOperations() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, context) + .getValue(); + return this; + } + + public InboundSecurityRuleImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public InboundSecurityRuleImpl withRuleType(InboundSecurityRuleType ruleType) { + this.innerModel().withRuleType(ruleType); + 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..cf9d3081a4786 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsClientImpl.java @@ -0,0 +1,508 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.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 { + /** + * 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") + public 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); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@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, @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, String ruleCollectionName, + InboundSecurityRuleInner parameters) { + return this + .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 the {@link SyncPoller} for polling of nVA Inbound Security Rule resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, InboundSecurityRuleInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, String ruleCollectionName, + InboundSecurityRuleInner parameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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(); + } + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, String ruleCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), resourceGroupName, networkVirtualApplianceName, + ruleCollectionName, apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, String ruleCollectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, networkVirtualApplianceName, + ruleCollectionName, apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkVirtualApplianceName, + String ruleCollectionName) { + return getWithResponseAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String ruleCollectionName, Context context) { + return getWithResponseAsync(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, context) + .block(); + } + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 get(String resourceGroupName, String networkVirtualApplianceName, + String ruleCollectionName) { + return getWithResponse(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, Context.NONE) + .getValue(); + } +} 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..aa6ea82342032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/InboundSecurityRuleOperationsImpl.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.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.InboundSecurityRuleOperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.InboundSecurityRuleInner; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRule; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleOperations; + +public final class InboundSecurityRuleOperationsImpl implements InboundSecurityRuleOperations { + private static 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; + } + + public Response getWithResponse(String resourceGroupName, String networkVirtualApplianceName, + String ruleCollectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new InboundSecurityRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public InboundSecurityRule get(String resourceGroupName, String networkVirtualApplianceName, + String ruleCollectionName) { + InboundSecurityRuleInner inner + = this.serviceClient().get(resourceGroupName, networkVirtualApplianceName, ruleCollectionName); + if (inner != null) { + return new InboundSecurityRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public InboundSecurityRule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "inboundSecurityRules"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inboundSecurityRules'.", id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "inboundSecurityRules"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'inboundSecurityRules'.", id))); + } + return this.getWithResponse(resourceGroupName, networkVirtualApplianceName, ruleCollectionName, context); + } + + 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..02095108ddef0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAddressAvailabilityResultImpl.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.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..d86631270273c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipAllocationName = ResourceManagerUtils.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..3290ae798d5c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ipAllocationName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ipAllocationName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipAllocationName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, ipAllocationName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String ipAllocationName, + String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipAllocationName, expand, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, ipAllocationName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpAllocationInner> beginCreateOrUpdate(String resourceGroupName, + String ipAllocationName, IpAllocationInner parameters) { + return this.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 the {@link SyncPoller} for polling of ipAllocation resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpAllocationInner> beginCreateOrUpdate(String resourceGroupName, + String ipAllocationName, IpAllocationInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String ipAllocationName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, ipAllocationName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String ipAllocationName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public IpAllocationInner updateTags(String resourceGroupName, String ipAllocationName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, ipAllocationName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListIpAllocations API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..fba4e3f33f6e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpAllocationsImpl.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.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; + +public final class IpAllocationsImpl implements IpAllocations { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IpAllocationImpl(inner1, this.manager())); + } + + public IpAllocation getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipAllocationName = ResourceManagerUtils.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..449e5003d34d5 --- /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..a4c5c4298e57f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfileImpl.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.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/IpConfigurationProfilePropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfilePropertiesFormatImpl.java new file mode 100644 index 0000000000000..8af162b10a883 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationProfilePropertiesFormatImpl.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.resourcemanager.network.generated.fluent.models.IpConfigurationProfilePropertiesFormatInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.IpConfigurationProfilePropertiesFormat; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class IpConfigurationProfilePropertiesFormatImpl implements IpConfigurationProfilePropertiesFormat { + private IpConfigurationProfilePropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationProfilePropertiesFormatImpl(IpConfigurationProfilePropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 IpConfigurationProfilePropertiesFormatInner 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/IpConfigurationPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationPropertiesFormatImpl.java new file mode 100644 index 0000000000000..3c4abe19edc9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpConfigurationPropertiesFormatImpl.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.resourcemanager.network.generated.fluent.models.IpConfigurationPropertiesFormatInner; +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.IpConfigurationPropertiesFormat; +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 IpConfigurationPropertiesFormatImpl implements IpConfigurationPropertiesFormat { + private IpConfigurationPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpConfigurationPropertiesFormatImpl(IpConfigurationPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 IpConfigurationPropertiesFormatInner 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..ccfce37a4b0ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.ipGroupsName = ResourceManagerUtils.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..65b27951b66df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsClientImpl.java @@ -0,0 +1,1184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String ipGroupsName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, ipGroupsName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String ipGroupsName, + String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, ipGroupsName, expand, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, ipGroupsName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpGroupInner> beginCreateOrUpdate(String resourceGroupName, + String ipGroupsName, IpGroupInner parameters) { + return this.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 {@link SyncPoller} for polling of the IpGroups resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IpGroupInner> beginCreateOrUpdate(String resourceGroupName, + String ipGroupsName, IpGroupInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateGroupsAsync(String resourceGroupName, String ipGroupsName, TagsObject parameters) { + return updateGroupsWithResponseAsync(resourceGroupName, ipGroupsName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateGroupsWithResponse(String resourceGroupName, String ipGroupsName, + TagsObject parameters, Context context) { + return updateGroupsWithResponseAsync(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) + public IpGroupInner updateGroups(String resourceGroupName, String ipGroupsName, TagsObject parameters) { + return updateGroupsWithResponse(resourceGroupName, ipGroupsName, parameters, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ipGroupsName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String ipGroupsName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..351ac88b4dbb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpGroupsImpl.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.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; + +public final class IpGroupsImpl implements IpGroups { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IpGroupImpl(inner1, this.manager())); + } + + public IpGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String ipGroupsName = ResourceManagerUtils.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/IpPrefixesListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpPrefixesListImpl.java new file mode 100644 index 0000000000000..951dff5db5d81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/IpPrefixesListImpl.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.IpPrefixesListInner; +import com.azure.resourcemanager.network.generated.models.IpPrefixesList; +import java.util.Collections; +import java.util.List; + +public final class IpPrefixesListImpl implements IpPrefixesList { + private IpPrefixesListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + IpPrefixesListImpl(IpPrefixesListInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List ipPrefixes() { + List inner = this.innerModel().ipPrefixes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IpPrefixesListInner 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/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..fca62f48f425d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsClientImpl.java @@ -0,0 +1,954 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String loadBalancerName, + String backendAddressPoolName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String loadBalancerName, + String backendAddressPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, backendAddressPoolName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, loadBalancerName, backendAddressPoolName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, + BackendAddressPoolInner parameters) { + return this.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 the {@link SyncPoller} for polling of pool of backend IP addresses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BackendAddressPoolInner> beginCreateOrUpdate( + String resourceGroupName, String loadBalancerName, String backendAddressPoolName, + BackendAddressPoolInner parameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName, + String backendAddressPoolName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName, + String backendAddressPoolName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListBackendAddressPool API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..c05171aa446ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerBackendAddressPoolsImpl.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.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; + +public final class LoadBalancerBackendAddressPoolsImpl implements LoadBalancerBackendAddressPools { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new BackendAddressPoolImpl(inner1, this.manager())); + } + + 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 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 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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.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..865ab30d78a70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsClientImpl.java @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String loadBalancerName, + String frontendIpConfigurationName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String loadBalancerName, + String frontendIpConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, frontendIpConfigurationName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, loadBalancerName, frontendIpConfigurationName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListFrontendIPConfiguration API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..a73f77babf711 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerFrontendIpConfigurationsImpl.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.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; + +public final class LoadBalancerFrontendIpConfigurationsImpl implements LoadBalancerFrontendIpConfigurations { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new FrontendIpConfigurationImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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..0898f84e7c21d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.loadBalancerName = ResourceManagerUtils.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..f9084cb02c430 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesClientImpl.java @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String loadBalancerName, + String loadBalancingRuleName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String loadBalancerName, + String loadBalancingRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, loadBalancingRuleName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getWithResponse(resourceGroupName, loadBalancerName, loadBalancingRuleName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLoadBalancingRule API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..0ca1f2eb12214 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerLoadBalancingRulesImpl.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.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; + +public final class LoadBalancerLoadBalancingRulesImpl implements LoadBalancerLoadBalancingRules { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new LoadBalancingRuleImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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..6129ffb42dada --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..7f0bf5ba87aa4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerNetworkInterfacesImpl.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.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; + +public final class LoadBalancerNetworkInterfacesImpl implements LoadBalancerNetworkInterfaces { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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..525da17d31ba1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String loadBalancerName, + String outboundRuleName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String loadBalancerName, + String outboundRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, outboundRuleName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getWithResponse(resourceGroupName, loadBalancerName, outboundRuleName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListOutboundRule API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..dceec12f1ab93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerOutboundRulesImpl.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.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; + +public final class LoadBalancerOutboundRulesImpl implements LoadBalancerOutboundRules { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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..47864e9f2d3c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesClientImpl.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String loadBalancerName, String probeName) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, probeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String loadBalancerName, String probeName, + Context context) { + return getWithResponseAsync(resourceGroupName, loadBalancerName, probeName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, loadBalancerName, probeName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListProbe API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..5e74db27cd0ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancerProbesImpl.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.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; + +public final class LoadBalancerProbesImpl implements LoadBalancerProbes { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new ProbeImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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..f777b4bdea348 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersClientImpl.java @@ -0,0 +1,1848 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.BackendAddressInboundNatRulePortMappingsInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.fluent.models.MigratedPoolsInner; +import com.azure.resourcemanager.network.generated.models.LoadBalancerListResult; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +import com.azure.resourcemanager.network.generated.models.MigrateLoadBalancerToIpBasedRequest; +import com.azure.resourcemanager.network.generated.models.QueryInboundNatRulePortMappingRequest; +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 { + /** + * 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") + public 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listInboundNatRulePortMappings(@HostParam("$host") String endpoint, + @PathParam("groupName") String groupName, @PathParam("loadBalancerName") String loadBalancerName, + @PathParam("backendPoolName") String backendPoolName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") QueryInboundNatRulePortMappingRequest parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/migrateToIpBased") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> migrateToIpBased(@HostParam("$host") String endpoint, + @PathParam("groupName") String groupName, @PathParam("loadBalancerName") String loadBalancerName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") MigrateLoadBalancerToIpBasedRequest 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String loadBalancerName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String loadBalancerName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String loadBalancerName, + String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, loadBalancerName, expand, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, loadBalancerName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LoadBalancerInner> beginCreateOrUpdate(String resourceGroupName, + String loadBalancerName, LoadBalancerInner parameters) { + return this.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 the {@link SyncPoller} for polling of loadBalancer resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LoadBalancerInner> beginCreateOrUpdate(String resourceGroupName, + String loadBalancerName, LoadBalancerInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String loadBalancerName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, loadBalancerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String loadBalancerName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public LoadBalancerInner updateTags(String resourceGroupName, String loadBalancerName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, loadBalancerName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSwapPublicIpAddresses(String location, + LoadBalancerVipSwapRequest parameters) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginSwapPublicIpAddresses(String location, + LoadBalancerVipSwapRequest parameters, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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(); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listInboundNatRulePortMappingsWithResponseAsync(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backendPoolName is required and 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listInboundNatRulePortMappings(this.client.getEndpoint(), groupName, + loadBalancerName, backendPoolName, apiVersion, this.client.getSubscriptionId(), parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listInboundNatRulePortMappingsWithResponseAsync(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (loadBalancerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter loadBalancerName is required and cannot be null.")); + } + if (backendPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter backendPoolName is required and 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listInboundNatRulePortMappings(this.client.getEndpoint(), groupName, loadBalancerName, + backendPoolName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappingsAsync(String groupName, String loadBalancerName, String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters) { + Mono>> mono + = listInboundNatRulePortMappingsWithResponseAsync(groupName, loadBalancerName, backendPoolName, parameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BackendAddressInboundNatRulePortMappingsInner.class, + BackendAddressInboundNatRulePortMappingsInner.class, this.client.getContext()); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappingsAsync(String groupName, String loadBalancerName, String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = listInboundNatRulePortMappingsWithResponseAsync(groupName, + loadBalancerName, backendPoolName, parameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), BackendAddressInboundNatRulePortMappingsInner.class, + BackendAddressInboundNatRulePortMappingsInner.class, context); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappings(String groupName, String loadBalancerName, String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters) { + return this.beginListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters) + .getSyncPoller(); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, BackendAddressInboundNatRulePortMappingsInner> + beginListInboundNatRulePortMappings(String groupName, String loadBalancerName, String backendPoolName, + QueryInboundNatRulePortMappingRequest parameters, Context context) { + return this + .beginListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters, context) + .getSyncPoller(); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listInboundNatRulePortMappingsAsync(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters) { + return beginListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listInboundNatRulePortMappingsAsync(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters, + Context context) { + return beginListInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendAddressInboundNatRulePortMappingsInner listInboundNatRulePortMappings(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters) { + return listInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters).block(); + } + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackendAddressInboundNatRulePortMappingsInner listInboundNatRulePortMappings(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters, + Context context) { + return listInboundNatRulePortMappingsAsync(groupName, loadBalancerName, backendPoolName, parameters, context) + .block(); + } + + /** + * Migrate load balancer to IP Based. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the migrateToIpBased Api. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a migrateToIpBased API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> migrateToIpBasedWithResponseAsync(String groupName, + String loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName 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) { + parameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.migrateToIpBased(this.client.getEndpoint(), groupName, loadBalancerName, + apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate load balancer to IP Based. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the migrateToIpBased Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a migrateToIpBased API along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> migrateToIpBasedWithResponseAsync(String groupName, + String loadBalancerName, MigrateLoadBalancerToIpBasedRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName 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) { + parameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.migrateToIpBased(this.client.getEndpoint(), groupName, loadBalancerName, apiVersion, + this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Migrate load balancer to IP Based. + * + * @param groupName 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 response for a migrateToIpBased API on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono migrateToIpBasedAsync(String groupName, String loadBalancerName) { + final MigrateLoadBalancerToIpBasedRequest parameters = null; + return migrateToIpBasedWithResponseAsync(groupName, loadBalancerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Migrate load balancer to IP Based. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the migrateToIpBased Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a migrateToIpBased API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response migrateToIpBasedWithResponse(String groupName, String loadBalancerName, + MigrateLoadBalancerToIpBasedRequest parameters, Context context) { + return migrateToIpBasedWithResponseAsync(groupName, loadBalancerName, parameters, context).block(); + } + + /** + * Migrate load balancer to IP Based. + * + * @param groupName 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 response for a migrateToIpBased API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MigratedPoolsInner migrateToIpBased(String groupName, String loadBalancerName) { + final MigrateLoadBalancerToIpBasedRequest parameters = null; + return migrateToIpBasedWithResponse(groupName, loadBalancerName, parameters, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLoadBalancers API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLoadBalancers API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLoadBalancers API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..ef90b9c9e1baa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LoadBalancersImpl.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.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.BackendAddressInboundNatRulePortMappingsInner; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import com.azure.resourcemanager.network.generated.fluent.models.MigratedPoolsInner; +import com.azure.resourcemanager.network.generated.models.BackendAddressInboundNatRulePortMappings; +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.azure.resourcemanager.network.generated.models.MigrateLoadBalancerToIpBasedRequest; +import com.azure.resourcemanager.network.generated.models.MigratedPools; +import com.azure.resourcemanager.network.generated.models.QueryInboundNatRulePortMappingRequest; + +public final class LoadBalancersImpl implements LoadBalancers { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LoadBalancerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.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 BackendAddressInboundNatRulePortMappings listInboundNatRulePortMappings(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters) { + BackendAddressInboundNatRulePortMappingsInner inner = this.serviceClient() + .listInboundNatRulePortMappings(groupName, loadBalancerName, backendPoolName, parameters); + if (inner != null) { + return new BackendAddressInboundNatRulePortMappingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public BackendAddressInboundNatRulePortMappings listInboundNatRulePortMappings(String groupName, + String loadBalancerName, String backendPoolName, QueryInboundNatRulePortMappingRequest parameters, + Context context) { + BackendAddressInboundNatRulePortMappingsInner inner = this.serviceClient() + .listInboundNatRulePortMappings(groupName, loadBalancerName, backendPoolName, parameters, context); + if (inner != null) { + return new BackendAddressInboundNatRulePortMappingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response migrateToIpBasedWithResponse(String groupName, String loadBalancerName, + MigrateLoadBalancerToIpBasedRequest parameters, Context context) { + Response inner + = this.serviceClient().migrateToIpBasedWithResponse(groupName, loadBalancerName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new MigratedPoolsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MigratedPools migrateToIpBased(String groupName, String loadBalancerName) { + MigratedPoolsInner inner = this.serviceClient().migrateToIpBased(groupName, loadBalancerName); + if (inner != null) { + return new MigratedPoolsImpl(inner, this.manager()); + } else { + return null; + } + } + + public LoadBalancer getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String loadBalancerName = ResourceManagerUtils.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..185b0cda1052f --- /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 int 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..15ebdbe3f0aa5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewayImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.localNetworkGatewayName + = ResourceManagerUtils.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..483ee547b6192 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysClientImpl.java @@ -0,0 +1,1030 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return this.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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LocalNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String localNetworkGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, localNetworkGatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String localNetworkGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, localNetworkGatewayName, 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) + public LocalNetworkGatewayInner getByResourceGroup(String resourceGroupName, String localNetworkGatewayName) { + return getByResourceGroupWithResponse(resourceGroupName, localNetworkGatewayName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String localNetworkGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String localNetworkGatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String localNetworkGatewayName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String localNetworkGatewayName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, localNetworkGatewayName, parameters, 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) + public LocalNetworkGatewayInner updateTags(String resourceGroupName, String localNetworkGatewayName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, localNetworkGatewayName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListLocalNetworkGateways API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..2a4165eb78972 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/LocalNetworkGatewaysImpl.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.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; + +public final class LocalNetworkGatewaysImpl implements LocalNetworkGateways { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LocalNetworkGatewayImpl(inner1, this.manager())); + } + + public LocalNetworkGateway getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String localNetworkGatewayName = ResourceManagerUtils.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/ManagementGroupNetworkManagerConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsClientImpl.java new file mode 100644 index 0000000000000..faa8890e6673b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsClientImpl.java @@ -0,0 +1,703 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.ManagementGroupNetworkManagerConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerConnectionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ManagementGroupNetworkManagerConnectionsClient. + */ +public final class ManagementGroupNetworkManagerConnectionsClientImpl + implements ManagementGroupNetworkManagerConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagementGroupNetworkManagerConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ManagementGroupNetworkManagerConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagementGroupNetworkManagerConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ManagementGroupNetworkManagerConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientManagementGroupNetworkManagerConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ManagementGroupNetworkManagerConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("managementGroupId") String managementGroupId, + @PathParam("networkManagerConnectionName") String networkManagerConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkManagerConnectionInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("managementGroupId") String managementGroupId, + @PathParam("networkManagerConnectionName") String networkManagerConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("managementGroupId") String managementGroupId, + @PathParam("networkManagerConnectionName") String networkManagerConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("managementGroupId") String managementGroupId, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @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 a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String managementGroupId, + String networkManagerConnectionName, NetworkManagerConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), managementGroupId, + networkManagerConnectionName, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String managementGroupId, + String networkManagerConnectionName, NetworkManagerConnectionInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), managementGroupId, networkManagerConnectionName, + apiVersion, parameters, accept, context); + } + + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String managementGroupId, + String networkManagerConnectionName, NetworkManagerConnectionInner parameters) { + return createOrUpdateWithResponseAsync(managementGroupId, networkManagerConnectionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String managementGroupId, + String networkManagerConnectionName, NetworkManagerConnectionInner parameters, Context context) { + return createOrUpdateWithResponseAsync(managementGroupId, networkManagerConnectionName, parameters, context) + .block(); + } + + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerConnectionInner createOrUpdate(String managementGroupId, String networkManagerConnectionName, + NetworkManagerConnectionInner parameters) { + return createOrUpdateWithResponse(managementGroupId, networkManagerConnectionName, parameters, Context.NONE) + .getValue(); + } + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String managementGroupId, + String networkManagerConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), managementGroupId, + networkManagerConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String managementGroupId, + String networkManagerConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), managementGroupId, networkManagerConnectionName, apiVersion, + accept, context); + } + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String managementGroupId, + String networkManagerConnectionName) { + return getWithResponseAsync(managementGroupId, networkManagerConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String managementGroupId, + String networkManagerConnectionName, Context context) { + return getWithResponseAsync(managementGroupId, networkManagerConnectionName, context).block(); + } + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerConnectionInner get(String managementGroupId, String networkManagerConnectionName) { + return getWithResponse(managementGroupId, networkManagerConnectionName, Context.NONE).getValue(); + } + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String managementGroupId, + String networkManagerConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), managementGroupId, + networkManagerConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String managementGroupId, String networkManagerConnectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), managementGroupId, networkManagerConnectionName, apiVersion, + accept, context); + } + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String managementGroupId, String networkManagerConnectionName) { + return deleteWithResponseAsync(managementGroupId, networkManagerConnectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String managementGroupId, String networkManagerConnectionName, + Context context) { + return deleteWithResponseAsync(managementGroupId, networkManagerConnectionName, context).block(); + } + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 managementGroupId, String networkManagerConnectionName) { + deleteWithResponse(managementGroupId, networkManagerConnectionName, Context.NONE); + } + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String managementGroupId, + Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), managementGroupId, apiVersion, top, + skipToken, accept, context)) + .>map(res -> new 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 network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String managementGroupId, + Integer top, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), managementGroupId, apiVersion, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String managementGroupId, Integer top, + String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management 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 network manager connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String managementGroupId) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String managementGroupId, Integer top, String skipToken, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management 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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String managementGroupId) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(managementGroupId, top, skipToken)); + } + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String managementGroupId, Integer top, String skipToken, + Context context) { + return new PagedIterable<>(listAsync(managementGroupId, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsImpl.java new file mode 100644 index 0000000000000..f317c8285f0ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ManagementGroupNetworkManagerConnectionsImpl.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.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.ManagementGroupNetworkManagerConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; +import com.azure.resourcemanager.network.generated.models.ManagementGroupNetworkManagerConnections; +import com.azure.resourcemanager.network.generated.models.NetworkManagerConnection; + +public final class ManagementGroupNetworkManagerConnectionsImpl implements ManagementGroupNetworkManagerConnections { + private static final ClientLogger LOGGER = new ClientLogger(ManagementGroupNetworkManagerConnectionsImpl.class); + + private final ManagementGroupNetworkManagerConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ManagementGroupNetworkManagerConnectionsImpl(ManagementGroupNetworkManagerConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response createOrUpdateWithResponse(String managementGroupId, + String networkManagerConnectionName, NetworkManagerConnectionInner parameters, Context context) { + Response inner = this.serviceClient() + .createOrUpdateWithResponse(managementGroupId, networkManagerConnectionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManagerConnection createOrUpdate(String managementGroupId, String networkManagerConnectionName, + NetworkManagerConnectionInner parameters) { + NetworkManagerConnectionInner inner + = this.serviceClient().createOrUpdate(managementGroupId, networkManagerConnectionName, parameters); + if (inner != null) { + return new NetworkManagerConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String managementGroupId, + String networkManagerConnectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(managementGroupId, networkManagerConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManagerConnection get(String managementGroupId, String networkManagerConnectionName) { + NetworkManagerConnectionInner inner = this.serviceClient().get(managementGroupId, networkManagerConnectionName); + if (inner != null) { + return new NetworkManagerConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String managementGroupId, + String networkManagerConnectionName, Context context) { + return this.serviceClient().deleteWithResponse(managementGroupId, networkManagerConnectionName, context); + } + + public void deleteByResourceGroup(String managementGroupId, String networkManagerConnectionName) { + this.serviceClient().delete(managementGroupId, networkManagerConnectionName); + } + + public PagedIterable list(String managementGroupId) { + PagedIterable inner = this.serviceClient().list(managementGroupId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String managementGroupId, Integer top, String skipToken, + Context context) { + PagedIterable inner + = this.serviceClient().list(managementGroupId, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerConnectionImpl(inner1, this.manager())); + } + + private ManagementGroupNetworkManagerConnectionsClient 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/MigratedPoolsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/MigratedPoolsImpl.java new file mode 100644 index 0000000000000..ded75abab1631 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/MigratedPoolsImpl.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.MigratedPoolsInner; +import com.azure.resourcemanager.network.generated.models.MigratedPools; +import java.util.Collections; +import java.util.List; + +public final class MigratedPoolsImpl implements MigratedPools { + private MigratedPoolsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + MigratedPoolsImpl(MigratedPoolsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List migratedPools() { + List inner = this.innerModel().migratedPools(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MigratedPoolsInner 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/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..78bd751042ef8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewayImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.natGatewayName = ResourceManagerUtils.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..719167ee7d82a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysClientImpl.java @@ -0,0 +1,1188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String natGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String natGatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String natGatewayName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, natGatewayName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String natGatewayName, + String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, natGatewayName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, natGatewayName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NatGatewayInner> beginCreateOrUpdate(String resourceGroupName, + String natGatewayName, NatGatewayInner parameters) { + return this.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 the {@link SyncPoller} for polling of nat Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NatGatewayInner> beginCreateOrUpdate(String resourceGroupName, + String natGatewayName, NatGatewayInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String natGatewayName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, natGatewayName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String natGatewayName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public NatGatewayInner updateTags(String resourceGroupName, String natGatewayName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, natGatewayName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNatGateways API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNatGateways API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNatGateways API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..302710dad9ce4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatGatewaysImpl.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.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; + +public final class NatGatewaysImpl implements NatGateways { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NatGatewayImpl(inner1, this.manager())); + } + + public NatGateway getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String natGatewayName = ResourceManagerUtils.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..1f86d8abab010 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesClientImpl.java @@ -0,0 +1,933 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String gatewayName, String natRuleName) { + return getWithResponseAsync(resourceGroupName, gatewayName, natRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String gatewayName, + String natRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, gatewayName, natRuleName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, gatewayName, natRuleName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters) { + return this.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 the {@link SyncPoller} for polling of vpnGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayNatRuleInner> beginCreateOrUpdate( + String resourceGroupName, String gatewayName, String natRuleName, VpnGatewayNatRuleInner natRuleParameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, + String natRuleName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, + String natRuleName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual wan vpn gateway along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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..9c392993755f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NatRulesImpl.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.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; + +public final class NatRulesImpl implements NatRules { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new VpnGatewayNatRuleImpl(inner1, this.manager())); + } + + public VpnGatewayNatRule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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..ca2fe1530f91a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkConfigurationDiagnosticResponseImpl.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.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/NetworkGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupImpl.java new file mode 100644 index 0000000000000..15b28fcaa3acc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; +import com.azure.resourcemanager.network.generated.models.GroupMemberType; +import com.azure.resourcemanager.network.generated.models.NetworkGroup; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class NetworkGroupImpl implements NetworkGroup, NetworkGroup.Definition, NetworkGroup.Update { + private NetworkGroupInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public GroupMemberType memberType() { + return this.innerModel().memberType(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String networkGroupName; + + private String createIfMatch; + + private String updateIfMatch; + + public NetworkGroupImpl withExistingNetworkManager(String resourceGroupName, String networkManagerName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + return this; + } + + public NetworkGroup create() { + this.innerObject = serviceManager.serviceClient() + .getNetworkGroups() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, this.innerModel(), + createIfMatch, Context.NONE) + .getValue(); + return this; + } + + public NetworkGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkGroups() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, this.innerModel(), + createIfMatch, context) + .getValue(); + return this; + } + + NetworkGroupImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkGroupInner(); + this.serviceManager = serviceManager; + this.networkGroupName = name; + this.createIfMatch = null; + } + + public NetworkGroupImpl update() { + this.updateIfMatch = null; + return this; + } + + public NetworkGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getNetworkGroups() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, this.innerModel(), + updateIfMatch, Context.NONE) + .getValue(); + return this; + } + + public NetworkGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkGroups() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, this.innerModel(), + updateIfMatch, context) + .getValue(); + return this; + } + + NetworkGroupImpl(NetworkGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.networkGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkGroups"); + } + + public NetworkGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getNetworkGroups() + .getWithResponse(resourceGroupName, networkManagerName, networkGroupName, Context.NONE) + .getValue(); + return this; + } + + public NetworkGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkGroups() + .getWithResponse(resourceGroupName, networkManagerName, networkGroupName, context) + .getValue(); + return this; + } + + public NetworkGroupImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public NetworkGroupImpl withMemberType(GroupMemberType memberType) { + this.innerModel().withMemberType(memberType); + return this; + } + + public NetworkGroupImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.createIfMatch = ifMatch; + return this; + } else { + this.updateIfMatch = ifMatch; + 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/NetworkGroupsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsClientImpl.java new file mode 100644 index 0000000000000..ae6f60acfcb41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsClientImpl.java @@ -0,0 +1,962 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; +import com.azure.resourcemanager.network.generated.models.NetworkGroupListResult; +import com.azure.resourcemanager.network.generated.models.NetworkGroupsCreateOrUpdateResponse; +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 NetworkGroupsClient. + */ +public final class NetworkGroupsClientImpl implements NetworkGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkGroupsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkGroupsClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(NetworkGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkGroups to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface NetworkGroupsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("networkGroupName") String networkGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("networkGroupName") String networkGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("If-Match") String ifMatch, @BodyParam("application/json") NetworkGroupInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("networkGroupName") String networkGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @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 network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String networkGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, networkGroupName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 specified network group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, networkGroupName, apiVersion, accept, context); + } + + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String networkGroupName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 specified network group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, context).block(); + } + + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkGroupInner get(String resourceGroupName, String networkManagerName, String networkGroupName) { + return getWithResponse(resourceGroupName, networkManagerName, networkGroupName, Context.NONE).getValue(); + } + + /** + * Creates or updates a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param parameters Parameters supplied to the specify which network group need to create. + * @param ifMatch The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, NetworkGroupInner parameters, String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, networkGroupName, apiVersion, ifMatch, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param parameters Parameters supplied to the specify which network group need to create. + * @param ifMatch The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, NetworkGroupInner parameters, String ifMatch, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, networkGroupName, apiVersion, ifMatch, parameters, accept, context); + } + + /** + * Creates or updates a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param parameters Parameters supplied to the specify which network group need to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network group resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, NetworkGroupInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, parameters, + ifMatch).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param parameters Parameters supplied to the specify which network group need to create. + * @param ifMatch The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + * the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkGroupsCreateOrUpdateResponse createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String networkGroupName, NetworkGroupInner parameters, String ifMatch, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, parameters, + ifMatch, context).block(); + } + + /** + * Creates or updates a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param parameters Parameters supplied to the specify which network group need to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the network group resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkGroupInner createOrUpdate(String resourceGroupName, String networkManagerName, + String networkGroupName, NetworkGroupInner parameters) { + final String ifMatch = null; + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, parameters, ifMatch, + Context.NONE).getValue(); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, networkGroupName, apiVersion, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, Boolean force, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, networkGroupName, apiVersion, force, accept, context); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String networkGroupName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String networkGroupName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).getSyncPoller(); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String networkGroupName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force, context) + .getSyncPoller(); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String networkGroupName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String networkGroupName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String networkGroupName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, networkGroupName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 networkManagerName, String networkGroupName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, networkGroupName, force).block(); + } + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String networkGroupName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, networkManagerName, networkGroupName, force, context).block(); + } + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, apiVersion, top, skipToken, accept, context)) + .>map(res -> new 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 the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, networkManagerName, + apiVersion, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, Integer top, + String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken)); + } + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list NetworkGroup along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkGroup along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsImpl.java new file mode 100644 index 0000000000000..856ffcc67c950 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkGroupsImpl.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.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.NetworkGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; +import com.azure.resourcemanager.network.generated.models.NetworkGroup; +import com.azure.resourcemanager.network.generated.models.NetworkGroups; + +public final class NetworkGroupsImpl implements NetworkGroups { + private static final ClientLogger LOGGER = new ClientLogger(NetworkGroupsImpl.class); + + private final NetworkGroupsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkGroupsImpl(NetworkGroupsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, networkManagerName, networkGroupName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkGroup get(String resourceGroupName, String networkManagerName, String networkGroupName) { + NetworkGroupInner inner = this.serviceClient().get(resourceGroupName, networkManagerName, networkGroupName); + if (inner != null) { + return new NetworkGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String networkGroupName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, networkGroupName); + } + + public void delete(String resourceGroupName, String networkManagerName, String networkGroupName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, networkManagerName, networkGroupName, force, context); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkManagerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkGroupImpl(inner1, this.manager())); + } + + public NetworkGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, networkGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, networkGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, networkGroupName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + this.delete(resourceGroupName, networkManagerName, networkGroupName, force, context); + } + + private NetworkGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkGroupImpl define(String name) { + return new NetworkGroupImpl(name, this.manager()); + } +} 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..70392b7b255f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceImpl.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceAuxiliarySku; +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 String id() { + return this.innerModel().id(); + } + + 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 vnetEncryptionSupported() { + return this.innerModel().vnetEncryptionSupported(); + } + + public Boolean enableAcceleratedNetworking() { + return this.innerModel().enableAcceleratedNetworking(); + } + + public Boolean disableTcpStateTracking() { + return this.innerModel().disableTcpStateTracking(); + } + + 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 NetworkInterfaceAuxiliaryMode auxiliaryMode() { + return this.innerModel().auxiliaryMode(); + } + + public NetworkInterfaceAuxiliarySku auxiliarySku() { + return this.innerModel().auxiliarySku(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = ResourceManagerUtils.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 withDisableTcpStateTracking(Boolean disableTcpStateTracking) { + this.innerModel().withDisableTcpStateTracking(disableTcpStateTracking); + 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; + } + + public NetworkInterfaceImpl withAuxiliaryMode(NetworkInterfaceAuxiliaryMode auxiliaryMode) { + this.innerModel().withAuxiliaryMode(auxiliaryMode); + return this; + } + + public NetworkInterfaceImpl withAuxiliarySku(NetworkInterfaceAuxiliarySku auxiliarySku) { + this.innerModel().withAuxiliarySku(auxiliarySku); + 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..daf93b9c47f8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationImpl.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.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 Integer privateIpAddressPrefixLength() { + return this.innerModel().privateIpAddressPrefixLength(); + } + + 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/NetworkInterfaceIpConfigurationPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationPropertiesFormatImpl.java new file mode 100644 index 0000000000000..e5fad7f694816 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationPropertiesFormatImpl.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.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.NetworkInterfaceIpConfigurationPropertiesFormatInner; +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.NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceIpConfigurationPropertiesFormat; +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 NetworkInterfaceIpConfigurationPropertiesFormatImpl + implements NetworkInterfaceIpConfigurationPropertiesFormat { + private NetworkInterfaceIpConfigurationPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkInterfaceIpConfigurationPropertiesFormatImpl( + NetworkInterfaceIpConfigurationPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 Integer privateIpAddressPrefixLength() { + return this.innerModel().privateIpAddressPrefixLength(); + } + + 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 NetworkInterfaceIpConfigurationPropertiesFormatInner 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..e9ffeea70a3f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsClientImpl.java @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkInterfaceName, + String ipConfigurationName) { + return getWithResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkInterfaceName, String ipConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, networkInterfaceName, ipConfigurationName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getWithResponse(resourceGroupName, networkInterfaceName, ipConfigurationName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..aa1e194675cb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceIpConfigurationsImpl.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.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; + +public final class NetworkInterfaceIpConfigurationsImpl implements NetworkInterfaceIpConfigurations { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + 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; + } + } + + 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; + } + } + + 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..dad00a615435d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..aad4a1bd035aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceLoadBalancersImpl.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.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; + +public final class NetworkInterfaceLoadBalancersImpl implements NetworkInterfaceLoadBalancers { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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/NetworkInterfacePropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacePropertiesFormatImpl.java new file mode 100644 index 0000000000000..2b0c85d4b7f6a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacePropertiesFormatImpl.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.NetworkInterfaceIpConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfacePropertiesFormatInner; +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.NetworkInterfaceAuxiliaryMode; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceAuxiliarySku; +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.NetworkInterfacePropertiesFormat; +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 java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class NetworkInterfacePropertiesFormatImpl implements NetworkInterfacePropertiesFormat { + private NetworkInterfacePropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkInterfacePropertiesFormatImpl(NetworkInterfacePropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 vnetEncryptionSupported() { + return this.innerModel().vnetEncryptionSupported(); + } + + public Boolean enableAcceleratedNetworking() { + return this.innerModel().enableAcceleratedNetworking(); + } + + public Boolean disableTcpStateTracking() { + return this.innerModel().disableTcpStateTracking(); + } + + 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 NetworkInterfaceAuxiliaryMode auxiliaryMode() { + return this.innerModel().auxiliaryMode(); + } + + public NetworkInterfaceAuxiliarySku auxiliarySku() { + return this.innerModel().auxiliarySku(); + } + + public NetworkInterfacePropertiesFormatInner 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/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..92188d9c21806 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkInterfaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkInterfaces"); + this.tapConfigurationName = ResourceManagerUtils.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/NetworkInterfaceTapConfigurationPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationPropertiesFormatImpl.java new file mode 100644 index 0000000000000..e55250edc70cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationPropertiesFormatImpl.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.NetworkInterfaceTapConfigurationPropertiesFormatInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import com.azure.resourcemanager.network.generated.models.NetworkInterfaceTapConfigurationPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; + +public final class NetworkInterfaceTapConfigurationPropertiesFormatImpl + implements NetworkInterfaceTapConfigurationPropertiesFormat { + private NetworkInterfaceTapConfigurationPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkInterfaceTapConfigurationPropertiesFormatImpl( + NetworkInterfaceTapConfigurationPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 NetworkInterfaceTapConfigurationPropertiesFormatInner 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/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..81b514e09ff8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsClientImpl.java @@ -0,0 +1,975 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName, + String tapConfigurationName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName, + String tapConfigurationName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkInterfaceName, + String tapConfigurationName) { + return getWithResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkInterfaceName, String tapConfigurationName, Context context) { + return getWithResponseAsync(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) + public NetworkInterfaceTapConfigurationInner get(String resourceGroupName, String networkInterfaceName, + String tapConfigurationName) { + return getWithResponse(resourceGroupName, networkInterfaceName, tapConfigurationName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters) { + return this + .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 the {@link SyncPoller} for polling of tap configuration in a Network Interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceTapConfigurationInner> + beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, + NetworkInterfaceTapConfigurationInner tapConfigurationParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list tap configurations API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..fe689cafe1eb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfaceTapConfigurationsImpl.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.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; + +public final class NetworkInterfaceTapConfigurationsImpl implements NetworkInterfaceTapConfigurations { + private static 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 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 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 PagedIterable list(String resourceGroupName, String networkInterfaceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkInterfaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkInterfaceTapConfigurationImpl(inner1, this.manager())); + } + + public NetworkInterfaceTapConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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 = ResourceManagerUtils.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..cea976776ab68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesClientImpl.java @@ -0,0 +1,3493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 getCloudServiceNetworkInterfaceWithResponse(resourceGroupName, cloudServiceName, roleInstanceName, + networkInterfaceName, expand, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkInterfaceName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkInterfaceName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String networkInterfaceName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkInterfaceName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, networkInterfaceName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> + beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return this.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 the {@link SyncPoller} for polling of a network interface in a resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkInterfaceInner> beginCreateOrUpdate( + String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String networkInterfaceName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkInterfaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String networkInterfaceName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public NetworkInterfaceInner updateTags(String resourceGroupName, String networkInterfaceName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, networkInterfaceName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteListResultInner> + beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) { + return this.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 the {@link SyncPoller} for polling of all route tables applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteListResultInner> + beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + Mono>> mono + = listEffectiveNetworkSecurityGroupsWithResponseAsync(resourceGroupName, networkInterfaceName); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), EffectiveNetworkSecurityGroupListResultInner.class, + EffectiveNetworkSecurityGroupListResultInner.class, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 the {@link SyncPoller} for polling of all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) { + return this.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 the {@link SyncPoller} for polling of all network security groups applied to a network interface. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, EffectiveNetworkSecurityGroupListResultInner> + beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated + * response with {@link PagedFlux}. + */ + @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 as paginated + * response with {@link PagedFlux}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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 as paginated + * response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getVirtualMachineScaleSetNetworkInterfaceWithResponse(resourceGroupName, virtualMachineScaleSetName, + virtualmachineIndex, networkInterfaceName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response + * with {@link PagedFlux}. + */ + @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 as paginated response + * with {@link PagedFlux}. + */ + @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 as paginated response + * with {@link PagedFlux}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion + * of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @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 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 getVirtualMachineScaleSetIpConfigurationWithResponse(resourceGroupName, virtualMachineScaleSetName, + virtualmachineIndex, networkInterfaceName, ipConfigurationName, expand, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListNetworkInterface API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for list ip configurations API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..c41f867c5332d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkInterfacesImpl.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.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; + +public final class NetworkInterfacesImpl implements NetworkInterfaces { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listCloudServiceNetworkInterfaces(String resourceGroupName, + String cloudServiceName) { + PagedIterable inner + = this.serviceClient().listCloudServiceNetworkInterfaces(resourceGroupName, cloudServiceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + 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 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 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + public PagedIterable listVirtualMachineScaleSetNetworkInterfaces(String resourceGroupName, + String virtualMachineScaleSetName) { + PagedIterable inner = this.serviceClient() + .listVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkInterfaceImpl(inner1, this.manager())); + } + + 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 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 PagedIterable listVirtualMachineScaleSetIpConfigurations( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, + String networkInterfaceName) { + PagedIterable inner = this.serviceClient() + .listVirtualMachineScaleSetIpConfigurations(resourceGroupName, virtualMachineScaleSetName, + virtualmachineIndex, networkInterfaceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkInterfaceIpConfigurationImpl(inner1, this.manager())); + } + + 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 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 NetworkInterface getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkInterfaceName = ResourceManagerUtils.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..6fd47ae92b23d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientBuilder.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.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the 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 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 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 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() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + NetworkManagementClientImpl client = new NetworkManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + 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..f54e4408cfb36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagementClientImpl.java @@ -0,0 +1,2520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.network.generated.fluent.AdminRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.AdminRulesClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayPrivateLinkResourcesClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayWafDynamicManifestsClient; +import com.azure.resourcemanager.network.generated.fluent.ApplicationGatewayWafDynamicManifestsDefaultsClient; +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.ConfigurationPolicyGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.ConnectionMonitorsClient; +import com.azure.resourcemanager.network.generated.fluent.ConnectivityConfigurationsClient; +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.ExpressRoutePortAuthorizationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRoutePortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteProviderPortsLocationsClient; +import com.azure.resourcemanager.network.generated.fluent.ExpressRouteServiceProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPoliciesClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyDeploymentsClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyDraftsClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesFilterValuesClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyIdpsSignaturesOverridesClient; +import com.azure.resourcemanager.network.generated.fluent.FirewallPolicyRuleCollectionGroupDraftsClient; +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.ManagementGroupNetworkManagerConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.NatGatewaysClient; +import com.azure.resourcemanager.network.generated.fluent.NatRulesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkGroupsClient; +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.NetworkManagerCommitsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagerDeploymentStatusOperationsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagerRoutingConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagersClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkSecurityGroupsClient; +import com.azure.resourcemanager.network.generated.fluent.NetworkVirtualApplianceConnectionsClient; +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.RouteMapsClient; +import com.azure.resourcemanager.network.generated.fluent.RouteTablesClient; +import com.azure.resourcemanager.network.generated.fluent.RoutesClient; +import com.azure.resourcemanager.network.generated.fluent.RoutingIntentsClient; +import com.azure.resourcemanager.network.generated.fluent.RoutingRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.RoutingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.ScopeConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityAdminConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityPartnerProvidersClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityRulesClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityUserConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityUserRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.SecurityUserRulesClient; +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.ServiceTagInformationsClient; +import com.azure.resourcemanager.network.generated.fluent.ServiceTagsClient; +import com.azure.resourcemanager.network.generated.fluent.StaticMembersClient; +import com.azure.resourcemanager.network.generated.fluent.SubnetsClient; +import com.azure.resourcemanager.network.generated.fluent.SubscriptionNetworkManagerConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.UsagesClient; +import com.azure.resourcemanager.network.generated.fluent.VipSwapsClient; +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 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 { + /** + * 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 ApplicationGatewayWafDynamicManifestsDefaultsClient object to access its operations. + */ + private final ApplicationGatewayWafDynamicManifestsDefaultsClient applicationGatewayWafDynamicManifestsDefaults; + + /** + * Gets the ApplicationGatewayWafDynamicManifestsDefaultsClient object to access its operations. + * + * @return the ApplicationGatewayWafDynamicManifestsDefaultsClient object. + */ + public ApplicationGatewayWafDynamicManifestsDefaultsClient getApplicationGatewayWafDynamicManifestsDefaults() { + return this.applicationGatewayWafDynamicManifestsDefaults; + } + + /** + * The ApplicationGatewayWafDynamicManifestsClient object to access its operations. + */ + private final ApplicationGatewayWafDynamicManifestsClient applicationGatewayWafDynamicManifests; + + /** + * Gets the ApplicationGatewayWafDynamicManifestsClient object to access its operations. + * + * @return the ApplicationGatewayWafDynamicManifestsClient object. + */ + public ApplicationGatewayWafDynamicManifestsClient getApplicationGatewayWafDynamicManifests() { + return this.applicationGatewayWafDynamicManifests; + } + + /** + * 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 VipSwapsClient object to access its operations. + */ + private final VipSwapsClient vipSwaps; + + /** + * Gets the VipSwapsClient object to access its operations. + * + * @return the VipSwapsClient object. + */ + public VipSwapsClient getVipSwaps() { + return this.vipSwaps; + } + + /** + * 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 ExpressRoutePortAuthorizationsClient object to access its operations. + */ + private final ExpressRoutePortAuthorizationsClient expressRoutePortAuthorizations; + + /** + * Gets the ExpressRoutePortAuthorizationsClient object to access its operations. + * + * @return the ExpressRoutePortAuthorizationsClient object. + */ + public ExpressRoutePortAuthorizationsClient getExpressRoutePortAuthorizations() { + return this.expressRoutePortAuthorizations; + } + + /** + * The ExpressRouteProviderPortsLocationsClient object to access its operations. + */ + private final ExpressRouteProviderPortsLocationsClient expressRouteProviderPortsLocations; + + /** + * Gets the ExpressRouteProviderPortsLocationsClient object to access its operations. + * + * @return the ExpressRouteProviderPortsLocationsClient object. + */ + public ExpressRouteProviderPortsLocationsClient getExpressRouteProviderPortsLocations() { + return this.expressRouteProviderPortsLocations; + } + + /** + * 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 FirewallPolicyIdpsSignaturesClient object to access its operations. + */ + private final FirewallPolicyIdpsSignaturesClient firewallPolicyIdpsSignatures; + + /** + * Gets the FirewallPolicyIdpsSignaturesClient object to access its operations. + * + * @return the FirewallPolicyIdpsSignaturesClient object. + */ + public FirewallPolicyIdpsSignaturesClient getFirewallPolicyIdpsSignatures() { + return this.firewallPolicyIdpsSignatures; + } + + /** + * The FirewallPolicyIdpsSignaturesOverridesClient object to access its operations. + */ + private final FirewallPolicyIdpsSignaturesOverridesClient firewallPolicyIdpsSignaturesOverrides; + + /** + * Gets the FirewallPolicyIdpsSignaturesOverridesClient object to access its operations. + * + * @return the FirewallPolicyIdpsSignaturesOverridesClient object. + */ + public FirewallPolicyIdpsSignaturesOverridesClient getFirewallPolicyIdpsSignaturesOverrides() { + return this.firewallPolicyIdpsSignaturesOverrides; + } + + /** + * The FirewallPolicyIdpsSignaturesFilterValuesClient object to access its operations. + */ + private final FirewallPolicyIdpsSignaturesFilterValuesClient firewallPolicyIdpsSignaturesFilterValues; + + /** + * Gets the FirewallPolicyIdpsSignaturesFilterValuesClient object to access its operations. + * + * @return the FirewallPolicyIdpsSignaturesFilterValuesClient object. + */ + public FirewallPolicyIdpsSignaturesFilterValuesClient getFirewallPolicyIdpsSignaturesFilterValues() { + return this.firewallPolicyIdpsSignaturesFilterValues; + } + + /** + * The FirewallPolicyDraftsClient object to access its operations. + */ + private final FirewallPolicyDraftsClient firewallPolicyDrafts; + + /** + * Gets the FirewallPolicyDraftsClient object to access its operations. + * + * @return the FirewallPolicyDraftsClient object. + */ + public FirewallPolicyDraftsClient getFirewallPolicyDrafts() { + return this.firewallPolicyDrafts; + } + + /** + * The FirewallPolicyDeploymentsClient object to access its operations. + */ + private final FirewallPolicyDeploymentsClient firewallPolicyDeployments; + + /** + * Gets the FirewallPolicyDeploymentsClient object to access its operations. + * + * @return the FirewallPolicyDeploymentsClient object. + */ + public FirewallPolicyDeploymentsClient getFirewallPolicyDeployments() { + return this.firewallPolicyDeployments; + } + + /** + * The FirewallPolicyRuleCollectionGroupDraftsClient object to access its operations. + */ + private final FirewallPolicyRuleCollectionGroupDraftsClient firewallPolicyRuleCollectionGroupDrafts; + + /** + * Gets the FirewallPolicyRuleCollectionGroupDraftsClient object to access its operations. + * + * @return the FirewallPolicyRuleCollectionGroupDraftsClient object. + */ + public FirewallPolicyRuleCollectionGroupDraftsClient getFirewallPolicyRuleCollectionGroupDrafts() { + return this.firewallPolicyRuleCollectionGroupDrafts; + } + + /** + * 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 NetworkManagersClient object to access its operations. + */ + private final NetworkManagersClient networkManagers; + + /** + * Gets the NetworkManagersClient object to access its operations. + * + * @return the NetworkManagersClient object. + */ + public NetworkManagersClient getNetworkManagers() { + return this.networkManagers; + } + + /** + * The NetworkManagerCommitsClient object to access its operations. + */ + private final NetworkManagerCommitsClient networkManagerCommits; + + /** + * Gets the NetworkManagerCommitsClient object to access its operations. + * + * @return the NetworkManagerCommitsClient object. + */ + public NetworkManagerCommitsClient getNetworkManagerCommits() { + return this.networkManagerCommits; + } + + /** + * The NetworkManagerDeploymentStatusOperationsClient object to access its operations. + */ + private final NetworkManagerDeploymentStatusOperationsClient networkManagerDeploymentStatusOperations; + + /** + * Gets the NetworkManagerDeploymentStatusOperationsClient object to access its operations. + * + * @return the NetworkManagerDeploymentStatusOperationsClient object. + */ + public NetworkManagerDeploymentStatusOperationsClient getNetworkManagerDeploymentStatusOperations() { + return this.networkManagerDeploymentStatusOperations; + } + + /** + * The SubscriptionNetworkManagerConnectionsClient object to access its operations. + */ + private final SubscriptionNetworkManagerConnectionsClient subscriptionNetworkManagerConnections; + + /** + * Gets the SubscriptionNetworkManagerConnectionsClient object to access its operations. + * + * @return the SubscriptionNetworkManagerConnectionsClient object. + */ + public SubscriptionNetworkManagerConnectionsClient getSubscriptionNetworkManagerConnections() { + return this.subscriptionNetworkManagerConnections; + } + + /** + * The ManagementGroupNetworkManagerConnectionsClient object to access its operations. + */ + private final ManagementGroupNetworkManagerConnectionsClient managementGroupNetworkManagerConnections; + + /** + * Gets the ManagementGroupNetworkManagerConnectionsClient object to access its operations. + * + * @return the ManagementGroupNetworkManagerConnectionsClient object. + */ + public ManagementGroupNetworkManagerConnectionsClient getManagementGroupNetworkManagerConnections() { + return this.managementGroupNetworkManagerConnections; + } + + /** + * The ConnectivityConfigurationsClient object to access its operations. + */ + private final ConnectivityConfigurationsClient connectivityConfigurations; + + /** + * Gets the ConnectivityConfigurationsClient object to access its operations. + * + * @return the ConnectivityConfigurationsClient object. + */ + public ConnectivityConfigurationsClient getConnectivityConfigurations() { + return this.connectivityConfigurations; + } + + /** + * The NetworkGroupsClient object to access its operations. + */ + private final NetworkGroupsClient networkGroups; + + /** + * Gets the NetworkGroupsClient object to access its operations. + * + * @return the NetworkGroupsClient object. + */ + public NetworkGroupsClient getNetworkGroups() { + return this.networkGroups; + } + + /** + * The StaticMembersClient object to access its operations. + */ + private final StaticMembersClient staticMembers; + + /** + * Gets the StaticMembersClient object to access its operations. + * + * @return the StaticMembersClient object. + */ + public StaticMembersClient getStaticMembers() { + return this.staticMembers; + } + + /** + * The ScopeConnectionsClient object to access its operations. + */ + private final ScopeConnectionsClient scopeConnections; + + /** + * Gets the ScopeConnectionsClient object to access its operations. + * + * @return the ScopeConnectionsClient object. + */ + public ScopeConnectionsClient getScopeConnections() { + return this.scopeConnections; + } + + /** + * The SecurityAdminConfigurationsClient object to access its operations. + */ + private final SecurityAdminConfigurationsClient securityAdminConfigurations; + + /** + * Gets the SecurityAdminConfigurationsClient object to access its operations. + * + * @return the SecurityAdminConfigurationsClient object. + */ + public SecurityAdminConfigurationsClient getSecurityAdminConfigurations() { + return this.securityAdminConfigurations; + } + + /** + * The AdminRuleCollectionsClient object to access its operations. + */ + private final AdminRuleCollectionsClient adminRuleCollections; + + /** + * Gets the AdminRuleCollectionsClient object to access its operations. + * + * @return the AdminRuleCollectionsClient object. + */ + public AdminRuleCollectionsClient getAdminRuleCollections() { + return this.adminRuleCollections; + } + + /** + * The AdminRulesClient object to access its operations. + */ + private final AdminRulesClient adminRules; + + /** + * Gets the AdminRulesClient object to access its operations. + * + * @return the AdminRulesClient object. + */ + public AdminRulesClient getAdminRules() { + return this.adminRules; + } + + /** + * The SecurityUserConfigurationsClient object to access its operations. + */ + private final SecurityUserConfigurationsClient securityUserConfigurations; + + /** + * Gets the SecurityUserConfigurationsClient object to access its operations. + * + * @return the SecurityUserConfigurationsClient object. + */ + public SecurityUserConfigurationsClient getSecurityUserConfigurations() { + return this.securityUserConfigurations; + } + + /** + * The SecurityUserRuleCollectionsClient object to access its operations. + */ + private final SecurityUserRuleCollectionsClient securityUserRuleCollections; + + /** + * Gets the SecurityUserRuleCollectionsClient object to access its operations. + * + * @return the SecurityUserRuleCollectionsClient object. + */ + public SecurityUserRuleCollectionsClient getSecurityUserRuleCollections() { + return this.securityUserRuleCollections; + } + + /** + * The SecurityUserRulesClient object to access its operations. + */ + private final SecurityUserRulesClient securityUserRules; + + /** + * Gets the SecurityUserRulesClient object to access its operations. + * + * @return the SecurityUserRulesClient object. + */ + public SecurityUserRulesClient getSecurityUserRules() { + return this.securityUserRules; + } + + /** + * The NetworkManagerRoutingConfigurationsClient object to access its operations. + */ + private final NetworkManagerRoutingConfigurationsClient networkManagerRoutingConfigurations; + + /** + * Gets the NetworkManagerRoutingConfigurationsClient object to access its operations. + * + * @return the NetworkManagerRoutingConfigurationsClient object. + */ + public NetworkManagerRoutingConfigurationsClient getNetworkManagerRoutingConfigurations() { + return this.networkManagerRoutingConfigurations; + } + + /** + * The RoutingRuleCollectionsClient object to access its operations. + */ + private final RoutingRuleCollectionsClient routingRuleCollections; + + /** + * Gets the RoutingRuleCollectionsClient object to access its operations. + * + * @return the RoutingRuleCollectionsClient object. + */ + public RoutingRuleCollectionsClient getRoutingRuleCollections() { + return this.routingRuleCollections; + } + + /** + * The RoutingRulesClient object to access its operations. + */ + private final RoutingRulesClient routingRules; + + /** + * Gets the RoutingRulesClient object to access its operations. + * + * @return the RoutingRulesClient object. + */ + public RoutingRulesClient getRoutingRules() { + return this.routingRules; + } + + /** + * 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 ServiceTagInformationsClient object to access its operations. + */ + private final ServiceTagInformationsClient serviceTagInformations; + + /** + * Gets the ServiceTagInformationsClient object to access its operations. + * + * @return the ServiceTagInformationsClient object. + */ + public ServiceTagInformationsClient getServiceTagInformations() { + return this.serviceTagInformations; + } + + /** + * 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 ConfigurationPolicyGroupsClient object to access its operations. + */ + private final ConfigurationPolicyGroupsClient configurationPolicyGroups; + + /** + * Gets the ConfigurationPolicyGroupsClient object to access its operations. + * + * @return the ConfigurationPolicyGroupsClient object. + */ + public ConfigurationPolicyGroupsClient getConfigurationPolicyGroups() { + return this.configurationPolicyGroups; + } + + /** + * 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 RouteMapsClient object to access its operations. + */ + private final RouteMapsClient routeMaps; + + /** + * Gets the RouteMapsClient object to access its operations. + * + * @return the RouteMapsClient object. + */ + public RouteMapsClient getRouteMaps() { + return this.routeMaps; + } + + /** + * 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 NetworkVirtualApplianceConnectionsClient object to access its operations. + */ + private final NetworkVirtualApplianceConnectionsClient networkVirtualApplianceConnections; + + /** + * Gets the NetworkVirtualApplianceConnectionsClient object to access its operations. + * + * @return the NetworkVirtualApplianceConnectionsClient object. + */ + public NetworkVirtualApplianceConnectionsClient getNetworkVirtualApplianceConnections() { + return this.networkVirtualApplianceConnections; + } + + /** + * 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 RoutingIntentsClient object to access its operations. + */ + private final RoutingIntentsClient routingIntents; + + /** + * Gets the RoutingIntentsClient object to access its operations. + * + * @return the RoutingIntentsClient object. + */ + public RoutingIntentsClient getRoutingIntents() { + return this.routingIntents; + } + + /** + * 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.applicationGatewayWafDynamicManifestsDefaults + = new ApplicationGatewayWafDynamicManifestsDefaultsClientImpl(this); + this.applicationGatewayWafDynamicManifests = new ApplicationGatewayWafDynamicManifestsClientImpl(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.vipSwaps = new VipSwapsClientImpl(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.expressRoutePortAuthorizations = new ExpressRoutePortAuthorizationsClientImpl(this); + this.expressRouteProviderPortsLocations = new ExpressRouteProviderPortsLocationsClientImpl(this); + this.firewallPolicies = new FirewallPoliciesClientImpl(this); + this.firewallPolicyRuleCollectionGroups = new FirewallPolicyRuleCollectionGroupsClientImpl(this); + this.firewallPolicyIdpsSignatures = new FirewallPolicyIdpsSignaturesClientImpl(this); + this.firewallPolicyIdpsSignaturesOverrides = new FirewallPolicyIdpsSignaturesOverridesClientImpl(this); + this.firewallPolicyIdpsSignaturesFilterValues = new FirewallPolicyIdpsSignaturesFilterValuesClientImpl(this); + this.firewallPolicyDrafts = new FirewallPolicyDraftsClientImpl(this); + this.firewallPolicyDeployments = new FirewallPolicyDeploymentsClientImpl(this); + this.firewallPolicyRuleCollectionGroupDrafts = new FirewallPolicyRuleCollectionGroupDraftsClientImpl(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.networkManagers = new NetworkManagersClientImpl(this); + this.networkManagerCommits = new NetworkManagerCommitsClientImpl(this); + this.networkManagerDeploymentStatusOperations = new NetworkManagerDeploymentStatusOperationsClientImpl(this); + this.subscriptionNetworkManagerConnections = new SubscriptionNetworkManagerConnectionsClientImpl(this); + this.managementGroupNetworkManagerConnections = new ManagementGroupNetworkManagerConnectionsClientImpl(this); + this.connectivityConfigurations = new ConnectivityConfigurationsClientImpl(this); + this.networkGroups = new NetworkGroupsClientImpl(this); + this.staticMembers = new StaticMembersClientImpl(this); + this.scopeConnections = new ScopeConnectionsClientImpl(this); + this.securityAdminConfigurations = new SecurityAdminConfigurationsClientImpl(this); + this.adminRuleCollections = new AdminRuleCollectionsClientImpl(this); + this.adminRules = new AdminRulesClientImpl(this); + this.securityUserConfigurations = new SecurityUserConfigurationsClientImpl(this); + this.securityUserRuleCollections = new SecurityUserRuleCollectionsClientImpl(this); + this.securityUserRules = new SecurityUserRulesClientImpl(this); + this.networkManagerRoutingConfigurations = new NetworkManagerRoutingConfigurationsClientImpl(this); + this.routingRuleCollections = new RoutingRuleCollectionsClientImpl(this); + this.routingRules = new RoutingRulesClientImpl(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.serviceTagInformations = new ServiceTagInformationsClientImpl(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.configurationPolicyGroups = new ConfigurationPolicyGroupsClientImpl(this); + this.virtualHubs = new VirtualHubsClientImpl(this); + this.routeMaps = new RouteMapsClientImpl(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.networkVirtualApplianceConnections = new NetworkVirtualApplianceConnectionsClientImpl(this); + this.virtualHubBgpConnections = new VirtualHubBgpConnectionsClientImpl(this); + this.virtualHubIpConfigurations = new VirtualHubIpConfigurationsClientImpl(this); + this.hubRouteTables = new HubRouteTablesClientImpl(this); + this.routingIntents = new RoutingIntentsClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagementClientImpl.class); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitImpl.java new file mode 100644 index 0000000000000..495a77b3a182a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitImpl.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.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManagerCommit; +import java.util.Collections; +import java.util.List; + +public final class NetworkManagerCommitImpl implements NetworkManagerCommit { + private NetworkManagerCommitInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkManagerCommitImpl(NetworkManagerCommitInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String commitId() { + return this.innerModel().commitId(); + } + + public List targetLocations() { + List inner = this.innerModel().targetLocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List configurationIds() { + List inner = this.innerModel().configurationIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConfigurationType commitType() { + return this.innerModel().commitType(); + } + + public NetworkManagerCommitInner 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/NetworkManagerCommitsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsClientImpl.java new file mode 100644 index 0000000000000..4e9fc250c3a4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsClientImpl.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagerCommitsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner; +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 NetworkManagerCommitsClient. + */ +public final class NetworkManagerCommitsClientImpl implements NetworkManagerCommitsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkManagerCommitsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkManagerCommitsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkManagerCommitsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(NetworkManagerCommitsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkManagerCommits to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface NetworkManagerCommitsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkManagerCommitInner parameters, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Manager Commit along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postWithResponseAsync(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Manager Commit along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postWithResponseAsync(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.post(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, apiVersion, parameters, accept, context); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network Manager Commit. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkManagerCommitInner> + beginPostAsync(String resourceGroupName, String networkManagerName, NetworkManagerCommitInner parameters) { + Mono>> mono + = postWithResponseAsync(resourceGroupName, networkManagerName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkManagerCommitInner.class, NetworkManagerCommitInner.class, + this.client.getContext()); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of network Manager Commit. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkManagerCommitInner> beginPostAsync( + String resourceGroupName, String networkManagerName, NetworkManagerCommitInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = postWithResponseAsync(resourceGroupName, networkManagerName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NetworkManagerCommitInner.class, NetworkManagerCommitInner.class, context); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network Manager Commit. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkManagerCommitInner> + beginPost(String resourceGroupName, String networkManagerName, NetworkManagerCommitInner parameters) { + return this.beginPostAsync(resourceGroupName, networkManagerName, parameters).getSyncPoller(); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of network Manager Commit. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkManagerCommitInner> beginPost( + String resourceGroupName, String networkManagerName, NetworkManagerCommitInner parameters, Context context) { + return this.beginPostAsync(resourceGroupName, networkManagerName, parameters, context).getSyncPoller(); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Manager Commit on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters) { + return beginPostAsync(resourceGroupName, networkManagerName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Manager Commit on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters, Context context) { + return beginPostAsync(resourceGroupName, networkManagerName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Manager Commit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerCommitInner post(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters) { + return postAsync(resourceGroupName, networkManagerName, parameters).block(); + } + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Manager Commit. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerCommitInner post(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters, Context context) { + return postAsync(resourceGroupName, networkManagerName, parameters, context).block(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsImpl.java new file mode 100644 index 0000000000000..38dd2e476a3fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerCommitsImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagerCommitsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerCommit; +import com.azure.resourcemanager.network.generated.models.NetworkManagerCommits; + +public final class NetworkManagerCommitsImpl implements NetworkManagerCommits { + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerCommitsImpl.class); + + private final NetworkManagerCommitsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkManagerCommitsImpl(NetworkManagerCommitsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NetworkManagerCommit post(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters) { + NetworkManagerCommitInner inner = this.serviceClient().post(resourceGroupName, networkManagerName, parameters); + if (inner != null) { + return new NetworkManagerCommitImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkManagerCommit post(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters, Context context) { + NetworkManagerCommitInner inner + = this.serviceClient().post(resourceGroupName, networkManagerName, parameters, context); + if (inner != null) { + return new NetworkManagerCommitImpl(inner, this.manager()); + } else { + return null; + } + } + + private NetworkManagerCommitsClient 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/NetworkManagerConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerConnectionImpl.java new file mode 100644 index 0000000000000..286bb49adda11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerConnectionImpl.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerConnection; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; + +public final class NetworkManagerConnectionImpl + implements NetworkManagerConnection, NetworkManagerConnection.Definition, NetworkManagerConnection.Update { + private NetworkManagerConnectionInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String networkManagerId() { + return this.innerModel().networkManagerId(); + } + + public ScopeConnectionState connectionState() { + return this.innerModel().connectionState(); + } + + public String description() { + return this.innerModel().description(); + } + + public NetworkManagerConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String networkManagerConnectionName; + + public NetworkManagerConnection create() { + this.innerObject = serviceManager.serviceClient() + .getSubscriptionNetworkManagerConnections() + .createOrUpdateWithResponse(networkManagerConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NetworkManagerConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSubscriptionNetworkManagerConnections() + .createOrUpdateWithResponse(networkManagerConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + NetworkManagerConnectionImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkManagerConnectionInner(); + this.serviceManager = serviceManager; + this.networkManagerConnectionName = name; + } + + public NetworkManagerConnectionImpl update() { + return this; + } + + public NetworkManagerConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getSubscriptionNetworkManagerConnections() + .createOrUpdateWithResponse(networkManagerConnectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NetworkManagerConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSubscriptionNetworkManagerConnections() + .createOrUpdateWithResponse(networkManagerConnectionName, this.innerModel(), context) + .getValue(); + return this; + } + + NetworkManagerConnectionImpl(NetworkManagerConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.networkManagerConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagerConnections"); + } + + public NetworkManagerConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getSubscriptionNetworkManagerConnections() + .getWithResponse(networkManagerConnectionName, Context.NONE) + .getValue(); + return this; + } + + public NetworkManagerConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSubscriptionNetworkManagerConnections() + .getWithResponse(networkManagerConnectionName, context) + .getValue(); + return this; + } + + public NetworkManagerConnectionImpl withNetworkManagerId(String networkManagerId) { + this.innerModel().withNetworkManagerId(networkManagerId); + return this; + } + + public NetworkManagerConnectionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusListResultImpl.java new file mode 100644 index 0000000000000..d5e6000bb076e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusListResultImpl.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.resourcemanager.network.generated.fluent.models.NetworkManagerDeploymentStatusListResultInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatus; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusListResult; +import java.util.Collections; +import java.util.List; + +public final class NetworkManagerDeploymentStatusListResultImpl implements NetworkManagerDeploymentStatusListResult { + private NetworkManagerDeploymentStatusListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkManagerDeploymentStatusListResultImpl(NetworkManagerDeploymentStatusListResultInner 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 skipToken() { + return this.innerModel().skipToken(); + } + + public NetworkManagerDeploymentStatusListResultInner 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/NetworkManagerDeploymentStatusOperationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsClientImpl.java new file mode 100644 index 0000000000000..4ed5082b1a289 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsClientImpl.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagerDeploymentStatusOperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerDeploymentStatusListResultInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusParameter; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * NetworkManagerDeploymentStatusOperationsClient. + */ +public final class NetworkManagerDeploymentStatusOperationsClientImpl + implements NetworkManagerDeploymentStatusOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkManagerDeploymentStatusOperationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkManagerDeploymentStatusOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkManagerDeploymentStatusOperationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(NetworkManagerDeploymentStatusOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkManagerDeploymentStatusOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface NetworkManagerDeploymentStatusOperationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listDeploymentStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, + @BodyParam("application/json") NetworkManagerDeploymentStatusParameter parameters, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Network Manager Deployment Status along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String networkManagerName, NetworkManagerDeploymentStatusParameter parameters, + Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, apiVersion, top, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Network Manager Deployment Status along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String networkManagerName, NetworkManagerDeploymentStatusParameter parameters, + Integer top, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, apiVersion, top, parameters, accept, context); + } + + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Network Manager Deployment Status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, + String networkManagerName, NetworkManagerDeploymentStatusParameter parameters) { + final Integer top = null; + return listWithResponseAsync(resourceGroupName, networkManagerName, parameters, top) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Network Manager Deployment Status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String networkManagerName, NetworkManagerDeploymentStatusParameter parameters, Integer top, Context context) { + return listWithResponseAsync(resourceGroupName, networkManagerName, parameters, top, context).block(); + } + + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Network Manager Deployment Status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerDeploymentStatusListResultInner list(String resourceGroupName, String networkManagerName, + NetworkManagerDeploymentStatusParameter parameters) { + final Integer top = null; + return listWithResponse(resourceGroupName, networkManagerName, parameters, top, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsImpl.java new file mode 100644 index 0000000000000..6efd62745fb02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerDeploymentStatusOperationsImpl.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.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.NetworkManagerDeploymentStatusOperationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerDeploymentStatusListResultInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusListResult; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusOperations; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusParameter; + +public final class NetworkManagerDeploymentStatusOperationsImpl implements NetworkManagerDeploymentStatusOperations { + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerDeploymentStatusOperationsImpl.class); + + private final NetworkManagerDeploymentStatusOperationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkManagerDeploymentStatusOperationsImpl(NetworkManagerDeploymentStatusOperationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, + String networkManagerName, NetworkManagerDeploymentStatusParameter parameters, Integer top, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, networkManagerName, parameters, top, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerDeploymentStatusListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManagerDeploymentStatusListResult list(String resourceGroupName, String networkManagerName, + NetworkManagerDeploymentStatusParameter parameters) { + NetworkManagerDeploymentStatusListResultInner inner + = this.serviceClient().list(resourceGroupName, networkManagerName, parameters); + if (inner != null) { + return new NetworkManagerDeploymentStatusListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private NetworkManagerDeploymentStatusOperationsClient 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/NetworkManagerEffectiveConnectivityConfigurationListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerEffectiveConnectivityConfigurationListResultImpl.java new file mode 100644 index 0000000000000..6df0816ada0de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerEffectiveConnectivityConfigurationListResultImpl.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.NetworkManagerEffectiveConnectivityConfigurationListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveConnectivityConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkManagerEffectiveConnectivityConfigurationListResult; +import java.util.Collections; +import java.util.List; + +public final class NetworkManagerEffectiveConnectivityConfigurationListResultImpl + implements NetworkManagerEffectiveConnectivityConfigurationListResult { + private NetworkManagerEffectiveConnectivityConfigurationListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkManagerEffectiveConnectivityConfigurationListResultImpl( + NetworkManagerEffectiveConnectivityConfigurationListResultInner 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 skipToken() { + return this.innerModel().skipToken(); + } + + public NetworkManagerEffectiveConnectivityConfigurationListResultInner 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/NetworkManagerEffectiveSecurityAdminRulesListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerEffectiveSecurityAdminRulesListResultImpl.java new file mode 100644 index 0000000000000..7ec9513a987e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerEffectiveSecurityAdminRulesListResultImpl.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.NetworkManagerEffectiveSecurityAdminRulesListResultInner; +import com.azure.resourcemanager.network.generated.models.EffectiveBaseSecurityAdminRule; +import com.azure.resourcemanager.network.generated.models.NetworkManagerEffectiveSecurityAdminRulesListResult; +import java.util.Collections; +import java.util.List; + +public final class NetworkManagerEffectiveSecurityAdminRulesListResultImpl + implements NetworkManagerEffectiveSecurityAdminRulesListResult { + private NetworkManagerEffectiveSecurityAdminRulesListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkManagerEffectiveSecurityAdminRulesListResultImpl( + NetworkManagerEffectiveSecurityAdminRulesListResultInner 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 skipToken() { + return this.innerModel().skipToken(); + } + + public NetworkManagerEffectiveSecurityAdminRulesListResultInner 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/NetworkManagerImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerImpl.java new file mode 100644 index 0000000000000..d2a80236e8fb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerImpl.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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerInner; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManager; +import com.azure.resourcemanager.network.generated.models.NetworkManagerPropertiesNetworkManagerScopes; +import com.azure.resourcemanager.network.generated.models.PatchObject; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NetworkManagerImpl implements NetworkManager, NetworkManager.Definition, NetworkManager.Update { + private NetworkManagerInner 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String id() { + return this.innerModel().id(); + } + + public String description() { + return this.innerModel().description(); + } + + public NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes() { + return this.innerModel().networkManagerScopes(); + } + + public List networkManagerScopeAccesses() { + List inner = this.innerModel().networkManagerScopeAccesses(); + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkManagerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private PatchObject updateParameters; + + public NetworkManagerImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public NetworkManager create() { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagers() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public NetworkManager create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagers() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, this.innerModel(), context) + .getValue(); + return this; + } + + NetworkManagerImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkManagerInner(); + this.serviceManager = serviceManager; + this.networkManagerName = name; + } + + public NetworkManagerImpl update() { + this.updateParameters = new PatchObject(); + return this; + } + + public NetworkManager apply() { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagers() + .patchWithResponse(resourceGroupName, networkManagerName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public NetworkManager apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagers() + .patchWithResponse(resourceGroupName, networkManagerName, updateParameters, context) + .getValue(); + return this; + } + + NetworkManagerImpl(NetworkManagerInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + } + + public NetworkManager refresh() { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagers() + .getByResourceGroupWithResponse(resourceGroupName, networkManagerName, Context.NONE) + .getValue(); + return this; + } + + public NetworkManager refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagers() + .getByResourceGroupWithResponse(resourceGroupName, networkManagerName, context) + .getValue(); + return this; + } + + public NetworkManagerImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public NetworkManagerImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public NetworkManagerImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NetworkManagerImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public NetworkManagerImpl + withNetworkManagerScopes(NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes) { + this.innerModel().withNetworkManagerScopes(networkManagerScopes); + return this; + } + + public NetworkManagerImpl withNetworkManagerScopeAccesses(List networkManagerScopeAccesses) { + this.innerModel().withNetworkManagerScopeAccesses(networkManagerScopeAccesses); + 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/NetworkManagerRoutingConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationImpl.java new file mode 100644 index 0000000000000..2531b016f4c40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerRoutingConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class NetworkManagerRoutingConfigurationImpl implements NetworkManagerRoutingConfiguration, + NetworkManagerRoutingConfiguration.Definition, NetworkManagerRoutingConfiguration.Update { + private NetworkManagerRoutingConfigurationInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public NetworkManagerRoutingConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + public NetworkManagerRoutingConfigurationImpl withExistingNetworkManager(String resourceGroupName, + String networkManagerName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + return this; + } + + public NetworkManagerRoutingConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagerRoutingConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public NetworkManagerRoutingConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagerRoutingConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + NetworkManagerRoutingConfigurationImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new NetworkManagerRoutingConfigurationInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public NetworkManagerRoutingConfigurationImpl update() { + return this; + } + + public NetworkManagerRoutingConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagerRoutingConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public NetworkManagerRoutingConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagerRoutingConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + NetworkManagerRoutingConfigurationImpl(NetworkManagerRoutingConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "routingConfigurations"); + } + + public NetworkManagerRoutingConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagerRoutingConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public NetworkManagerRoutingConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getNetworkManagerRoutingConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, context) + .getValue(); + return this; + } + + public NetworkManagerRoutingConfigurationImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsClientImpl.java new file mode 100644 index 0000000000000..bf94cce61d7ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsClientImpl.java @@ -0,0 +1,964 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagerRoutingConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerRoutingConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingConfigurationListResult; +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 NetworkManagerRoutingConfigurationsClient. + */ +public final class NetworkManagerRoutingConfigurationsClientImpl implements NetworkManagerRoutingConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkManagerRoutingConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkManagerRoutingConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkManagerRoutingConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(NetworkManagerRoutingConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkManagerRoutingConfigurations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface NetworkManagerRoutingConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") NetworkManagerRoutingConfigurationInner routingConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, top, skipToken, accept, context)) + .>map( + res -> new 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 network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken)); + } + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken, context)); + } + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, accept, context); + } + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, context).block(); + } + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerRoutingConfigurationInner get(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + /** + * Creates or updates a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param routingConfiguration The routing configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkManagerName, String configurationName, + NetworkManagerRoutingConfigurationInner routingConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (routingConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingConfiguration is required and cannot be null.")); + } else { + routingConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + routingConfiguration, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param routingConfiguration The routing configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String networkManagerName, String configurationName, + NetworkManagerRoutingConfigurationInner routingConfiguration, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (routingConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingConfiguration is required and cannot be null.")); + } else { + routingConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, routingConfiguration, accept, context); + } + + /** + * Creates or updates a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param routingConfiguration The routing configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String networkManagerName, String configurationName, + NetworkManagerRoutingConfigurationInner routingConfiguration) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + routingConfiguration).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param routingConfiguration The routing configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, + NetworkManagerRoutingConfigurationInner routingConfiguration, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + routingConfiguration, context).block(); + } + + /** + * Creates or updates a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param routingConfiguration The routing configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerRoutingConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, NetworkManagerRoutingConfigurationInner routingConfiguration) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, + routingConfiguration, Context.NONE).getValue(); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, force, accept, context); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).getSyncPoller(); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context) + .getSyncPoller(); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 networkManagerName, String configurationName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, force).block(); + } + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network manager routing configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager routing configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsImpl.java new file mode 100644 index 0000000000000..83bb537338aa4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagerRoutingConfigurationsImpl.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.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.NetworkManagerRoutingConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerRoutingConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingConfigurations; + +public final class NetworkManagerRoutingConfigurationsImpl implements NetworkManagerRoutingConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerRoutingConfigurationsImpl.class); + + private final NetworkManagerRoutingConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkManagerRoutingConfigurationsImpl(NetworkManagerRoutingConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkManagerRoutingConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkManagerRoutingConfigurationImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerRoutingConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManagerRoutingConfiguration get(String resourceGroupName, String networkManagerName, + String configurationName) { + NetworkManagerRoutingConfigurationInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, configurationName); + if (inner != null) { + return new NetworkManagerRoutingConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + public NetworkManagerRoutingConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + private NetworkManagerRoutingConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkManagerRoutingConfigurationImpl define(String name) { + return new NetworkManagerRoutingConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersClientImpl.java new file mode 100644 index 0000000000000..6f444b6937569 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersClientImpl.java @@ -0,0 +1,1256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkManagersClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerListResult; +import com.azure.resourcemanager.network.generated.models.PatchObject; +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 NetworkManagersClient. + */ +public final class NetworkManagersClientImpl implements NetworkManagersClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkManagersService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkManagersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkManagersClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(NetworkManagersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkManagers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface NetworkManagersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkManagerInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> patch(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PatchObject parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @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); + + @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 Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 Manager along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String networkManagerName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 Manager along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String networkManagerName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, apiVersion, accept, context); + } + + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 Manager on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkManagerName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkManagerName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 Manager along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String networkManagerName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkManagerName, context).block(); + } + + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 Manager. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerInner getByResourceGroup(String resourceGroupName, String networkManagerName) { + return getByResourceGroupWithResponse(resourceGroupName, networkManagerName, Context.NONE).getValue(); + } + + /** + * Creates or updates a Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, NetworkManagerInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, NetworkManagerInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, apiVersion, parameters, accept, context); + } + + /** + * Creates or updates a Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + NetworkManagerInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + NetworkManagerInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, parameters, context).block(); + } + + /** + * Creates or updates a Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerInner createOrUpdate(String resourceGroupName, String networkManagerName, + NetworkManagerInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, parameters, Context.NONE).getValue(); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, apiVersion, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, Boolean force, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, apiVersion, force, accept, context); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, networkManagerName, force).getSyncPoller(); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkManagerName, force, context).getSyncPoller(); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, Boolean force, + Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, force).block(); + } + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, Boolean force, Context context) { + deleteAsync(resourceGroupName, networkManagerName, force, context).block(); + } + + /** + * Patch NetworkManager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync(String resourceGroupName, + String networkManagerName, PatchObject 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.patch(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch NetworkManager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> patchWithResponseAsync(String resourceGroupName, + String networkManagerName, PatchObject 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.patch(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, apiVersion, parameters, accept, context); + } + + /** + * Patch NetworkManager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, String networkManagerName, + PatchObject parameters) { + return patchWithResponseAsync(resourceGroupName, networkManagerName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patch NetworkManager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response patchWithResponse(String resourceGroupName, String networkManagerName, + PatchObject parameters, Context context) { + return patchWithResponseAsync(resourceGroupName, networkManagerName, parameters, context).block(); + } + + /** + * Patch NetworkManager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which network manager is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Network resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerInner patch(String resourceGroupName, String networkManagerName, PatchObject parameters) { + return patchWithResponse(resourceGroupName, networkManagerName, parameters, Context.NONE).getValue(); + } + + /** + * List all network managers in a subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + top, skipToken, accept, context)) + .>map(res -> new 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 network managers in a subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, String skipToken, + 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, top, skipToken, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all network managers in a subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(top, skipToken), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all network managers 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 NetworkManager as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(top, skipToken), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all network managers in a subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(top, skipToken, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all network managers 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 NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(top, skipToken)); + } + + /** + * List all network managers in a subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(top, skipToken, context)); + } + + /** + * List network managers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, apiVersion, top, skipToken, accept, context)) + .>map(res -> new 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 managers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer top, String skipToken, 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + apiVersion, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List network managers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, + String skipToken) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List network managers 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 result of the request to list NetworkManager as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List network managers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, + String skipToken, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List network managers 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 result of the request to list NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, skipToken)); + } + + /** + * List network managers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, + String skipToken, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 NetworkManager along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersImpl.java new file mode 100644 index 0000000000000..ed7a713280080 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkManagersImpl.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.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.NetworkManagersClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerInner; +import com.azure.resourcemanager.network.generated.models.NetworkManager; +import com.azure.resourcemanager.network.generated.models.NetworkManagers; + +public final class NetworkManagersImpl implements NetworkManagers { + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagersImpl.class); + + private final NetworkManagersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkManagersImpl(NetworkManagersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String networkManagerName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, networkManagerName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManager getByResourceGroup(String resourceGroupName, String networkManagerName) { + NetworkManagerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, networkManagerName); + if (inner != null) { + return new NetworkManagerImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName) { + this.serviceClient().delete(resourceGroupName, networkManagerName); + } + + public void delete(String resourceGroupName, String networkManagerName, Boolean force, Context context) { + this.serviceClient().delete(resourceGroupName, networkManagerName, force, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient().list(top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, String skipToken, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerImpl(inner1, this.manager())); + } + + public NetworkManager getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkManagerName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, networkManagerName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + this.delete(resourceGroupName, networkManagerName, force, context); + } + + private NetworkManagersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkManagerImpl define(String name) { + return new NetworkManagerImpl(name, this.manager()); + } +} 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..fdf6da2633672 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfileImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkProfileName = ResourceManagerUtils.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..96274d2256b24 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesClientImpl.java @@ -0,0 +1,1104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkProfileName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkProfileName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkProfileName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String networkProfileName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkProfileName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, networkProfileName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkProfileName, + NetworkProfileInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkProfileName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String networkProfileName, + NetworkProfileInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkProfileName, parameters, 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) + public NetworkProfileInner createOrUpdate(String resourceGroupName, String networkProfileName, + NetworkProfileInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, networkProfileName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String networkProfileName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkProfileName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String networkProfileName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public NetworkProfileInner updateTags(String resourceGroupName, String networkProfileName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, networkProfileName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkProfiles API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkProfiles API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkProfiles API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..1b80bbd234e43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkProfilesImpl.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.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; + +public final class NetworkProfilesImpl implements NetworkProfiles { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkProfileImpl(inner1, this.manager())); + } + + public NetworkProfile getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkProfileName = ResourceManagerUtils.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..c282d28863b6a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupImpl.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.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 String id() { + return this.innerModel().id(); + } + + public Boolean flushConnection() { + return this.innerModel().flushConnection(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName + = ResourceManagerUtils.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 withFlushConnection(Boolean flushConnection) { + this.innerModel().withFlushConnection(flushConnection); + 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..e0e62167efc1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsClientImpl.java @@ -0,0 +1,1214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String networkSecurityGroupName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String networkSecurityGroupName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkSecurityGroupName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, networkSecurityGroupName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return this.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 the {@link SyncPoller} for polling of networkSecurityGroup resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkSecurityGroupInner> beginCreateOrUpdate( + String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String networkSecurityGroupName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkSecurityGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String networkSecurityGroupName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public NetworkSecurityGroupInner updateTags(String resourceGroupName, String networkSecurityGroupName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, networkSecurityGroupName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkSecurityGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkSecurityGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkSecurityGroups API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..6247b1ea0dcd7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkSecurityGroupsImpl.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.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; + +public final class NetworkSecurityGroupsImpl implements NetworkSecurityGroups { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkSecurityGroupImpl(inner1, this.manager())); + } + + public NetworkSecurityGroup getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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/NetworkVirtualApplianceConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionImpl.java new file mode 100644 index 0000000000000..f7281b655bdb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionImpl.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.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceConnection; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.util.Collections; +import java.util.List; + +public final class NetworkVirtualApplianceConnectionImpl implements NetworkVirtualApplianceConnection { + private NetworkVirtualApplianceConnectionInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkVirtualApplianceConnectionImpl(NetworkVirtualApplianceConnectionInner 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 namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long asn() { + return this.innerModel().asn(); + } + + public Long tunnelIdentifier() { + return this.innerModel().tunnelIdentifier(); + } + + public List bgpPeerAddress() { + List inner = this.innerModel().bgpPeerAddress(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableInternetSecurity() { + return this.innerModel().enableInternetSecurity(); + } + + public RoutingConfiguration routingConfiguration() { + return this.innerModel().routingConfiguration(); + } + + public NetworkVirtualApplianceConnectionInner 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/NetworkVirtualApplianceConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionsClientImpl.java new file mode 100644 index 0000000000000..37f8b2b0221cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionsClientImpl.java @@ -0,0 +1,981 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.NetworkVirtualApplianceConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceConnectionList; +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 NetworkVirtualApplianceConnectionsClient. + */ +public final class NetworkVirtualApplianceConnectionsClientImpl implements NetworkVirtualApplianceConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkVirtualApplianceConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of NetworkVirtualApplianceConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkVirtualApplianceConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(NetworkVirtualApplianceConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientNetworkVirtualApplianceConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface NetworkVirtualApplianceConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections/{connectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @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/networkVirtualAppliances/{networkVirtualApplianceName}/networkVirtualApplianceConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @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 connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (networkVirtualApplianceConnectionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkVirtualApplianceConnectionParameters is required and cannot be null.")); + } else { + networkVirtualApplianceConnectionParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkVirtualApplianceName, connectionName, apiVersion, + networkVirtualApplianceConnectionParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, 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 (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (networkVirtualApplianceConnectionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkVirtualApplianceConnectionParameters is required and cannot be null.")); + } else { + networkVirtualApplianceConnectionParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkVirtualApplianceName, connectionName, apiVersion, networkVirtualApplianceConnectionParameters, + accept, context); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 the {@link PollerFlux} for polling of networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkVirtualApplianceConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), NetworkVirtualApplianceConnectionInner.class, + NetworkVirtualApplianceConnectionInner.class, this.client.getContext()); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 the {@link PollerFlux} for polling of networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkVirtualApplianceConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + networkVirtualApplianceName, connectionName, networkVirtualApplianceConnectionParameters, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), NetworkVirtualApplianceConnectionInner.class, + NetworkVirtualApplianceConnectionInner.class, context); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 the {@link SyncPoller} for polling of networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters) + .getSyncPoller(); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 the {@link SyncPoller} for polling of networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters, context) + .getSyncPoller(); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceConnectionInner createOrUpdate(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters) { + return createOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters).block(); + } + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceConnectionInner createOrUpdate(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters, context).block(); + } + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, 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 (networkVirtualApplianceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkVirtualApplianceName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkVirtualApplianceName, connectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, 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 (networkVirtualApplianceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkVirtualApplianceName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkVirtualApplianceName, connectionName, apiVersion, accept, context); + } + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, + String networkVirtualApplianceName, String connectionName) { + return getWithResponseAsync(resourceGroupName, networkVirtualApplianceName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, networkVirtualApplianceName, connectionName, context).block(); + } + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceConnectionInner get(String resourceGroupName, String networkVirtualApplianceName, + String connectionName) { + return getWithResponse(resourceGroupName, networkVirtualApplianceName, connectionName, Context.NONE).getValue(); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, 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 (networkVirtualApplianceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkVirtualApplianceName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkVirtualApplianceName, connectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, 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 (networkVirtualApplianceName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkVirtualApplianceName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkVirtualApplianceName, connectionName, apiVersion, accept, context); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String networkVirtualApplianceName, String connectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkVirtualApplianceName, connectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkVirtualApplianceName, connectionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkVirtualApplianceName, + String connectionName) { + return this.beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName).getSyncPoller(); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkVirtualApplianceName, + String connectionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName, context) + .getSyncPoller(); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkVirtualApplianceName, + String connectionName) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + Context context) { + return beginDeleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceName, String connectionName) { + deleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName).block(); + } + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceName, String connectionName, + Context context) { + deleteAsync(resourceGroupName, networkVirtualApplianceName, connectionName, context).block(); + } + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkVirtualApplianceName, 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 NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkVirtualApplianceName, apiVersion, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String networkVirtualApplianceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkVirtualApplianceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedFlux}. + */ + @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 NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String networkVirtualApplianceName) { + return new PagedIterable<>(listAsync(resourceGroupName, networkVirtualApplianceName)); + } + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualApplianceConnection list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return networkVirtualApplianceConnection list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionsImpl.java new file mode 100644 index 0000000000000..4c115eb3f1ef6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceConnectionsImpl.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.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.NetworkVirtualApplianceConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceConnection; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceConnections; + +public final class NetworkVirtualApplianceConnectionsImpl implements NetworkVirtualApplianceConnections { + private static final ClientLogger LOGGER = new ClientLogger(NetworkVirtualApplianceConnectionsImpl.class); + + private final NetworkVirtualApplianceConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public NetworkVirtualApplianceConnectionsImpl(NetworkVirtualApplianceConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NetworkVirtualApplianceConnection createOrUpdate(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters) { + NetworkVirtualApplianceConnectionInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters); + if (inner != null) { + return new NetworkVirtualApplianceConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkVirtualApplianceConnection createOrUpdate(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, + NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, Context context) { + NetworkVirtualApplianceConnectionInner inner = this.serviceClient() + .createOrUpdate(resourceGroupName, networkVirtualApplianceName, connectionName, + networkVirtualApplianceConnectionParameters, context); + if (inner != null) { + return new NetworkVirtualApplianceConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkVirtualApplianceName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkVirtualApplianceConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkVirtualApplianceConnection get(String resourceGroupName, String networkVirtualApplianceName, + String connectionName) { + NetworkVirtualApplianceConnectionInner inner + = this.serviceClient().get(resourceGroupName, networkVirtualApplianceName, connectionName); + if (inner != null) { + return new NetworkVirtualApplianceConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, String connectionName) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, connectionName); + } + + public void delete(String resourceGroupName, String networkVirtualApplianceName, String connectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, networkVirtualApplianceName, connectionName, context); + } + + public PagedIterable list(String resourceGroupName, + String networkVirtualApplianceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkVirtualApplianceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkVirtualApplianceConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, + String networkVirtualApplianceName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkVirtualApplianceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkVirtualApplianceConnectionImpl(inner1, this.manager())); + } + + private NetworkVirtualApplianceConnectionsClient 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/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..59258e4b569e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceImpl.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.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.fluent.models.NetworkVirtualApplianceInstanceIdsInner; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.InternetIngressPublicIpsProperties; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceInstanceIds; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliancePropertiesFormatNetworkProfile; +import com.azure.resourcemanager.network.generated.models.PartnerManagedResourceProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceAdditionalNicProperties; +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 String id() { + return this.innerModel().id(); + } + + 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 String sshPublicKey() { + return this.innerModel().sshPublicKey(); + } + + public List virtualApplianceNics() { + List inner = this.innerModel().virtualApplianceNics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public List additionalNics() { + List inner = this.innerModel().additionalNics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List internetIngressPublicIps() { + List inner = this.innerModel().internetIngressPublicIps(); + 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 virtualApplianceConnections() { + List inner = this.innerModel().virtualApplianceConnections(); + 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 deploymentType() { + return this.innerModel().deploymentType(); + } + + public DelegationProperties delegation() { + return this.innerModel().delegation(); + } + + public PartnerManagedResourceProperties partnerManagedResource() { + return this.innerModel().partnerManagedResource(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName + = ResourceManagerUtils.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 NetworkVirtualApplianceInstanceIds restart() { + return serviceManager.networkVirtualAppliances().restart(resourceGroupName, networkVirtualApplianceName); + } + + public NetworkVirtualApplianceInstanceIds + restart(NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, Context context) { + return serviceManager.networkVirtualAppliances() + .restart(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds, context); + } + + 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; + } + + public NetworkVirtualApplianceImpl withSshPublicKey(String sshPublicKey) { + this.innerModel().withSshPublicKey(sshPublicKey); + return this; + } + + public NetworkVirtualApplianceImpl + withNetworkProfile(NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public NetworkVirtualApplianceImpl + withAdditionalNics(List additionalNics) { + this.innerModel().withAdditionalNics(additionalNics); + return this; + } + + public NetworkVirtualApplianceImpl + withInternetIngressPublicIps(List internetIngressPublicIps) { + this.innerModel().withInternetIngressPublicIps(internetIngressPublicIps); + return this; + } + + public NetworkVirtualApplianceImpl withDelegation(DelegationProperties delegation) { + this.innerModel().withDelegation(delegation); + return this; + } + + public NetworkVirtualApplianceImpl + withPartnerManagedResource(PartnerManagedResourceProperties partnerManagedResource) { + this.innerModel().withPartnerManagedResource(partnerManagedResource); + 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/NetworkVirtualApplianceInstanceIdsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceInstanceIdsImpl.java new file mode 100644 index 0000000000000..64abec28759db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceInstanceIdsImpl.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.NetworkVirtualApplianceInstanceIdsInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceInstanceIds; +import java.util.Collections; +import java.util.List; + +public final class NetworkVirtualApplianceInstanceIdsImpl implements NetworkVirtualApplianceInstanceIds { + private NetworkVirtualApplianceInstanceIdsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + NetworkVirtualApplianceInstanceIdsImpl(NetworkVirtualApplianceInstanceIdsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List instanceIds() { + List inner = this.innerModel().instanceIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkVirtualApplianceInstanceIdsInner 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/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..4899adc2d3253 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualApplianceSkuImpl.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.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 id() { + return this.innerModel().id(); + } + + 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 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..9a5ab5e051be0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesClientImpl.java @@ -0,0 +1,1546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.fluent.models.NetworkVirtualApplianceInstanceIdsInner; +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 { + /** + * 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") + public 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/restart") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkVirtualApplianceName") String networkVirtualApplianceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String networkVirtualApplianceName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkVirtualApplianceName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String networkVirtualApplianceName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, networkVirtualApplianceName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkVirtualApplianceName, expand, context) + .block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, networkVirtualApplianceName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, + String networkVirtualApplianceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkVirtualApplianceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String networkVirtualApplianceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkVirtualApplianceName, parameters, 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) + public NetworkVirtualApplianceInner updateTags(String resourceGroupName, String networkVirtualApplianceName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, networkVirtualApplianceName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters) { + return this.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 the {@link SyncPoller} for polling of networkVirtualAppliance Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, NetworkVirtualApplianceInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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(); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 (networkVirtualApplianceInstanceIds != null) { + networkVirtualApplianceInstanceIds.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.restart(this.client.getEndpoint(), resourceGroupName, networkVirtualApplianceName, + apiVersion, this.client.getSubscriptionId(), networkVirtualApplianceInstanceIds, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceGroupName, + String networkVirtualApplianceName, NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 (networkVirtualApplianceInstanceIds != null) { + networkVirtualApplianceInstanceIds.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restart(this.client.getEndpoint(), resourceGroupName, networkVirtualApplianceName, apiVersion, + this.client.getSubscriptionId(), networkVirtualApplianceInstanceIds, accept, context); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkVirtualApplianceInstanceIdsInner> + beginRestartAsync(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, networkVirtualApplianceName, + networkVirtualApplianceInstanceIds); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), NetworkVirtualApplianceInstanceIdsInner.class, + NetworkVirtualApplianceInstanceIdsInner.class, this.client.getContext()); + } + + /** + * Restarts one or more VMs belonging to 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 {@link PollerFlux} for polling of specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkVirtualApplianceInstanceIdsInner> + beginRestartAsync(String resourceGroupName, String networkVirtualApplianceName) { + final NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds = null; + Mono>> mono = restartWithResponseAsync(resourceGroupName, networkVirtualApplianceName, + networkVirtualApplianceInstanceIds); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), NetworkVirtualApplianceInstanceIdsInner.class, + NetworkVirtualApplianceInstanceIdsInner.class, this.client.getContext()); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NetworkVirtualApplianceInstanceIdsInner> + beginRestartAsync(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restartWithResponseAsync(resourceGroupName, networkVirtualApplianceName, + networkVirtualApplianceInstanceIds, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), NetworkVirtualApplianceInstanceIdsInner.class, + NetworkVirtualApplianceInstanceIdsInner.class, context); + } + + /** + * Restarts one or more VMs belonging to 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 {@link SyncPoller} for polling of specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceInstanceIdsInner> + beginRestart(String resourceGroupName, String networkVirtualApplianceName) { + final NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds = null; + return this + .beginRestartAsync(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds) + .getSyncPoller(); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NetworkVirtualApplianceInstanceIdsInner> + beginRestart(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, Context context) { + return this + .beginRestartAsync(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds, + context) + .getSyncPoller(); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, + String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds) { + return beginRestartAsync(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more VMs belonging to 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 specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, + String networkVirtualApplianceName) { + final NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds = null; + return beginRestartAsync(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, + String networkVirtualApplianceName, NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, + Context context) { + return beginRestartAsync(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more VMs belonging to 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 specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInstanceIdsInner restart(String resourceGroupName, + String networkVirtualApplianceName) { + final NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds = null; + return restartAsync(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds).block(); + } + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceInstanceIdsInner restart(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, Context context) { + return restartAsync(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds, 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualAppliances API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..576b707efe3f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkVirtualAppliancesImpl.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.NetworkVirtualAppliancesClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInstanceIdsInner; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualApplianceInstanceIds; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliances; + +public final class NetworkVirtualAppliancesImpl implements NetworkVirtualAppliances { + private static 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 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 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 NetworkVirtualApplianceInstanceIds restart(String resourceGroupName, String networkVirtualApplianceName) { + NetworkVirtualApplianceInstanceIdsInner inner + = this.serviceClient().restart(resourceGroupName, networkVirtualApplianceName); + if (inner != null) { + return new NetworkVirtualApplianceInstanceIdsImpl(inner, this.manager()); + } else { + return null; + } + } + + public NetworkVirtualApplianceInstanceIds restart(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, Context context) { + NetworkVirtualApplianceInstanceIdsInner inner = this.serviceClient() + .restart(resourceGroupName, networkVirtualApplianceName, networkVirtualApplianceInstanceIds, context); + if (inner != null) { + return new NetworkVirtualApplianceInstanceIdsImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkVirtualApplianceImpl(inner1, this.manager())); + } + + public NetworkVirtualAppliance getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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..1867d45e72755 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatcherImpl.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 String id() { + return this.innerModel().id(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkWatcherName = ResourceManagerUtils.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 Response getTopologyWithResponse(TopologyParameters parameters, Context context) { + return serviceManager.networkWatchers() + .getTopologyWithResponse(resourceGroupName, networkWatcherName, parameters, context); + } + + public Topology getTopology(TopologyParameters parameters) { + return serviceManager.networkWatchers().getTopology(resourceGroupName, networkWatcherName, parameters); + } + + 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..4b1ff04b4f9f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersClientImpl.java @@ -0,0 +1,4015 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkWatcherName, + NetworkWatcherInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String networkWatcherName, + NetworkWatcherInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 createOrUpdateWithResponse(resourceGroupName, networkWatcherName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkWatcherName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String networkWatcherName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, networkWatcherName, 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) + public NetworkWatcherInner getByResourceGroup(String resourceGroupName, String networkWatcherName) { + return getByResourceGroupWithResponse(resourceGroupName, networkWatcherName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String networkWatcherName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String networkWatcherName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, networkWatcherName, parameters, 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) + public NetworkWatcherInner updateTags(String resourceGroupName, String networkWatcherName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, networkWatcherName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getTopologyAsync(String resourceGroupName, String networkWatcherName, + TopologyParameters parameters) { + return getTopologyWithResponseAsync(resourceGroupName, networkWatcherName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTopologyWithResponse(String resourceGroupName, String networkWatcherName, + TopologyParameters parameters, Context context) { + return getTopologyWithResponseAsync(resourceGroupName, networkWatcherName, parameters, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 getTopologyWithResponse(resourceGroupName, networkWatcherName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters) { + return this.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 the {@link SyncPoller} for polling of results of IP flow verification on the target resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VerificationIpFlowResultInner> beginVerifyIpFlow( + String resourceGroupName, String networkWatcherName, VerificationIpFlowParameters parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NextHopResultInner> beginGetNextHop(String resourceGroupName, + String networkWatcherName, NextHopParameters parameters) { + return this.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 {@link SyncPoller} for polling of the next hop from the specified VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NextHopResultInner> beginGetNextHop(String resourceGroupName, + String networkWatcherName, NextHopParameters parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the configured and effective security group rules on the specified + * VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the configured and effective security group rules on the specified + * VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the configured and effective security group rules on the specified + * VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters) { + return this.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 {@link SyncPoller} for polling of the configured and effective security group rules on the specified + * VM. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityGroupViewResultInner> beginGetVMSecurityRules( + String resourceGroupName, String networkWatcherName, SecurityGroupViewParameters parameters, Context context) { + return this.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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters) { + return this.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 the {@link SyncPoller} for polling of troubleshooting information gained from specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshooting( + String resourceGroupName, String networkWatcherName, TroubleshootingParameters parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters) { + return this.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 {@link SyncPoller} for polling of the last completed troubleshooting result on a specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TroubleshootingResultInner> beginGetTroubleshootingResult( + String resourceGroupName, String networkWatcherName, QueryTroubleshootingParameters parameters, + Context context) { + return this.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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters) { + return this.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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> beginSetFlowLogConfiguration( + String resourceGroupName, String networkWatcherName, FlowLogInformationInner parameters, Context context) { + return this.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) on successful completion of + * {@link Mono}. + */ + @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) on successful completion of + * {@link Mono}. + */ + @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) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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) along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> + beginGetFlowLogStatus(String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters) { + return this.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 the {@link SyncPoller} for polling of information on the configuration of flow log and traffic analytics + * (optional). + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowLogInformationInner> beginGetFlowLogStatus( + String resourceGroupName, String networkWatcherName, FlowLogStatusParameters parameters, Context context) { + return this.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) on successful completion of + * {@link Mono}. + */ + @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) on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectivityInformationInner> + beginCheckConnectivity(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) { + return this.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 the {@link SyncPoller} for polling of information on the connectivity status. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectivityInformationInner> beginCheckConnectivity( + String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureReachabilityReportInner> + beginGetAzureReachabilityReport(String resourceGroupName, String networkWatcherName, + AzureReachabilityReportParameters parameters) { + return this.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 the {@link SyncPoller} for polling of azure reachability report details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AzureReachabilityReportInner> + beginGetAzureReachabilityReport(String resourceGroupName, String networkWatcherName, + AzureReachabilityReportParameters parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters) { + return this.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 the {@link SyncPoller} for polling of list of available countries with details. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AvailableProvidersListInner> beginListAvailableProviders( + String resourceGroupName, String networkWatcherName, AvailableProvidersListParameters parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of network Configuration Diagnostic data to help customers understand + * and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of network Configuration Diagnostic data to help customers understand + * and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 the {@link SyncPoller} for polling of network Configuration Diagnostic data to help customers understand + * and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters) { + return this.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 the {@link SyncPoller} for polling of network Configuration Diagnostic data to help customers understand + * and debug network behavior. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, NetworkConfigurationDiagnosticResponseInner> + beginGetNetworkConfigurationDiagnostic(String resourceGroupName, String networkWatcherName, + NetworkConfigurationDiagnosticParameters parameters, Context context) { + return this + .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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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..0af00f4098062 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/NetworkWatchersImpl.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.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; + +public final class NetworkWatchersImpl implements NetworkWatchers { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkWatcherImpl(inner1, this.manager())); + } + + 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 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 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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkWatcherName = ResourceManagerUtils.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..647fc99072abe --- /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..66afdb7ba0c50 --- /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..7d8140ec2d312 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsClientImpl.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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..5e054ad6d3fd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +public final class OperationsImpl implements Operations { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.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..766e43b95cf7c --- /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..5f4b9ccf04727 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnConnectionHealthImpl.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.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..a2853ebe0e268 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewayImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = ResourceManagerUtils.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..7cd346f775fd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysClientImpl.java @@ -0,0 +1,2501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate(String resourceGroupName, + String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters) { + return this.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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginCreateOrUpdate(String resourceGroupName, + String gatewayName, P2SVpnGatewayInner p2SVpnGatewayParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginUpdateTags(String resourceGroupName, + String gatewayName, TagsObject p2SVpnGatewayParameters) { + return this.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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginUpdateTags(String resourceGroupName, + String gatewayName, TagsObject p2SVpnGatewayParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginReset(String resourceGroupName, + String gatewayName) { + return this.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 the {@link SyncPoller} for polling of p2SVpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> beginReset(String resourceGroupName, + String gatewayName, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> + beginGenerateVpnProfile(String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters) { + return this.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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> beginGenerateVpnProfile( + String resourceGroupName, String gatewayName, P2SVpnProfileParameters parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the connection health of P2S clients of the virtual wan + * P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the connection health of P2S clients of the virtual wan + * P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the connection health of P2S clients of the virtual wan + * P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> + beginGetP2SVpnConnectionHealth(String resourceGroupName, String gatewayName) { + return this.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 {@link SyncPoller} for polling of the connection health of P2S clients of the virtual wan + * P2SVpnGateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnGatewayInner> + beginGetP2SVpnConnectionHealth(String resourceGroupName, String gatewayName, Context context) { + return this.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 on + * successful completion of {@link Mono}. + */ + @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 on + * successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of 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.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of 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.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of 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.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed(String resourceGroupName, String gatewayName, + P2SVpnConnectionHealthRequest request) { + return this.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 {@link SyncPoller} for polling of 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.LONG_RUNNING_OPERATION) + public SyncPoller, P2SVpnConnectionHealthInner> + beginGetP2SVpnConnectionHealthDetailed(String resourceGroupName, String gatewayName, + P2SVpnConnectionHealthRequest request, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectP2SVpnConnections(String resourceGroupName, + String p2SVpnGatewayName, P2SVpnConnectionRequest request) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectP2SVpnConnections(String resourceGroupName, + String p2SVpnGatewayName, P2SVpnConnectionRequest request, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list P2SVpnGateways along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..bd5044bc05d48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/P2SVpnGatewaysImpl.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.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; + +public final class P2SVpnGatewaysImpl implements P2SVpnGateways { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new P2SVpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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..d603570d4d3d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureQueryStatusResultImpl.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.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..76197633fbdd6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCaptureResultImpl.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights 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.PacketCaptureMachineScope; +import com.azure.resourcemanager.network.generated.models.PacketCaptureResult; +import com.azure.resourcemanager.network.generated.models.PacketCaptureSettings; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.PacketCaptureTargetType; +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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String target() { + return this.innerModel().target(); + } + + public PacketCaptureMachineScope scope() { + return this.innerModel().scope(); + } + + public PacketCaptureTargetType targetType() { + return this.innerModel().targetType(); + } + + 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 Boolean continuousCapture() { + return this.innerModel().continuousCapture(); + } + + public PacketCaptureSettings captureSettings() { + return this.innerModel().captureSettings(); + } + + 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..6312a14dd5a14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesClientImpl.java @@ -0,0 +1,1370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters) { + return this.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 the {@link SyncPoller} for polling of information about packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureResultInner> beginCreate( + String resourceGroupName, String networkWatcherName, String packetCaptureName, PacketCapture parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkWatcherName, + String packetCaptureName) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkWatcherName, + String packetCaptureName, Context context) { + return getWithResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName, 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) + public PacketCaptureResultInner get(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return getWithResponse(resourceGroupName, networkWatcherName, packetCaptureName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName, + String packetCaptureName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkWatcherName, + String packetCaptureName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String networkWatcherName, + String packetCaptureName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String networkWatcherName, + String packetCaptureName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureQueryStatusResultInner> + beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName) { + return this.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 the {@link SyncPoller} for polling of status of packet capture session. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PacketCaptureQueryStatusResultInner> + beginGetStatus(String resourceGroupName, String networkWatcherName, String packetCaptureName, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..445f56ad1a088 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PacketCapturesImpl.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.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; + +public final class PacketCapturesImpl implements PacketCaptures { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.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..4f05bcf8a52f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionImpl.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.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..02566d20bd704 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsClientImpl.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String circuitName, + String peeringName, String connectionName) { + return getWithResponseAsync(resourceGroupName, circuitName, peeringName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @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 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 getWithResponse(resourceGroupName, circuitName, peeringName, connectionName, Context.NONE).getValue(); + } + + /** + * 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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPeeredConnections API service call retrieves all global reach peer circuit connections + * that belongs to a Private Peering for an ExpressRouteCircuit along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..a4b00d8e23874 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PeerExpressRouteCircuitConnectionsImpl.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.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; + +public final class PeerExpressRouteCircuitConnectionsImpl implements PeerExpressRouteCircuitConnections { + private static 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 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 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 PagedIterable list(String resourceGroupName, String circuitName, + String peeringName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, circuitName, peeringName); + return ResourceManagerUtils.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 ResourceManagerUtils.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/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..ec326451ec8a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupImpl.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.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..a3f9a6cc75437 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsClientImpl.java @@ -0,0 +1,964 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateEndpointName, + String privateDnsZoneGroupName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateEndpointName, + String privateDnsZoneGroupName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String privateEndpointName, + String privateDnsZoneGroupName) { + return getWithResponseAsync(resourceGroupName, privateEndpointName, privateDnsZoneGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String privateEndpointName, + String privateDnsZoneGroupName, Context context) { + return getWithResponseAsync(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) + public PrivateDnsZoneGroupInner get(String resourceGroupName, String privateEndpointName, + String privateDnsZoneGroupName) { + return getWithResponse(resourceGroupName, privateEndpointName, privateDnsZoneGroupName, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters) { + return this + .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 the {@link SyncPoller} for polling of private dns zone group resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateDnsZoneGroupInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, String privateDnsZoneGroupName, + PrivateDnsZoneGroupInner parameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..360dc659352ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateDnsZoneGroupsImpl.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.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; + +public final class PrivateDnsZoneGroupsImpl implements PrivateDnsZoneGroups { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.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..cb139ab74ef40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionImpl.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.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 String privateEndpointLocation() { + return this.innerModel().privateEndpointLocation(); + } + + 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/PrivateEndpointConnectionPropertiesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionPropertiesImpl.java new file mode 100644 index 0000000000000..63448cc672fe0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointConnectionPropertiesImpl.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.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionPropertiesInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; + +public final class PrivateEndpointConnectionPropertiesImpl implements PrivateEndpointConnectionProperties { + private PrivateEndpointConnectionPropertiesInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateEndpointConnectionPropertiesImpl(PrivateEndpointConnectionPropertiesInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 String privateEndpointLocation() { + return this.innerModel().privateEndpointLocation(); + } + + public PrivateEndpointConnectionPropertiesInner 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..c8aea435ba765 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointImpl.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.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.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.ApplicationSecurityGroup; +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.PrivateEndpointIpConfiguration; +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 String id() { + return this.innerModel().id(); + } + + 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 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 List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String customNetworkInterfaceName() { + return this.innerModel().customNetworkInterfaceName(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateEndpointName = ResourceManagerUtils.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; + } + + public PrivateEndpointImpl + withApplicationSecurityGroups(List applicationSecurityGroups) { + this.innerModel().withApplicationSecurityGroups(applicationSecurityGroups); + return this; + } + + public PrivateEndpointImpl withIpConfigurations(List ipConfigurations) { + this.innerModel().withIpConfigurations(ipConfigurations); + return this; + } + + public PrivateEndpointImpl withCustomNetworkInterfaceName(String customNetworkInterfaceName) { + this.innerModel().withCustomNetworkInterfaceName(customNetworkInterfaceName); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointPropertiesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointPropertiesImpl.java new file mode 100644 index 0000000000000..8c1ab1a0d9580 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointPropertiesImpl.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.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointPropertiesInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.generated.models.CustomDnsConfigPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointProperties; +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.stream.Collectors; + +public final class PrivateEndpointPropertiesImpl implements PrivateEndpointProperties { + private PrivateEndpointPropertiesInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateEndpointPropertiesImpl(PrivateEndpointPropertiesInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 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 List ipConfigurations() { + List inner = this.innerModel().ipConfigurations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String customNetworkInterfaceName() { + return this.innerModel().customNetworkInterfaceName(); + } + + public PrivateEndpointPropertiesInner 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/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..95f627686c16c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsClientImpl.java @@ -0,0 +1,1055 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateEndpointName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateEndpointName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String privateEndpointName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, privateEndpointName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String privateEndpointName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateEndpointName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, privateEndpointName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointInner> + beginCreateOrUpdate(String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters) { + return this.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 the {@link SyncPoller} for polling of private endpoint resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointInner> beginCreateOrUpdate( + String resourceGroupName, String privateEndpointName, PrivateEndpointInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..966b845ee6f26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateEndpointsImpl.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.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; + +public final class PrivateEndpointsImpl implements PrivateEndpoints { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointImpl(inner1, this.manager())); + } + + public PrivateEndpoint getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateEndpointName = ResourceManagerUtils.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..68233af34d006 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 String destinationIpAddress() { + return this.innerModel().destinationIpAddress(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = ResourceManagerUtils.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 withDestinationIpAddress(String destinationIpAddress) { + this.innerModel().withDestinationIpAddress(destinationIpAddress); + 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..9365d7b127074 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationImpl.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.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/PrivateLinkServiceIpConfigurationPropertiesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationPropertiesImpl.java new file mode 100644 index 0000000000000..4fde1a03d4e67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceIpConfigurationPropertiesImpl.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.PrivateLinkServiceIpConfigurationPropertiesInner; +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.PrivateLinkServiceIpConfigurationProperties; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.Subnet; + +public final class PrivateLinkServiceIpConfigurationPropertiesImpl + implements PrivateLinkServiceIpConfigurationProperties { + private PrivateLinkServiceIpConfigurationPropertiesInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PrivateLinkServiceIpConfigurationPropertiesImpl(PrivateLinkServiceIpConfigurationPropertiesInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 PrivateLinkServiceIpConfigurationPropertiesInner 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..055f8fbb8c5a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServiceVisibilityImpl.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.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..fb9b14296ef5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesClientImpl.java @@ -0,0 +1,2800 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String serviceName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String serviceName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, serviceName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of private link service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of private link service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of private link service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceInner> + beginCreateOrUpdate(String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters) { + return this.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 the {@link SyncPoller} for polling of private link service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, PrivateLinkServiceInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along + * with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateEndpointConnectionAsync(String resourceGroupName, + String serviceName, String peConnectionName) { + final String expand = null; + return getPrivateEndpointConnectionWithResponseAsync(resourceGroupName, serviceName, peConnectionName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along + * with {@link Response}. + */ + @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(); + } + + /** + * 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 getPrivateEndpointConnectionWithResponse(resourceGroupName, serviceName, peConnectionName, expand, + Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePrivateEndpointConnectionAsync(String resourceGroupName, + String serviceName, String peConnectionName, PrivateEndpointConnectionInner parameters) { + return updatePrivateEndpointConnectionWithResponseAsync(resourceGroupName, serviceName, peConnectionName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 updatePrivateEndpointConnectionWithResponse(resourceGroupName, serviceName, peConnectionName, parameters, + Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeletePrivateEndpointConnection(String resourceGroupName, + String serviceName, String peConnectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeletePrivateEndpointConnection(String resourceGroupName, + String serviceName, String peConnectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility(String location, CheckPrivateLinkServiceVisibilityRequest parameters) { + return this.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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibility(String location, CheckPrivateLinkServiceVisibilityRequest parameters, + Context context) { + return this.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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup(String location, String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters) { + return this.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 the {@link SyncPoller} for polling of response for the CheckPrivateLinkServiceVisibility API service + * call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateLinkServiceVisibilityInner> + beginCheckPrivateLinkServiceVisibilityByResourceGroup(String location, String resourceGroupName, + CheckPrivateLinkServiceVisibilityRequest parameters, Context context) { + return this + .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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of private link service id that can be linked to a private end point with auto approved along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..fd425970c72ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PrivateLinkServicesImpl.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.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; + +public final class PrivateLinkServicesImpl implements PrivateLinkServices { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkServiceImpl(inner1, this.manager())); + } + + 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 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable listAutoApprovedPrivateLinkServices(String location, + Context context) { + PagedIterable inner + = this.serviceClient().listAutoApprovedPrivateLinkServices(location, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PagedIterable + listAutoApprovedPrivateLinkServicesByResourceGroup(String location, String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listAutoApprovedPrivateLinkServicesByResourceGroup(location, resourceGroupName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new AutoApprovedPrivateLinkServiceImpl(inner1, this.manager())); + } + + public PrivateLinkService getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = ResourceManagerUtils.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..de56340095323 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ProbeImpl.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.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.ProbeNoHealthyBackendsBehavior; +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 int port() { + return this.innerModel().port(); + } + + public Integer intervalInSeconds() { + return this.innerModel().intervalInSeconds(); + } + + public ProbeNoHealthyBackendsBehavior noHealthyBackendsBehavior() { + return this.innerModel().noHealthyBackendsBehavior(); + } + + public Integer numberOfProbes() { + return this.innerModel().numberOfProbes(); + } + + public Integer probeThreshold() { + return this.innerModel().probeThreshold(); + } + + 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..dfffa64a2c1ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressImpl.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.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.PublicIpDdosProtectionStatusResult; +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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicIpAddressName = ResourceManagerUtils.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 PublicIpDdosProtectionStatusResult ddosProtectionStatus() { + return serviceManager.publicIpAddresses().ddosProtectionStatus(resourceGroupName, publicIpAddressName); + } + + public PublicIpDdosProtectionStatusResult ddosProtectionStatus(Context context) { + return serviceManager.publicIpAddresses().ddosProtectionStatus(resourceGroupName, publicIpAddressName, context); + } + + 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/PublicIpAddressPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressPropertiesFormatImpl.java new file mode 100644 index 0000000000000..5831835eed219 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressPropertiesFormatImpl.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.implementation; + +import com.azure.core.management.SubResource; +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.fluent.models.PublicIpAddressPropertiesFormatInner; +import com.azure.resourcemanager.network.generated.models.DdosSettings; +import com.azure.resourcemanager.network.generated.models.DeleteOptions; +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.PublicIpAddressPropertiesFormat; +import java.util.Collections; +import java.util.List; + +public final class PublicIpAddressPropertiesFormatImpl implements PublicIpAddressPropertiesFormat { + private PublicIpAddressPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PublicIpAddressPropertiesFormatImpl(PublicIpAddressPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 PublicIpAddressPropertiesFormatInner 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/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..c8ec80d6a4874 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesClientImpl.java @@ -0,0 +1,2896 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.fluent.models.PublicIpDdosProtectionStatusResultInner; +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 { + /** + * 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") + public 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> ddosProtectionStatus(@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.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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedFlux}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 as + * paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 getCloudServicePublicIpAddressWithResponse(resourceGroupName, cloudServiceName, roleInstanceName, + networkInterfaceName, ipConfigurationName, publicIpAddressName, expand, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpAddressName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpAddressName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String publicIpAddressName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String publicIpAddressName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpAddressName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, publicIpAddressName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of public IP address resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of public IP address resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of public IP address resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpAddressInner> + beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters) { + return this.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 the {@link SyncPoller} for polling of public IP address resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpAddressInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpAddressName, PublicIpAddressInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String publicIpAddressName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, publicIpAddressName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String publicIpAddressName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public PublicIpAddressInner updateTags(String resourceGroupName, String publicIpAddressName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, publicIpAddressName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> ddosProtectionStatusWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.ddosProtectionStatus(this.client.getEndpoint(), resourceGroupName, + publicIpAddressName, apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> ddosProtectionStatusWithResponseAsync(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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.ddosProtectionStatus(this.client.getEndpoint(), resourceGroupName, publicIpAddressName, + apiVersion, this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets the Ddos Protection Status of a 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 {@link PollerFlux} for polling of the Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PublicIpDdosProtectionStatusResultInner> + beginDdosProtectionStatusAsync(String resourceGroupName, String publicIpAddressName) { + Mono>> mono + = ddosProtectionStatusWithResponseAsync(resourceGroupName, publicIpAddressName); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PublicIpDdosProtectionStatusResultInner.class, + PublicIpDdosProtectionStatusResultInner.class, this.client.getContext()); + } + + /** + * Gets the Ddos Protection Status of a 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 {@link PollerFlux} for polling of the Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PublicIpDdosProtectionStatusResultInner> + beginDdosProtectionStatusAsync(String resourceGroupName, String publicIpAddressName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = ddosProtectionStatusWithResponseAsync(resourceGroupName, publicIpAddressName, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PublicIpDdosProtectionStatusResultInner.class, + PublicIpDdosProtectionStatusResultInner.class, context); + } + + /** + * Gets the Ddos Protection Status of a 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 {@link SyncPoller} for polling of the Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpDdosProtectionStatusResultInner> + beginDdosProtectionStatus(String resourceGroupName, String publicIpAddressName) { + return this.beginDdosProtectionStatusAsync(resourceGroupName, publicIpAddressName).getSyncPoller(); + } + + /** + * Gets the Ddos Protection Status of a 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 {@link SyncPoller} for polling of the Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpDdosProtectionStatusResultInner> + beginDdosProtectionStatus(String resourceGroupName, String publicIpAddressName, Context context) { + return this.beginDdosProtectionStatusAsync(resourceGroupName, publicIpAddressName, context).getSyncPoller(); + } + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono ddosProtectionStatusAsync(String resourceGroupName, + String publicIpAddressName) { + return beginDdosProtectionStatusAsync(resourceGroupName, publicIpAddressName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono ddosProtectionStatusAsync(String resourceGroupName, + String publicIpAddressName, Context context) { + return beginDdosProtectionStatusAsync(resourceGroupName, publicIpAddressName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpDdosProtectionStatusResultInner ddosProtectionStatus(String resourceGroupName, + String publicIpAddressName) { + return ddosProtectionStatusAsync(resourceGroupName, publicIpAddressName).block(); + } + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicIpDdosProtectionStatusResultInner ddosProtectionStatus(String resourceGroupName, + String publicIpAddressName, Context context) { + return ddosProtectionStatusAsync(resourceGroupName, publicIpAddressName, context).block(); + } + + /** + * 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @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(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getVirtualMachineScaleSetPublicIpAddressWithResponse(resourceGroupName, virtualMachineScaleSetName, + virtualmachineIndex, networkInterfaceName, ipConfigurationName, publicIpAddressName, expand, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpAddresses API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..f0c7075dff93e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpAddressesImpl.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.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.fluent.models.PublicIpDdosProtectionStatusResultInner; +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import com.azure.resourcemanager.network.generated.models.PublicIpAddresses; +import com.azure.resourcemanager.network.generated.models.PublicIpDdosProtectionStatusResult; + +public final class PublicIpAddressesImpl implements PublicIpAddresses { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + 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 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 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + public PublicIpDdosProtectionStatusResult ddosProtectionStatus(String resourceGroupName, + String publicIpAddressName) { + PublicIpDdosProtectionStatusResultInner inner + = this.serviceClient().ddosProtectionStatus(resourceGroupName, publicIpAddressName); + if (inner != null) { + return new PublicIpDdosProtectionStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicIpDdosProtectionStatusResult ddosProtectionStatus(String resourceGroupName, String publicIpAddressName, + Context context) { + PublicIpDdosProtectionStatusResultInner inner + = this.serviceClient().ddosProtectionStatus(resourceGroupName, publicIpAddressName, context); + if (inner != null) { + return new PublicIpDdosProtectionStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listVirtualMachineScaleSetPublicIpAddresses(String resourceGroupName, + String virtualMachineScaleSetName) { + PagedIterable inner = this.serviceClient() + .listVirtualMachineScaleSetPublicIpAddresses(resourceGroupName, virtualMachineScaleSetName); + return ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpAddressImpl(inner1, this.manager())); + } + + 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 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 PublicIpAddress getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpAddressName = ResourceManagerUtils.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/PublicIpDdosProtectionStatusResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpDdosProtectionStatusResultImpl.java new file mode 100644 index 0000000000000..17a0054a6a312 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpDdosProtectionStatusResultImpl.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.PublicIpDdosProtectionStatusResultInner; +import com.azure.resourcemanager.network.generated.models.IsWorkloadProtected; +import com.azure.resourcemanager.network.generated.models.PublicIpDdosProtectionStatusResult; + +public final class PublicIpDdosProtectionStatusResultImpl implements PublicIpDdosProtectionStatusResult { + private PublicIpDdosProtectionStatusResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PublicIpDdosProtectionStatusResultImpl(PublicIpDdosProtectionStatusResultInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String publicIpAddressId() { + return this.innerModel().publicIpAddressId(); + } + + public String publicIpAddress() { + return this.innerModel().publicIpAddress(); + } + + public IsWorkloadProtected isWorkloadProtected() { + return this.innerModel().isWorkloadProtected(); + } + + public String ddosProtectionPlanId() { + return this.innerModel().ddosProtectionPlanId(); + } + + public PublicIpDdosProtectionStatusResultInner 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/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..8f1aaa0e5ce58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicIpPrefixName = ResourceManagerUtils.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/PublicIpPrefixPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixPropertiesFormatImpl.java new file mode 100644 index 0000000000000..1d80c15b95d3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixPropertiesFormatImpl.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.NatGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixPropertiesFormatInner; +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.PublicIpPrefixPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.ReferencedPublicIpAddress; +import java.util.Collections; +import java.util.List; + +public final class PublicIpPrefixPropertiesFormatImpl implements PublicIpPrefixPropertiesFormat { + private PublicIpPrefixPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + PublicIpPrefixPropertiesFormatImpl(PublicIpPrefixPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 PublicIpPrefixPropertiesFormatInner 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/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..b81d6f558827b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpPrefixName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String publicIpPrefixName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String publicIpPrefixName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String publicIpPrefixName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicIpPrefixName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, publicIpPrefixName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpPrefixInner> + beginCreateOrUpdate(String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters) { + return this.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 the {@link SyncPoller} for polling of public IP prefix resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicIpPrefixInner> beginCreateOrUpdate( + String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String publicIpPrefixName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, publicIpPrefixName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String publicIpPrefixName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, publicIpPrefixName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpPrefixes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpPrefixes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListPublicIpPrefixes API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..f534216bd6f03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/PublicIpPrefixesImpl.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.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; + +public final class PublicIpPrefixesImpl implements PublicIpPrefixes { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicIpPrefixImpl(inner1, this.manager())); + } + + public PublicIpPrefix getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicIpPrefixName = ResourceManagerUtils.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/QueryResultsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/QueryResultsImpl.java new file mode 100644 index 0000000000000..aa5d58f8d9c05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/QueryResultsImpl.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.resourcemanager.network.generated.fluent.models.QueryResultsInner; +import com.azure.resourcemanager.network.generated.models.QueryResults; +import com.azure.resourcemanager.network.generated.models.SingleQueryResult; +import java.util.Collections; +import java.util.List; + +public final class QueryResultsImpl implements QueryResults { + private QueryResultsInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + QueryResultsImpl(QueryResultsInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Long matchingRecordsCount() { + return this.innerModel().matchingRecordsCount(); + } + + public List signatures() { + List inner = this.innerModel().signatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public QueryResultsInner 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/ResourceManagerUtils.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceManagerUtils.java new file mode 100644 index 0000000000000..19b36c2f9ddfe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceManagerUtils.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.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 ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/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..21bffb7257265 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksClientImpl.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.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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String virtualNetworkName, + String subnetName) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String virtualNetworkName, String subnetName, Context context) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listWithResponse(resourceGroupName, virtualNetworkName, subnetName, Context.NONE).getValue(); + } +} 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..1a77d4931eb4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksImpl.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.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; + +public final class ResourceNavigationLinksImpl implements ResourceNavigationLinks { + private static 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 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; + } + } + + 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; + } + } + + 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..c9671002b5ff1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceNavigationLinksListResultImpl.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.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..0c47c09600278 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,2913 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.ActiveConnectivityConfigurationsListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ActiveSecurityAdminRulesListResultInner; +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.ExpressRouteProviderPortInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveConnectivityConfigurationListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveSecurityAdminRulesListResultInner; +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.ActiveConfigurationParameter; +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.BastionShareableLinkTokenListRequest; +import com.azure.resourcemanager.network.generated.models.QueryRequestOptions; +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 { + /** + * 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") + public 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}/deleteShareableLinksByToken") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteBastionShareableLinkByToken(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("bastionHostName") String bastionHostname, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") BastionShareableLinkTokenListRequest bslTokenRequest, + @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}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> expressRouteProviderPort(@HostParam("$host") String endpoint, + @PathParam("providerport") String providerport, @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/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listActiveConnectivityConfigurations( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("$top") Integer top, + @BodyParam("application/json") ActiveConfigurationParameter parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityAdminRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listActiveSecurityAdminRules( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("$top") Integer top, + @BodyParam("application/json") ActiveConfigurationParameter parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> + listNetworkManagerEffectiveConnectivityConfigurations(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, + @BodyParam("application/json") QueryRequestOptions parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> + listNetworkManagerEffectiveSecurityAdminRules(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, + @BodyParam("application/json") QueryRequestOptions parameters, @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 Create/Delete/Get 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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, this.client.getContext()) + .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 Create/Delete/Get 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 Create/Delete/Get 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 as paginated response with {@link PagedFlux}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedFlux}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 Create/Delete/Get 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 Create/Delete/Get 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 Create/Delete/Get 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 Create/Delete/Get 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 Create/Delete/Get 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBastionShareableLink(String resourceGroupName, + String bastionHostname, BastionShareableLinkListRequest bslRequest) { + return this.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 Create/Delete/Get 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBastionShareableLink(String resourceGroupName, + String bastionHostname, BastionShareableLinkListRequest bslRequest, Context context) { + return this.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 Create/Delete/Get 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 A {@link Mono} that completes when a successful response is received. + */ + @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 Create/Delete/Get 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 A {@link Mono} that completes when a successful response is received. + */ + @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 Create/Delete/Get 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 Create/Delete/Get 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(); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteBastionShareableLinkByTokenWithResponseAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 (bslTokenRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter bslTokenRequest is required and cannot be null.")); + } else { + bslTokenRequest.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.deleteBastionShareableLinkByToken(this.client.getEndpoint(), resourceGroupName, + bastionHostname, apiVersion, this.client.getSubscriptionId(), bslTokenRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteBastionShareableLinkByTokenWithResponseAsync( + String resourceGroupName, String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 (bslTokenRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter bslTokenRequest is required and cannot be null.")); + } else { + bslTokenRequest.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteBastionShareableLinkByToken(this.client.getEndpoint(), resourceGroupName, bastionHostname, + apiVersion, this.client.getSubscriptionId(), bslTokenRequest, accept, context); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteBastionShareableLinkByTokenAsync(String resourceGroupName, + String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest) { + Mono>> mono + = deleteBastionShareableLinkByTokenWithResponseAsync(resourceGroupName, bastionHostname, bslTokenRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteBastionShareableLinkByTokenAsync(String resourceGroupName, + String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteBastionShareableLinkByTokenWithResponseAsync(resourceGroupName, + bastionHostname, bslTokenRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBastionShareableLinkByToken(String resourceGroupName, + String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest) { + return this.beginDeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostname, bslTokenRequest) + .getSyncPoller(); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBastionShareableLinkByToken(String resourceGroupName, + String bastionHostname, BastionShareableLinkTokenListRequest bslTokenRequest, Context context) { + return this + .beginDeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostname, bslTokenRequest, context) + .getSyncPoller(); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteBastionShareableLinkByTokenAsync(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest) { + return beginDeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostname, bslTokenRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteBastionShareableLinkByTokenAsync(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest, Context context) { + return beginDeleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostname, bslTokenRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest) { + deleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostname, bslTokenRequest).block(); + } + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest, Context context) { + deleteBastionShareableLinkByTokenAsync(resourceGroupName, bastionHostname, bslTokenRequest, 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 Create/Delete/Get 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 Create/Delete/Get 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 Create/Delete/Get 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 as paginated response with {@link PagedFlux}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedFlux}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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, this.client.getContext()) + .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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkDnsNameAvailabilityAsync(String location, + String domainNameLabel) { + return checkDnsNameAvailabilityWithResponseAsync(location, domainNameLabel) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkDnsNameAvailabilityWithResponse(String location, + String domainNameLabel, Context context) { + return checkDnsNameAvailabilityWithResponseAsync(location, domainNameLabel, context).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]$. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 checkDnsNameAvailabilityWithResponse(location, domainNameLabel, Context.NONE).getValue(); + } + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + expressRouteProviderPortWithResponseAsync(String providerport) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (providerport == null) { + return Mono.error(new IllegalArgumentException("Parameter providerport is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.expressRouteProviderPort(this.client.getEndpoint(), providerport, + apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> expressRouteProviderPortWithResponseAsync(String providerport, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (providerport == null) { + return Mono.error(new IllegalArgumentException("Parameter providerport is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.expressRouteProviderPort(this.client.getEndpoint(), providerport, apiVersion, + this.client.getSubscriptionId(), accept, context); + } + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono expressRouteProviderPortAsync(String providerport) { + return expressRouteProviderPortWithResponseAsync(providerport).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response expressRouteProviderPortWithResponse(String providerport, + Context context) { + return expressRouteProviderPortWithResponseAsync(providerport, context).block(); + } + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExpressRouteProviderPortInner expressRouteProviderPort(String providerport) { + return expressRouteProviderPortWithResponse(providerport, Context.NONE).getValue(); + } + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 active connectivity configurations along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listActiveConnectivityConfigurationsWithResponseAsync(String resourceGroupName, String networkManagerName, + ActiveConfigurationParameter parameters, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listActiveConnectivityConfigurations(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, top, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 active connectivity configurations along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listActiveConnectivityConfigurationsWithResponseAsync(String resourceGroupName, String networkManagerName, + ActiveConfigurationParameter parameters, Integer top, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listActiveConnectivityConfigurations(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, top, parameters, accept, context); + } + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration 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 active connectivity configurations on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listActiveConnectivityConfigurationsAsync( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters) { + final Integer top = null; + return listActiveConnectivityConfigurationsWithResponseAsync(resourceGroupName, networkManagerName, parameters, + top).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 active connectivity configurations along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listActiveConnectivityConfigurationsWithResponse( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top, + Context context) { + return listActiveConnectivityConfigurationsWithResponseAsync(resourceGroupName, networkManagerName, parameters, + top, context).block(); + } + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration 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 active connectivity configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveConnectivityConfigurationsListResultInner listActiveConnectivityConfigurations( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters) { + final Integer top = null; + return listActiveConnectivityConfigurationsWithResponse(resourceGroupName, networkManagerName, parameters, top, + Context.NONE).getValue(); + } + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 active security admin rules along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listActiveSecurityAdminRulesWithResponseAsync( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listActiveSecurityAdminRules(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, top, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 active security admin rules along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listActiveSecurityAdminRulesWithResponseAsync( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listActiveSecurityAdminRules(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, top, parameters, accept, context); + } + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration 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 active security admin rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listActiveSecurityAdminRulesAsync(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters) { + final Integer top = null; + return listActiveSecurityAdminRulesWithResponseAsync(resourceGroupName, networkManagerName, parameters, top) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 active security admin rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listActiveSecurityAdminRulesWithResponse( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top, + Context context) { + return listActiveSecurityAdminRulesWithResponseAsync(resourceGroupName, networkManagerName, parameters, top, + context).block(); + } + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration 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 active security admin rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ActiveSecurityAdminRulesListResultInner listActiveSecurityAdminRules(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters) { + final Integer top = null; + return listActiveSecurityAdminRulesWithResponse(resourceGroupName, networkManagerName, parameters, top, + Context.NONE).getValue(); + } + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveConnectivityConfiguration along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNetworkManagerEffectiveConnectivityConfigurationsWithResponseAsync(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNetworkManagerEffectiveConnectivityConfigurations( + this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, + apiVersion, top, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveConnectivityConfiguration along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNetworkManagerEffectiveConnectivityConfigurationsWithResponseAsync(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top, 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 (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNetworkManagerEffectiveConnectivityConfigurations(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, apiVersion, top, parameters, accept, + context); + } + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveConnectivityConfiguration on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + listNetworkManagerEffectiveConnectivityConfigurationsAsync(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters) { + final Integer top = null; + return listNetworkManagerEffectiveConnectivityConfigurationsWithResponseAsync(resourceGroupName, + virtualNetworkName, parameters, top).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveConnectivityConfiguration along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listNetworkManagerEffectiveConnectivityConfigurationsWithResponse(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top, Context context) { + return listNetworkManagerEffectiveConnectivityConfigurationsWithResponseAsync(resourceGroupName, + virtualNetworkName, parameters, top, context).block(); + } + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveConnectivityConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerEffectiveConnectivityConfigurationListResultInner + listNetworkManagerEffectiveConnectivityConfigurations(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters) { + final Integer top = null; + return listNetworkManagerEffectiveConnectivityConfigurationsWithResponse(resourceGroupName, virtualNetworkName, + parameters, top, Context.NONE).getValue(); + } + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveSecurityAdminRules along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNetworkManagerEffectiveSecurityAdminRulesWithResponseAsync(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNetworkManagerEffectiveSecurityAdminRules(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, apiVersion, top, parameters, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveSecurityAdminRules along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNetworkManagerEffectiveSecurityAdminRulesWithResponseAsync(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top, 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 (virtualNetworkName == null) { + return Mono + .error(new IllegalArgumentException("Parameter virtualNetworkName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNetworkManagerEffectiveSecurityAdminRules(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, virtualNetworkName, apiVersion, top, parameters, accept, + context); + } + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveSecurityAdminRules on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + listNetworkManagerEffectiveSecurityAdminRulesAsync(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters) { + final Integer top = null; + return listNetworkManagerEffectiveSecurityAdminRulesWithResponseAsync(resourceGroupName, virtualNetworkName, + parameters, top).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveSecurityAdminRules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listNetworkManagerEffectiveSecurityAdminRulesWithResponse(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters, Integer top, Context context) { + return listNetworkManagerEffectiveSecurityAdminRulesWithResponseAsync(resourceGroupName, virtualNetworkName, + parameters, top, context).block(); + } + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 networkManagerEffectiveSecurityAdminRules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerEffectiveSecurityAdminRulesListResultInner listNetworkManagerEffectiveSecurityAdminRules( + String resourceGroupName, String virtualNetworkName, QueryRequestOptions parameters) { + final Integer top = null; + return listNetworkManagerEffectiveSecurityAdminRulesWithResponse(resourceGroupName, virtualNetworkName, + parameters, top, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono supportedSecurityProvidersAsync(String resourceGroupName, + String virtualWanName) { + return supportedSecurityProvidersWithResponseAsync(resourceGroupName, virtualWanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response supportedSecurityProvidersWithResponse(String resourceGroupName, + String virtualWanName, Context context) { + return supportedSecurityProvidersWithResponseAsync(resourceGroupName, virtualWanName, 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) + public VirtualWanSecurityProvidersInner supportedSecurityProviders(String resourceGroupName, + String virtualWanName) { + return supportedSecurityProvidersWithResponse(resourceGroupName, virtualWanName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile(String resourceGroupName, String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams) { + return this + .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 the {@link SyncPoller} for polling of vpn Profile Response for package generation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnProfileResponseInner> + beginGeneratevirtualwanvpnserverconfigurationvpnprofile(String resourceGroupName, String virtualWanName, + VirtualWanVpnProfileParameters vpnClientParams, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for all the Bastion Shareable Link endpoints along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetActiveSessions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for DisconnectActiveSessions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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..89c0bcc8fbf67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ResourceProvidersImpl.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.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.ActiveConnectivityConfigurationsListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.ActiveSecurityAdminRulesListResultInner; +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.ExpressRouteProviderPortInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveConnectivityConfigurationListResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveSecurityAdminRulesListResultInner; +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.ActiveConfigurationParameter; +import com.azure.resourcemanager.network.generated.models.ActiveConnectivityConfigurationsListResult; +import com.azure.resourcemanager.network.generated.models.ActiveSecurityAdminRulesListResult; +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.BastionShareableLinkTokenListRequest; +import com.azure.resourcemanager.network.generated.models.DnsNameAvailabilityResult; +import com.azure.resourcemanager.network.generated.models.ExpressRouteProviderPort; +import com.azure.resourcemanager.network.generated.models.NetworkManagerEffectiveConnectivityConfigurationListResult; +import com.azure.resourcemanager.network.generated.models.NetworkManagerEffectiveSecurityAdminRulesListResult; +import com.azure.resourcemanager.network.generated.models.QueryRequestOptions; +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; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static 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 ResourceManagerUtils.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 ResourceManagerUtils.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 void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest) { + this.serviceClient().deleteBastionShareableLinkByToken(resourceGroupName, bastionHostname, bslTokenRequest); + } + + public void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest, Context context) { + this.serviceClient() + .deleteBastionShareableLinkByToken(resourceGroupName, bastionHostname, bslTokenRequest, context); + } + + public PagedIterable getBastionShareableLink(String resourceGroupName, String bastionHostname, + BastionShareableLinkListRequest bslRequest) { + PagedIterable inner + = this.serviceClient().getBastionShareableLink(resourceGroupName, bastionHostname, bslRequest); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new BastionShareableLinkImpl(inner1, this.manager())); + } + + public PagedIterable getActiveSessions(String resourceGroupName, String bastionHostname) { + PagedIterable inner + = this.serviceClient().getActiveSessions(resourceGroupName, bastionHostname); + return ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new BastionSessionStateImpl(inner1, this.manager())); + } + + 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 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 expressRouteProviderPortWithResponse(String providerport, + Context context) { + Response inner + = this.serviceClient().expressRouteProviderPortWithResponse(providerport, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExpressRouteProviderPortImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExpressRouteProviderPort expressRouteProviderPort(String providerport) { + ExpressRouteProviderPortInner inner = this.serviceClient().expressRouteProviderPort(providerport); + if (inner != null) { + return new ExpressRouteProviderPortImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listActiveConnectivityConfigurationsWithResponse( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top, + Context context) { + Response inner = this.serviceClient() + .listActiveConnectivityConfigurationsWithResponse(resourceGroupName, networkManagerName, parameters, top, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ActiveConnectivityConfigurationsListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ActiveConnectivityConfigurationsListResult listActiveConnectivityConfigurations(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters) { + ActiveConnectivityConfigurationsListResultInner inner = this.serviceClient() + .listActiveConnectivityConfigurations(resourceGroupName, networkManagerName, parameters); + if (inner != null) { + return new ActiveConnectivityConfigurationsListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listActiveSecurityAdminRulesWithResponse( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top, + Context context) { + Response inner = this.serviceClient() + .listActiveSecurityAdminRulesWithResponse(resourceGroupName, networkManagerName, parameters, top, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ActiveSecurityAdminRulesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ActiveSecurityAdminRulesListResult listActiveSecurityAdminRules(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters) { + ActiveSecurityAdminRulesListResultInner inner + = this.serviceClient().listActiveSecurityAdminRules(resourceGroupName, networkManagerName, parameters); + if (inner != null) { + return new ActiveSecurityAdminRulesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response + listNetworkManagerEffectiveConnectivityConfigurationsWithResponse(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top, Context context) { + Response inner = this.serviceClient() + .listNetworkManagerEffectiveConnectivityConfigurationsWithResponse(resourceGroupName, virtualNetworkName, + parameters, top, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerEffectiveConnectivityConfigurationListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManagerEffectiveConnectivityConfigurationListResult + listNetworkManagerEffectiveConnectivityConfigurations(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters) { + NetworkManagerEffectiveConnectivityConfigurationListResultInner inner = this.serviceClient() + .listNetworkManagerEffectiveConnectivityConfigurations(resourceGroupName, virtualNetworkName, parameters); + if (inner != null) { + return new NetworkManagerEffectiveConnectivityConfigurationListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response + listNetworkManagerEffectiveSecurityAdminRulesWithResponse(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters, Integer top, Context context) { + Response inner = this.serviceClient() + .listNetworkManagerEffectiveSecurityAdminRulesWithResponse(resourceGroupName, virtualNetworkName, + parameters, top, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerEffectiveSecurityAdminRulesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManagerEffectiveSecurityAdminRulesListResult listNetworkManagerEffectiveSecurityAdminRules( + String resourceGroupName, String virtualNetworkName, QueryRequestOptions parameters) { + NetworkManagerEffectiveSecurityAdminRulesListResultInner inner = this.serviceClient() + .listNetworkManagerEffectiveSecurityAdminRules(resourceGroupName, virtualNetworkName, parameters); + if (inner != null) { + return new NetworkManagerEffectiveSecurityAdminRulesListResultImpl(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 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 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..c72660facc2db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeFilterName = ResourceManagerUtils.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..137835a728f9e --- /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..392b83e5dfbbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesClientImpl.java @@ -0,0 +1,944 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName, + String ruleName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName, + String ruleName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithResponseAsync(resourceGroupName, routeFilterName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String routeFilterName, + String ruleName, Context context) { + return getWithResponseAsync(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) + public RouteFilterRuleInner get(String resourceGroupName, String routeFilterName, String ruleName) { + return getWithResponse(resourceGroupName, routeFilterName, ruleName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, String ruleName, + RouteFilterRuleInner routeFilterRuleParameters) { + return this.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 the {@link SyncPoller} for polling of route Filter Rule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterRuleInner> beginCreateOrUpdate( + String resourceGroupName, String routeFilterName, String ruleName, + RouteFilterRuleInner routeFilterRuleParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteFilterRules API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteFilterRules API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..25c0e34b81c99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFilterRulesImpl.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.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; + +public final class RouteFilterRulesImpl implements RouteFilterRules { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.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..ba0ef9f74ca0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeFilterName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String routeFilterName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String routeFilterName, + String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeFilterName, expand, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, routeFilterName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterInner> beginCreateOrUpdate(String resourceGroupName, + String routeFilterName, RouteFilterInner routeFilterParameters) { + return this.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 the {@link SyncPoller} for polling of route Filter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteFilterInner> beginCreateOrUpdate(String resourceGroupName, + String routeFilterName, RouteFilterInner routeFilterParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String routeFilterName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, routeFilterName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String routeFilterName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, routeFilterName, parameters, 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) + public RouteFilterInner updateTags(String resourceGroupName, String routeFilterName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, routeFilterName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteFilters API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..9dcb91b90fbac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteFiltersImpl.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.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; + +public final class RouteFiltersImpl implements RouteFilters { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteFilterImpl(inner1, this.manager())); + } + + public RouteFilter getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeFilterName = ResourceManagerUtils.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..d10f87ad76ee1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeTableName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "routeTables"); + this.routeName = ResourceManagerUtils.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; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapImpl.java new file mode 100644 index 0000000000000..1bb731c52aac0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteMapInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RouteMap; +import com.azure.resourcemanager.network.generated.models.RouteMapRule; +import java.util.Collections; +import java.util.List; + +public final class RouteMapImpl implements RouteMap, RouteMap.Definition, RouteMap.Update { + private RouteMapInner 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 associatedInboundConnections() { + List inner = this.innerModel().associatedInboundConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List associatedOutboundConnections() { + List inner = this.innerModel().associatedOutboundConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + public RouteMapInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private String routeMapName; + + public RouteMapImpl withExistingVirtualHub(String resourceGroupName, String virtualHubName) { + this.resourceGroupName = resourceGroupName; + this.virtualHubName = virtualHubName; + return this; + } + + public RouteMap create() { + this.innerObject = serviceManager.serviceClient() + .getRouteMaps() + .createOrUpdate(resourceGroupName, virtualHubName, routeMapName, this.innerModel(), Context.NONE); + return this; + } + + public RouteMap create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRouteMaps() + .createOrUpdate(resourceGroupName, virtualHubName, routeMapName, this.innerModel(), context); + return this; + } + + RouteMapImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RouteMapInner(); + this.serviceManager = serviceManager; + this.routeMapName = name; + } + + public RouteMapImpl update() { + return this; + } + + public RouteMap apply() { + this.innerObject = serviceManager.serviceClient() + .getRouteMaps() + .createOrUpdate(resourceGroupName, virtualHubName, routeMapName, this.innerModel(), Context.NONE); + return this; + } + + public RouteMap apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRouteMaps() + .createOrUpdate(resourceGroupName, virtualHubName, routeMapName, this.innerModel(), context); + return this; + } + + RouteMapImpl(RouteMapInner innerObject, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routeMapName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "routeMaps"); + } + + public RouteMap refresh() { + this.innerObject = serviceManager.serviceClient() + .getRouteMaps() + .getWithResponse(resourceGroupName, virtualHubName, routeMapName, Context.NONE) + .getValue(); + return this; + } + + public RouteMap refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRouteMaps() + .getWithResponse(resourceGroupName, virtualHubName, routeMapName, context) + .getValue(); + return this; + } + + public RouteMapImpl withAssociatedInboundConnections(List associatedInboundConnections) { + this.innerModel().withAssociatedInboundConnections(associatedInboundConnections); + return this; + } + + public RouteMapImpl withAssociatedOutboundConnections(List associatedOutboundConnections) { + this.innerModel().withAssociatedOutboundConnections(associatedOutboundConnections); + return this; + } + + public RouteMapImpl 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/RouteMapsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsClientImpl.java new file mode 100644 index 0000000000000..e1b04c154d383 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsClientImpl.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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RouteMapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteMapInner; +import com.azure.resourcemanager.network.generated.models.ListRouteMapsResult; +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 RouteMapsClient. + */ +public final class RouteMapsClientImpl implements RouteMapsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RouteMapsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RouteMapsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RouteMapsClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(RouteMapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRouteMaps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface RouteMapsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, @PathParam("routeMapName") String routeMapName, + @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}/routeMaps/{routeMapName}") + @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("routeMapName") String routeMapName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RouteMapInner routeMapParameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}") + @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("routeMapName") String routeMapName, + @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}/routeMaps") + @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 RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String virtualHubName, + String routeMapName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (routeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeMapName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, routeMapName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String virtualHubName, + String routeMapName, 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 (routeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeMapName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, routeMapName, apiVersion, accept, context); + } + + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, String routeMapName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeMapName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String virtualHubName, String routeMapName, + Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeMapName, context).block(); + } + + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteMapInner get(String resourceGroupName, String virtualHubName, String routeMapName) { + return getWithResponse(resourceGroupName, virtualHubName, routeMapName, Context.NONE).getValue(); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (routeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeMapName is required and cannot be null.")); + } + if (routeMapParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeMapParameters is required and cannot be null.")); + } else { + routeMapParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, routeMapName, apiVersion, routeMapParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters, 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 (routeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeMapName is required and cannot be null.")); + } + if (routeMapParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeMapParameters is required and cannot be null.")); + } else { + routeMapParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, routeMapName, apiVersion, routeMapParameters, accept, context); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteMapInner> beginCreateOrUpdateAsync(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RouteMapInner.class, RouteMapInner.class, this.client.getContext()); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RouteMapInner> beginCreateOrUpdateAsync(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, + routeMapName, routeMapParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RouteMapInner.class, RouteMapInner.class, context); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteMapInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters) + .getSyncPoller(); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteMapInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routeMapName, RouteMapInner routeMapParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, context) + .getSyncPoller(); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String virtualHubName, + String routeMapName, RouteMapInner routeMapParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String virtualHubName, + String routeMapName, RouteMapInner routeMapParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteMapInner createOrUpdate(String resourceGroupName, String virtualHubName, String routeMapName, + RouteMapInner routeMapParameters) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters).block(); + } + + /** + * Creates a RouteMap if it doesn't exist else updates the existing one. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param routeMapParameters Parameters supplied to create or update a RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RouteMapInner createOrUpdate(String resourceGroupName, String virtualHubName, String routeMapName, + RouteMapInner routeMapParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, routeMapName, routeMapParameters, context) + .block(); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualHubName, + String routeMapName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (routeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeMapName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, routeMapName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualHubName, + String routeMapName, 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 (routeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter routeMapName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, routeMapName, apiVersion, accept, context); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualHubName, + String routeMapName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualHubName, routeMapName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualHubName, + String routeMapName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualHubName, routeMapName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routeMapName) { + return this.beginDeleteAsync(resourceGroupName, virtualHubName, routeMapName).getSyncPoller(); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routeMapName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualHubName, routeMapName, context).getSyncPoller(); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualHubName, String routeMapName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeMapName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualHubName, String routeMapName, + Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routeMapName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeMapName) { + deleteAsync(resourceGroupName, virtualHubName, routeMapName).block(); + } + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routeMapName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, routeMapName, context).block(); + } + + /** + * Retrieves the details of all RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RouteMaps and a URL nextLink to get the next set of results along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RouteMaps and a URL nextLink to get the next set of results along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedFlux}. + */ + @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 RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedFlux}. + */ + @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 RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of RouteMaps and a URL nextLink to get the next set of results along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 RouteMaps and a URL nextLink to get the next set of results along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsImpl.java new file mode 100644 index 0000000000000..ea98eff8b3cfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteMapsImpl.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.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.RouteMapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.RouteMapInner; +import com.azure.resourcemanager.network.generated.models.RouteMap; +import com.azure.resourcemanager.network.generated.models.RouteMaps; + +public final class RouteMapsImpl implements RouteMaps { + private static final ClientLogger LOGGER = new ClientLogger(RouteMapsImpl.class); + + private final RouteMapsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RouteMapsImpl(RouteMapsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String virtualHubName, String routeMapName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, routeMapName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RouteMapImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RouteMap get(String resourceGroupName, String virtualHubName, String routeMapName) { + RouteMapInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, routeMapName); + if (inner != null) { + return new RouteMapImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String routeMapName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeMapName); + } + + public void delete(String resourceGroupName, String virtualHubName, String routeMapName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routeMapName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteMapImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteMapImpl(inner1, this.manager())); + } + + public RouteMap getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routeMapName = ResourceManagerUtils.getValueFromIdByName(id, "routeMaps"); + if (routeMapName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeMaps'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeMapName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routeMapName = ResourceManagerUtils.getValueFromIdByName(id, "routeMaps"); + if (routeMapName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeMaps'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routeMapName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routeMapName = ResourceManagerUtils.getValueFromIdByName(id, "routeMaps"); + if (routeMapName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeMaps'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeMapName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routeMapName = ResourceManagerUtils.getValueFromIdByName(id, "routeMaps"); + if (routeMapName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeMaps'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routeMapName, context); + } + + private RouteMapsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RouteMapImpl define(String name) { + return new RouteMapImpl(name, this.manager()); + } +} 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..4826befc655e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTableImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.routeTableName = ResourceManagerUtils.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..33ddba74227d7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesClientImpl.java @@ -0,0 +1,1186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String routeTableName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String routeTableName, + String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, routeTableName, expand, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, routeTableName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of route table resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of route table resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route table resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteTableInner> beginCreateOrUpdate(String resourceGroupName, + String routeTableName, RouteTableInner parameters) { + return this.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 the {@link SyncPoller} for polling of route table resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteTableInner> beginCreateOrUpdate(String resourceGroupName, + String routeTableName, RouteTableInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String routeTableName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, routeTableName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String routeTableName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public RouteTableInner updateTags(String resourceGroupName, String routeTableName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, routeTableName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRouteTable API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..28a91f67627a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RouteTablesImpl.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.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; + +public final class RouteTablesImpl implements RouteTables { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RouteTableImpl(inner1, this.manager())); + } + + public RouteTable getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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..00be9346b10c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesClientImpl.java @@ -0,0 +1,920 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName, + String routeName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String routeTableName, + String routeName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String routeTableName, String routeName) { + return getWithResponseAsync(resourceGroupName, routeTableName, routeName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String routeTableName, String routeName, + Context context) { + return getWithResponseAsync(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) + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) { + return getWithResponse(resourceGroupName, routeTableName, routeName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of route resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of route resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of route resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreateOrUpdate(String resourceGroupName, + String routeTableName, String routeName, RouteInner routeParameters) { + return this.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 the {@link SyncPoller} for polling of route resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RouteInner> beginCreateOrUpdate(String resourceGroupName, + String routeTableName, String routeName, RouteInner routeParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListRoute API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..0bc2bb0473243 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutesImpl.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.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; + +public final class RoutesImpl implements Routes { + private static 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 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 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 PagedIterable list(String resourceGroupName, String routeTableName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, routeTableName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new RouteImpl(inner1, this.manager())); + } + + public Route getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String routeTableName = ResourceManagerUtils.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 = ResourceManagerUtils.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/RoutingIntentImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentImpl.java new file mode 100644 index 0000000000000..424a758522712 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentImpl.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.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingIntent; +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import java.util.Collections; +import java.util.List; + +public final class RoutingIntentImpl implements RoutingIntent, RoutingIntent.Definition, RoutingIntent.Update { + private RoutingIntentInner 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 routingPolicies() { + List inner = this.innerModel().routingPolicies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RoutingIntentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String virtualHubName; + + private String routingIntentName; + + public RoutingIntentImpl withExistingVirtualHub(String resourceGroupName, String virtualHubName) { + this.resourceGroupName = resourceGroupName; + this.virtualHubName = virtualHubName; + return this; + } + + public RoutingIntent create() { + this.innerObject = serviceManager.serviceClient() + .getRoutingIntents() + .createOrUpdate(resourceGroupName, virtualHubName, routingIntentName, this.innerModel(), Context.NONE); + return this; + } + + public RoutingIntent create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingIntents() + .createOrUpdate(resourceGroupName, virtualHubName, routingIntentName, this.innerModel(), context); + return this; + } + + RoutingIntentImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RoutingIntentInner(); + this.serviceManager = serviceManager; + this.routingIntentName = name; + } + + public RoutingIntentImpl update() { + return this; + } + + public RoutingIntent apply() { + this.innerObject = serviceManager.serviceClient() + .getRoutingIntents() + .createOrUpdate(resourceGroupName, virtualHubName, routingIntentName, this.innerModel(), Context.NONE); + return this; + } + + public RoutingIntent apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingIntents() + .createOrUpdate(resourceGroupName, virtualHubName, routingIntentName, this.innerModel(), context); + return this; + } + + RoutingIntentImpl(RoutingIntentInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualHubs"); + this.routingIntentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "routingIntent"); + } + + public RoutingIntent refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoutingIntents() + .getWithResponse(resourceGroupName, virtualHubName, routingIntentName, Context.NONE) + .getValue(); + return this; + } + + public RoutingIntent refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingIntents() + .getWithResponse(resourceGroupName, virtualHubName, routingIntentName, context) + .getValue(); + return this; + } + + public RoutingIntentImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public RoutingIntentImpl withRoutingPolicies(List routingPolicies) { + this.innerModel().withRoutingPolicies(routingPolicies); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsClientImpl.java new file mode 100644 index 0000000000000..f68f2af6d15c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsClientImpl.java @@ -0,0 +1,952 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RoutingIntentsClient; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner; +import com.azure.resourcemanager.network.generated.models.ListRoutingIntentResult; +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 RoutingIntentsClient. + */ +public final class RoutingIntentsClientImpl implements RoutingIntentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RoutingIntentsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutingIntentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutingIntentsClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(RoutingIntentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRoutingIntents to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface RoutingIntentsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}") + @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("routingIntentName") String routingIntentName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") RoutingIntentInner routingIntentParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, + @PathParam("routingIntentName") String routingIntentName, @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}/routingIntent/{routingIntentName}") + @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("routingIntentName") String routingIntentName, @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}/routingIntent") + @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 RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualHubName, String routingIntentName, RoutingIntentInner routingIntentParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (routingIntentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingIntentName is required and cannot be null.")); + } + if (routingIntentParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter routingIntentParameters is required and cannot be null.")); + } else { + routingIntentParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, routingIntentName, apiVersion, routingIntentParameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String virtualHubName, String routingIntentName, RoutingIntentInner routingIntentParameters, 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 (routingIntentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingIntentName is required and cannot be null.")); + } + if (routingIntentParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter routingIntentParameters is required and cannot be null.")); + } else { + routingIntentParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, routingIntentName, apiVersion, routingIntentParameters, accept, context); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RoutingIntentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHubName, String routingIntentName, + RoutingIntentInner routingIntentParameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, + routingIntentName, routingIntentParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RoutingIntentInner.class, RoutingIntentInner.class, this.client.getContext()); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RoutingIntentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualHubName, String routingIntentName, + RoutingIntentInner routingIntentParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, virtualHubName, + routingIntentName, routingIntentParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + RoutingIntentInner.class, RoutingIntentInner.class, context); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutingIntentInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routingIntentName, RoutingIntentInner routingIntentParameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters) + .getSyncPoller(); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RoutingIntentInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String routingIntentName, RoutingIntentInner routingIntentParameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, + context) + .getSyncPoller(); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String virtualHubName, + String routingIntentName, RoutingIntentInner routingIntentParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String virtualHubName, + String routingIntentName, RoutingIntentInner routingIntentParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutingIntentInner createOrUpdate(String resourceGroupName, String virtualHubName, String routingIntentName, + RoutingIntentInner routingIntentParameters) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters) + .block(); + } + + /** + * Creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the per VirtualHub singleton Routing Intent resource. + * @param routingIntentParameters Parameters supplied to create or update RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutingIntentInner createOrUpdate(String resourceGroupName, String virtualHubName, String routingIntentName, + RoutingIntentInner routingIntentParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters, + context).block(); + } + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String virtualHubName, + String routingIntentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (routingIntentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingIntentName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, routingIntentName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String virtualHubName, + String routingIntentName, 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 (routingIntentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingIntentName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, routingIntentName, apiVersion, accept, context); + } + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, + String routingIntentName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routingIntentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String virtualHubName, + String routingIntentName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routingIntentName, context).block(); + } + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutingIntentInner get(String resourceGroupName, String virtualHubName, String routingIntentName) { + return getWithResponse(resourceGroupName, virtualHubName, routingIntentName, Context.NONE).getValue(); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualHubName, + String routingIntentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (routingIntentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingIntentName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, routingIntentName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String virtualHubName, + String routingIntentName, 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 (routingIntentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routingIntentName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, routingIntentName, apiVersion, accept, context); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualHubName, + String routingIntentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualHubName, routingIntentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String virtualHubName, + String routingIntentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, virtualHubName, routingIntentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routingIntentName) { + return this.beginDeleteAsync(resourceGroupName, virtualHubName, routingIntentName).getSyncPoller(); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routingIntentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, virtualHubName, routingIntentName, context).getSyncPoller(); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualHubName, String routingIntentName) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routingIntentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String virtualHubName, String routingIntentName, + Context context) { + return beginDeleteAsync(resourceGroupName, virtualHubName, routingIntentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routingIntentName) { + deleteAsync(resourceGroupName, virtualHubName, routingIntentName).block(); + } + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 routingIntentName, Context context) { + deleteAsync(resourceGroupName, virtualHubName, routingIntentName, context).block(); + } + + /** + * Retrieves the details of all RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedFlux}. + */ + @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 RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedFlux}. + */ + @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 RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String virtualHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, virtualHubName)); + } + + /** + * Retrieves the details of all RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of the routing intent result and a URL nextLink to get the next set of results along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing intent result and a URL nextLink to get the next set of results along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsImpl.java new file mode 100644 index 0000000000000..c7cc0140e5b28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingIntentsImpl.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.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.RoutingIntentsClient; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner; +import com.azure.resourcemanager.network.generated.models.RoutingIntent; +import com.azure.resourcemanager.network.generated.models.RoutingIntents; + +public final class RoutingIntentsImpl implements RoutingIntents { + private static final ClientLogger LOGGER = new ClientLogger(RoutingIntentsImpl.class); + + private final RoutingIntentsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RoutingIntentsImpl(RoutingIntentsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String virtualHubName, + String routingIntentName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, virtualHubName, routingIntentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RoutingIntentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoutingIntent get(String resourceGroupName, String virtualHubName, String routingIntentName) { + RoutingIntentInner inner = this.serviceClient().get(resourceGroupName, virtualHubName, routingIntentName); + if (inner != null) { + return new RoutingIntentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String virtualHubName, String routingIntentName) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routingIntentName); + } + + public void delete(String resourceGroupName, String virtualHubName, String routingIntentName, Context context) { + this.serviceClient().delete(resourceGroupName, virtualHubName, routingIntentName, context); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoutingIntentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String virtualHubName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, virtualHubName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoutingIntentImpl(inner1, this.manager())); + } + + public RoutingIntent getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routingIntentName = ResourceManagerUtils.getValueFromIdByName(id, "routingIntent"); + if (routingIntentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingIntent'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routingIntentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routingIntentName = ResourceManagerUtils.getValueFromIdByName(id, "routingIntent"); + if (routingIntentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingIntent'.", id))); + } + return this.getWithResponse(resourceGroupName, virtualHubName, routingIntentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routingIntentName = ResourceManagerUtils.getValueFromIdByName(id, "routingIntent"); + if (routingIntentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingIntent'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routingIntentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 routingIntentName = ResourceManagerUtils.getValueFromIdByName(id, "routingIntent"); + if (routingIntentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingIntent'.", id))); + } + this.delete(resourceGroupName, virtualHubName, routingIntentName, context); + } + + private RoutingIntentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RoutingIntentImpl define(String name) { + return new RoutingIntentImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionImpl.java new file mode 100644 index 0000000000000..381e35506631e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.DisableBgpRoutePropagation; +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingGroupItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingRuleCollection; +import java.util.Collections; +import java.util.List; + +public final class RoutingRuleCollectionImpl + implements RoutingRuleCollection, RoutingRuleCollection.Definition, RoutingRuleCollection.Update { + private RoutingRuleCollectionInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public List appliesTo() { + List inner = this.innerModel().appliesTo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DisableBgpRoutePropagation disableBgpRoutePropagation() { + return this.innerModel().disableBgpRoutePropagation(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RoutingRuleCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + private String ruleCollectionName; + + public RoutingRuleCollectionImpl withExistingRoutingConfiguration(String resourceGroupName, + String networkManagerName, String configurationName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + this.configurationName = configurationName; + return this; + } + + public RoutingRuleCollection create() { + this.innerObject = serviceManager.serviceClient() + .getRoutingRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoutingRuleCollection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + RoutingRuleCollectionImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RoutingRuleCollectionInner(); + this.serviceManager = serviceManager; + this.ruleCollectionName = name; + } + + public RoutingRuleCollectionImpl update() { + return this; + } + + public RoutingRuleCollection apply() { + this.innerObject = serviceManager.serviceClient() + .getRoutingRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoutingRuleCollection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + RoutingRuleCollectionImpl(RoutingRuleCollectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "routingConfigurations"); + this.ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ruleCollections"); + } + + public RoutingRuleCollection refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoutingRuleCollections() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, Context.NONE) + .getValue(); + return this; + } + + public RoutingRuleCollection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingRuleCollections() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, context) + .getValue(); + return this; + } + + public RoutingRuleCollectionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public RoutingRuleCollectionImpl withAppliesTo(List appliesTo) { + this.innerModel().withAppliesTo(appliesTo); + return this; + } + + public RoutingRuleCollectionImpl + withDisableBgpRoutePropagation(DisableBgpRoutePropagation disableBgpRoutePropagation) { + this.innerModel().withDisableBgpRoutePropagation(disableBgpRoutePropagation); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsClientImpl.java new file mode 100644 index 0000000000000..e446dd1af6ad3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsClientImpl.java @@ -0,0 +1,1040 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RoutingRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.RoutingRuleCollectionListResult; +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 RoutingRuleCollectionsClient. + */ +public final class RoutingRuleCollectionsClientImpl implements RoutingRuleCollectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RoutingRuleCollectionsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutingRuleCollectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutingRuleCollectionsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(RoutingRuleCollectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRoutingRuleCollections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface RoutingRuleCollectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, + @BodyParam("application/json") RoutingRuleCollectionInner ruleCollection, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, top, skipToken, accept, context)) + .>map(res -> new 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 rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 routing configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, + skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 routing configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken)); + } + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken, context)); + } + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager routing configuration rule collection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager routing configuration rule collection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, accept, context); + } + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager routing configuration rule collection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager routing configuration rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + context).block(); + } + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager routing configuration rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutingRuleCollectionInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + Context.NONE).getValue(); + } + + /** + * Creates or updates a routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing rule collection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + RoutingRuleCollectionInner ruleCollection) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleCollection == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleCollection is required and cannot be null.")); + } else { + ruleCollection.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleCollection, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing rule collection along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + RoutingRuleCollectionInner ruleCollection, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleCollection == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleCollection is required and cannot be null.")); + } else { + ruleCollection.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleCollection, accept, + context); + } + + /** + * Creates or updates a routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing rule collection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, RoutingRuleCollectionInner ruleCollection) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleCollection).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + RoutingRuleCollectionInner ruleCollection, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleCollection, context).block(); + } + + /** + * Creates or updates a routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleCollection The Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the routing rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutingRuleCollectionInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, RoutingRuleCollectionInner ruleCollection) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleCollection, Context.NONE).getValue(); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Boolean force, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, force, accept, context); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Boolean force = null; + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .getSyncPoller(); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, + context) + .getSyncPoller(); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).block(); + } + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsImpl.java new file mode 100644 index 0000000000000..9277d0c0fc62a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleCollectionsImpl.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.RoutingRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.RoutingRuleCollection; +import com.azure.resourcemanager.network.generated.models.RoutingRuleCollections; + +public final class RoutingRuleCollectionsImpl implements RoutingRuleCollections { + private static final ClientLogger LOGGER = new ClientLogger(RoutingRuleCollectionsImpl.class); + + private final RoutingRuleCollectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RoutingRuleCollectionsImpl(RoutingRuleCollectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, configurationName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoutingRuleCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, networkManagerName, configurationName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoutingRuleCollectionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RoutingRuleCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoutingRuleCollection get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + RoutingRuleCollectionInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + if (inner != null) { + return new RoutingRuleCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context); + } + + public RoutingRuleCollection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, localForce, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context); + } + + private RoutingRuleCollectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RoutingRuleCollectionImpl define(String name) { + return new RoutingRuleCollectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleImpl.java new file mode 100644 index 0000000000000..7a104181f9454 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRuleImpl.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.RoutingRule; +import com.azure.resourcemanager.network.generated.models.RoutingRuleNextHop; +import com.azure.resourcemanager.network.generated.models.RoutingRuleRouteDestination; + +public final class RoutingRuleImpl implements RoutingRule, RoutingRule.Definition, RoutingRule.Update { + private RoutingRuleInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public RoutingRuleRouteDestination destination() { + return this.innerModel().destination(); + } + + public RoutingRuleNextHop nextHop() { + return this.innerModel().nextHop(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RoutingRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + private String ruleCollectionName; + + private String ruleName; + + public RoutingRuleImpl withExistingRuleCollection(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + this.configurationName = configurationName; + this.ruleCollectionName = ruleCollectionName; + return this; + } + + public RoutingRule create() { + this.innerObject = serviceManager.serviceClient() + .getRoutingRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoutingRule create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + RoutingRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new RoutingRuleInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public RoutingRuleImpl update() { + return this; + } + + public RoutingRule apply() { + this.innerObject = serviceManager.serviceClient() + .getRoutingRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public RoutingRule apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + RoutingRuleImpl(RoutingRuleInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "routingConfigurations"); + this.ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ruleCollections"); + this.ruleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rules"); + } + + public RoutingRule refresh() { + this.innerObject = serviceManager.serviceClient() + .getRoutingRules() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + Context.NONE) + .getValue(); + return this; + } + + public RoutingRule refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRoutingRules() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + context) + .getValue(); + return this; + } + + public RoutingRuleImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public RoutingRuleImpl withDestination(RoutingRuleRouteDestination destination) { + this.innerModel().withDestination(destination); + return this; + } + + public RoutingRuleImpl withNextHop(RoutingRuleNextHop nextHop) { + this.innerModel().withNextHop(nextHop); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesClientImpl.java new file mode 100644 index 0000000000000..8b3790f9089aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesClientImpl.java @@ -0,0 +1,1098 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.RoutingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleInner; +import com.azure.resourcemanager.network.generated.models.RoutingRuleListResult; +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 RoutingRulesClient. + */ +public final class RoutingRulesClientImpl implements RoutingRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final RoutingRulesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of RoutingRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutingRulesClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(RoutingRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientRoutingRules to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface RoutingRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @BodyParam("application/json") RoutingRuleInner routingRule, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/routingConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @QueryParam("force") Boolean force, @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 network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, accept, + context)) + .>map(res -> new 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 network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Integer top, String skipToken, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken)); + } + + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken, context)); + } + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, ruleName, accept, context); + } + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, context).block(); + } + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutingRuleInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + Context.NONE).getValue(); + } + + /** + * Creates or updates an routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param routingRule The routing rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 routing rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + RoutingRuleInner routingRule) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (routingRule == null) { + return Mono.error(new IllegalArgumentException("Parameter routingRule is required and cannot be null.")); + } else { + routingRule.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, routingRule, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param routingRule The routing rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 routing rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + RoutingRuleInner routingRule, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (routingRule == null) { + return Mono.error(new IllegalArgumentException("Parameter routingRule is required and cannot be null.")); + } else { + routingRule.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, routingRule, accept, + context); + } + + /** + * Creates or updates an routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param routingRule The routing rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 routing rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, RoutingRuleInner routingRule) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, routingRule).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param routingRule The routing rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 routing rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, RoutingRuleInner routingRule, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, routingRule, context).block(); + } + + /** + * Creates or updates an routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param routingRule The routing rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 routing rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RoutingRuleInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, RoutingRuleInner routingRule) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, routingRule, Context.NONE).getValue(); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, Boolean force, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, ruleName, force, accept, context); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + final Boolean force = null; + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force) + .getSyncPoller(); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force, context) + .getSyncPoller(); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force) + .block(); + } + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesImpl.java new file mode 100644 index 0000000000000..79fe7a848b7c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/RoutingRulesImpl.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.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.RoutingRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleInner; +import com.azure.resourcemanager.network.generated.models.RoutingRule; +import com.azure.resourcemanager.network.generated.models.RoutingRules; + +public final class RoutingRulesImpl implements RoutingRules { + private static final ClientLogger LOGGER = new ClientLogger(RoutingRulesImpl.class); + + private final RoutingRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public RoutingRulesImpl(RoutingRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoutingRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RoutingRuleImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RoutingRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RoutingRule get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + RoutingRuleInner inner = this.serviceClient() + .get(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName); + if (inner != null) { + return new RoutingRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context); + } + + public RoutingRule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, localForce, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "routingConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routingConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context); + } + + private RoutingRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public RoutingRuleImpl define(String name) { + return new RoutingRuleImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionImpl.java new file mode 100644 index 0000000000000..d6b02864367a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionImpl.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ScopeConnectionInner; +import com.azure.resourcemanager.network.generated.models.ScopeConnection; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionState; + +public final class ScopeConnectionImpl implements ScopeConnection, ScopeConnection.Definition, ScopeConnection.Update { + private ScopeConnectionInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public ScopeConnectionState connectionState() { + return this.innerModel().connectionState(); + } + + public String description() { + return this.innerModel().description(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ScopeConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String scopeConnectionName; + + public ScopeConnectionImpl withExistingNetworkManager(String resourceGroupName, String networkManagerName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + return this; + } + + public ScopeConnection create() { + this.innerObject = serviceManager.serviceClient() + .getScopeConnections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ScopeConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getScopeConnections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, this.innerModel(), + context) + .getValue(); + return this; + } + + ScopeConnectionImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ScopeConnectionInner(); + this.serviceManager = serviceManager; + this.scopeConnectionName = name; + } + + public ScopeConnectionImpl update() { + return this; + } + + public ScopeConnection apply() { + this.innerObject = serviceManager.serviceClient() + .getScopeConnections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public ScopeConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getScopeConnections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, this.innerModel(), + context) + .getValue(); + return this; + } + + ScopeConnectionImpl(ScopeConnectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.scopeConnectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "scopeConnections"); + } + + public ScopeConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getScopeConnections() + .getWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, Context.NONE) + .getValue(); + return this; + } + + public ScopeConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getScopeConnections() + .getWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, context) + .getValue(); + return this; + } + + public ScopeConnectionImpl withTenantId(String tenantId) { + this.innerModel().withTenantId(tenantId); + return this; + } + + public ScopeConnectionImpl withResourceId(String resourceId) { + this.innerModel().withResourceId(resourceId); + return this; + } + + public ScopeConnectionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsClientImpl.java new file mode 100644 index 0000000000000..6488191422a10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsClientImpl.java @@ -0,0 +1,790 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.ScopeConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ScopeConnectionInner; +import com.azure.resourcemanager.network.generated.models.ScopeConnectionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ScopeConnectionsClient. + */ +public final class ScopeConnectionsClientImpl implements ScopeConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ScopeConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ScopeConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(ScopeConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientScopeConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ScopeConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("scopeConnectionName") String scopeConnectionName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScopeConnectionInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("scopeConnectionName") String scopeConnectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("scopeConnectionName") String scopeConnectionName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @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 scope connection from Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant connection. + * @param parameters Scope connection to be created/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 the Scope Connections resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String scopeConnectionName, ScopeConnectionInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (scopeConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scopeConnectionName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, scopeConnectionName, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates scope connection from Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant connection. + * @param parameters Scope connection to be created/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 the Scope Connections resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String scopeConnectionName, ScopeConnectionInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (scopeConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scopeConnectionName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, scopeConnectionName, apiVersion, parameters, accept, context); + } + + /** + * Creates or updates scope connection from Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant connection. + * @param parameters Scope connection to be created/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 the Scope Connections resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String scopeConnectionName, ScopeConnectionInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, scopeConnectionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates scope connection from Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant connection. + * @param parameters Scope connection to be created/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 the Scope Connections resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String scopeConnectionName, ScopeConnectionInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, scopeConnectionName, parameters, + context).block(); + } + + /** + * Creates or updates scope connection from Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant connection. + * @param parameters Scope connection to be created/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 the Scope Connections resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeConnectionInner createOrUpdate(String resourceGroupName, String networkManagerName, + String scopeConnectionName, ScopeConnectionInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, parameters, + Context.NONE).getValue(); + } + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String scopeConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (scopeConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scopeConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, scopeConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String scopeConnectionName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (scopeConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scopeConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, scopeConnectionName, apiVersion, accept, context); + } + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String scopeConnectionName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, scopeConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String scopeConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, scopeConnectionName, context).block(); + } + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeConnectionInner get(String resourceGroupName, String networkManagerName, String scopeConnectionName) { + return getWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, Context.NONE).getValue(); + } + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String networkManagerName, + String scopeConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (scopeConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scopeConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, scopeConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String networkManagerName, + String scopeConnectionName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (scopeConnectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter scopeConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, scopeConnectionName, apiVersion, accept, context); + } + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String scopeConnectionName) { + return deleteWithResponseAsync(resourceGroupName, networkManagerName, scopeConnectionName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String networkManagerName, + String scopeConnectionName, Context context) { + return deleteWithResponseAsync(resourceGroupName, networkManagerName, scopeConnectionName, context).block(); + } + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 networkManagerName, String scopeConnectionName) { + deleteWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, Context.NONE); + } + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, apiVersion, top, skipToken, accept, context)) + .>map(res -> new 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 scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, networkManagerName, + apiVersion, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, Integer top, + String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken)); + } + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of scope connections along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 scope connections along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsImpl.java new file mode 100644 index 0000000000000..187f1435db4ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ScopeConnectionsImpl.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.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.ScopeConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ScopeConnectionInner; +import com.azure.resourcemanager.network.generated.models.ScopeConnection; +import com.azure.resourcemanager.network.generated.models.ScopeConnections; + +public final class ScopeConnectionsImpl implements ScopeConnections { + private static final ClientLogger LOGGER = new ClientLogger(ScopeConnectionsImpl.class); + + private final ScopeConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ScopeConnectionsImpl(ScopeConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String scopeConnectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ScopeConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ScopeConnection get(String resourceGroupName, String networkManagerName, String scopeConnectionName) { + ScopeConnectionInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, scopeConnectionName); + if (inner != null) { + return new ScopeConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String networkManagerName, + String scopeConnectionName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, context); + } + + public void delete(String resourceGroupName, String networkManagerName, String scopeConnectionName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, scopeConnectionName); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkManagerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScopeConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ScopeConnectionImpl(inner1, this.manager())); + } + + public ScopeConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String scopeConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "scopeConnections"); + if (scopeConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String scopeConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "scopeConnections"); + if (scopeConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeConnections'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String scopeConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "scopeConnections"); + if (scopeConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeConnections'.", id))); + } + this.deleteWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String scopeConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "scopeConnections"); + if (scopeConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeConnections'.", id))); + } + return this.deleteWithResponse(resourceGroupName, networkManagerName, scopeConnectionName, context); + } + + private ScopeConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ScopeConnectionImpl define(String name) { + return new ScopeConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationImpl.java new file mode 100644 index 0000000000000..8d1f3b359986d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityAdminConfigurationInner; +import com.azure.resourcemanager.network.generated.models.NetworkIntentPolicyBasedService; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityAdminConfiguration; +import java.util.Collections; +import java.util.List; + +public final class SecurityAdminConfigurationImpl + implements SecurityAdminConfiguration, SecurityAdminConfiguration.Definition, SecurityAdminConfiguration.Update { + private SecurityAdminConfigurationInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public List applyOnNetworkIntentPolicyBasedServices() { + List inner = this.innerModel().applyOnNetworkIntentPolicyBasedServices(); + 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 resourceGroupName() { + return resourceGroupName; + } + + public SecurityAdminConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + public SecurityAdminConfigurationImpl withExistingNetworkManager(String resourceGroupName, + String networkManagerName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + return this; + } + + public SecurityAdminConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getSecurityAdminConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SecurityAdminConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityAdminConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + SecurityAdminConfigurationImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SecurityAdminConfigurationInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public SecurityAdminConfigurationImpl update() { + return this; + } + + public SecurityAdminConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getSecurityAdminConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SecurityAdminConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityAdminConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + SecurityAdminConfigurationImpl(SecurityAdminConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityAdminConfigurations"); + } + + public SecurityAdminConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecurityAdminConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public SecurityAdminConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityAdminConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, context) + .getValue(); + return this; + } + + public SecurityAdminConfigurationImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SecurityAdminConfigurationImpl withApplyOnNetworkIntentPolicyBasedServices( + List applyOnNetworkIntentPolicyBasedServices) { + this.innerModel().withApplyOnNetworkIntentPolicyBasedServices(applyOnNetworkIntentPolicyBasedServices); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsClientImpl.java new file mode 100644 index 0000000000000..54f340c63dba3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsClientImpl.java @@ -0,0 +1,964 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.SecurityAdminConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityAdminConfigurationInner; +import com.azure.resourcemanager.network.generated.models.SecurityAdminConfigurationListResult; +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 SecurityAdminConfigurationsClient. + */ +public final class SecurityAdminConfigurationsClientImpl implements SecurityAdminConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecurityAdminConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityAdminConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityAdminConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(SecurityAdminConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityAdminConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface SecurityAdminConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") SecurityAdminConfigurationInner securityAdminConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, top, skipToken, accept, context)) + .>map(res -> new 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 network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken)); + } + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken, context)); + } + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, accept, context); + } + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, context).block(); + } + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityAdminConfigurationInner get(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + /** + * Creates or updates a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityAdminConfiguration The security admin configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security admin configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, + SecurityAdminConfigurationInner securityAdminConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (securityAdminConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter securityAdminConfiguration is required and cannot be null.")); + } else { + securityAdminConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + securityAdminConfiguration, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityAdminConfiguration The security admin configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security admin configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, SecurityAdminConfigurationInner securityAdminConfiguration, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (securityAdminConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter securityAdminConfiguration is required and cannot be null.")); + } else { + securityAdminConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, securityAdminConfiguration, accept, context); + } + + /** + * Creates or updates a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityAdminConfiguration The security admin configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security admin configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String networkManagerName, String configurationName, + SecurityAdminConfigurationInner securityAdminConfiguration) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + securityAdminConfiguration).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityAdminConfiguration The security admin configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security admin configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, SecurityAdminConfigurationInner securityAdminConfiguration, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + securityAdminConfiguration, context).block(); + } + + /** + * Creates or updates a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityAdminConfiguration The security admin configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security admin configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityAdminConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, SecurityAdminConfigurationInner securityAdminConfiguration) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, + securityAdminConfiguration, Context.NONE).getValue(); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, force, accept, context); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).getSyncPoller(); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context) + .getSyncPoller(); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 networkManagerName, String configurationName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, force).block(); + } + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network manager security admin configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security admin configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsImpl.java new file mode 100644 index 0000000000000..4d959382c698b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityAdminConfigurationsImpl.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.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.SecurityAdminConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityAdminConfigurationInner; +import com.azure.resourcemanager.network.generated.models.SecurityAdminConfiguration; +import com.azure.resourcemanager.network.generated.models.SecurityAdminConfigurations; + +public final class SecurityAdminConfigurationsImpl implements SecurityAdminConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(SecurityAdminConfigurationsImpl.class); + + private final SecurityAdminConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityAdminConfigurationsImpl(SecurityAdminConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityAdminConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityAdminConfigurationImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityAdminConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecurityAdminConfiguration get(String resourceGroupName, String networkManagerName, + String configurationName) { + SecurityAdminConfigurationInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, configurationName); + if (inner != null) { + return new SecurityAdminConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + public SecurityAdminConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityAdminConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityAdminConfigurations'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + private SecurityAdminConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityAdminConfigurationImpl define(String name) { + return new SecurityAdminConfigurationImpl(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..374e03a27ae0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityGroupViewResultImpl.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.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..b783d3202bba8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProviderImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.securityPartnerProviderName + = ResourceManagerUtils.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..6e049b902f5aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersClientImpl.java @@ -0,0 +1,1217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String securityPartnerProviderName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String securityPartnerProviderName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String securityPartnerProviderName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, securityPartnerProviderName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String securityPartnerProviderName, Context context) { + return getByResourceGroupWithResponseAsync(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) + public SecurityPartnerProviderInner getByResourceGroup(String resourceGroupName, + String securityPartnerProviderName) { + return getByResourceGroupWithResponse(resourceGroupName, securityPartnerProviderName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters) { + return this.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 the {@link SyncPoller} for polling of security Partner Provider resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityPartnerProviderInner> beginCreateOrUpdate( + String resourceGroupName, String securityPartnerProviderName, SecurityPartnerProviderInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, + String securityPartnerProviderName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, securityPartnerProviderName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String securityPartnerProviderName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public SecurityPartnerProviderInner updateTags(String resourceGroupName, String securityPartnerProviderName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, securityPartnerProviderName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityPartnerProviders API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..fa15e243fbdb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityPartnerProvidersImpl.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.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; + +public final class SecurityPartnerProvidersImpl implements SecurityPartnerProviders { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityPartnerProviderImpl(inner1, this.manager())); + } + + public SecurityPartnerProvider getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String securityPartnerProviderName = ResourceManagerUtils.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..650da74601945 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRuleImpl.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.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 int priority() { + return this.innerModel().priority(); + } + + public SecurityRuleDirection direction() { + return this.innerModel().direction(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkSecurityGroupName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkSecurityGroups"); + this.securityRuleName = ResourceManagerUtils.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(int 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..1860a616cc8c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesClientImpl.java @@ -0,0 +1,957 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName, + String securityRuleName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkSecurityGroupName, + String securityRuleName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkSecurityGroupName, + String securityRuleName) { + return getWithResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkSecurityGroupName, + String securityRuleName, Context context) { + return getWithResponseAsync(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) + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithResponse(resourceGroupName, networkSecurityGroupName, securityRuleName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of network security rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of network security rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of network security rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityRuleInner> beginCreateOrUpdate(String resourceGroupName, + String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return this + .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 the {@link SyncPoller} for polling of network security rule. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SecurityRuleInner> beginCreateOrUpdate(String resourceGroupName, + String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSecurityRule API service call along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..6428e4ac476bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityRulesImpl.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.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; + +public final class SecurityRulesImpl implements SecurityRules { + private static 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 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 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 PagedIterable list(String resourceGroupName, String networkSecurityGroupName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, networkSecurityGroupName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityRuleImpl(inner1, this.manager())); + } + + public SecurityRule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkSecurityGroupName = ResourceManagerUtils.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 = ResourceManagerUtils.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/SecurityUserConfigurationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationImpl.java new file mode 100644 index 0000000000000..a332f614511a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserConfigurationInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityUserConfiguration; + +public final class SecurityUserConfigurationImpl + implements SecurityUserConfiguration, SecurityUserConfiguration.Definition, SecurityUserConfiguration.Update { + private SecurityUserConfigurationInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SecurityUserConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + public SecurityUserConfigurationImpl withExistingNetworkManager(String resourceGroupName, + String networkManagerName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + return this; + } + + public SecurityUserConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SecurityUserConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + SecurityUserConfigurationImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SecurityUserConfigurationInner(); + this.serviceManager = serviceManager; + this.configurationName = name; + } + + public SecurityUserConfigurationImpl update() { + return this; + } + + public SecurityUserConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SecurityUserConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserConfigurations() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, this.innerModel(), + context) + .getValue(); + return this; + } + + SecurityUserConfigurationImpl(SecurityUserConfigurationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityUserConfigurations"); + } + + public SecurityUserConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE) + .getValue(); + return this; + } + + public SecurityUserConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserConfigurations() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, context) + .getValue(); + return this; + } + + public SecurityUserConfigurationImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsClientImpl.java new file mode 100644 index 0000000000000..663851dc55dfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsClientImpl.java @@ -0,0 +1,962 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.SecurityUserConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserConfigurationInner; +import com.azure.resourcemanager.network.generated.models.SecurityUserConfigurationListResult; +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 SecurityUserConfigurationsClient. + */ +public final class SecurityUserConfigurationsClientImpl implements SecurityUserConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecurityUserConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityUserConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityUserConfigurationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(SecurityUserConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityUserConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface SecurityUserConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @BodyParam("application/json") SecurityUserConfigurationInner securityUserConfiguration, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, top, skipToken, accept, context)) + .>map(res -> new 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 network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken)); + } + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, top, skipToken, context)); + } + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, accept, context); + } + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, context).block(); + } + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityUserConfigurationInner get(String resourceGroupName, String networkManagerName, + String configurationName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + /** + * Creates or updates a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityUserConfiguration The security user configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, SecurityUserConfigurationInner securityUserConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (securityUserConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter securityUserConfiguration is required and cannot be null.")); + } else { + securityUserConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + securityUserConfiguration, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityUserConfiguration The security user configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, SecurityUserConfigurationInner securityUserConfiguration, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (securityUserConfiguration == null) { + return Mono.error( + new IllegalArgumentException("Parameter securityUserConfiguration is required and cannot be null.")); + } else { + securityUserConfiguration.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, securityUserConfiguration, accept, context); + } + + /** + * Creates or updates a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityUserConfiguration The security user configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String networkManagerName, String configurationName, SecurityUserConfigurationInner securityUserConfiguration) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + securityUserConfiguration).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityUserConfiguration The security user configuration to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, SecurityUserConfigurationInner securityUserConfiguration, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + securityUserConfiguration, context).block(); + } + + /** + * Creates or updates a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param securityUserConfiguration The security user configuration to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityUserConfigurationInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, SecurityUserConfigurationInner securityUserConfiguration) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, + securityUserConfiguration, Context.NONE).getValue(); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, Boolean force, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, force, accept, context); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, networkManagerName, configurationName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName) { + final Boolean force = null; + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).getSyncPoller(); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, Boolean force, Context context) { + return this.beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context) + .getSyncPoller(); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 networkManagerName, String configurationName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, force).block(); + } + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, Boolean force, + Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, force, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of network manager security user configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 network manager security user configurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsImpl.java new file mode 100644 index 0000000000000..01de3b2363bee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserConfigurationsImpl.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.SecurityUserConfigurationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserConfigurationInner; +import com.azure.resourcemanager.network.generated.models.SecurityUserConfiguration; +import com.azure.resourcemanager.network.generated.models.SecurityUserConfigurations; + +public final class SecurityUserConfigurationsImpl implements SecurityUserConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(SecurityUserConfigurationsImpl.class); + + private final SecurityUserConfigurationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityUserConfigurationsImpl(SecurityUserConfigurationsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityUserConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityUserConfigurationImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityUserConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecurityUserConfiguration get(String resourceGroupName, String networkManagerName, + String configurationName) { + SecurityUserConfigurationInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, configurationName); + if (inner != null) { + return new SecurityUserConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, Boolean force, + Context context) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + public SecurityUserConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, localForce, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, force, context); + } + + private SecurityUserConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityUserConfigurationImpl define(String name) { + return new SecurityUserConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionImpl.java new file mode 100644 index 0000000000000..3a99330f2f7f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionImpl.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityUserGroupItem; +import com.azure.resourcemanager.network.generated.models.SecurityUserRuleCollection; +import java.util.Collections; +import java.util.List; + +public final class SecurityUserRuleCollectionImpl + implements SecurityUserRuleCollection, SecurityUserRuleCollection.Definition, SecurityUserRuleCollection.Update { + private SecurityUserRuleCollectionInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public List appliesToGroups() { + List inner = this.innerModel().appliesToGroups(); + 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 resourceGroupName() { + return resourceGroupName; + } + + public SecurityUserRuleCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + private String ruleCollectionName; + + public SecurityUserRuleCollectionImpl withExistingSecurityUserConfiguration(String resourceGroupName, + String networkManagerName, String configurationName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + this.configurationName = configurationName; + return this; + } + + public SecurityUserRuleCollection create() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecurityUserRuleCollection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + SecurityUserRuleCollectionImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SecurityUserRuleCollectionInner(); + this.serviceManager = serviceManager; + this.ruleCollectionName = name; + } + + public SecurityUserRuleCollectionImpl update() { + return this; + } + + public SecurityUserRuleCollection apply() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecurityUserRuleCollection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRuleCollections() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + this.innerModel(), context) + .getValue(); + return this; + } + + SecurityUserRuleCollectionImpl(SecurityUserRuleCollectionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityUserConfigurations"); + this.ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ruleCollections"); + } + + public SecurityUserRuleCollection refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRuleCollections() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, Context.NONE) + .getValue(); + return this; + } + + public SecurityUserRuleCollection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRuleCollections() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, context) + .getValue(); + return this; + } + + public SecurityUserRuleCollectionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SecurityUserRuleCollectionImpl withAppliesToGroups(List appliesToGroups) { + this.innerModel().withAppliesToGroups(appliesToGroups); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsClientImpl.java new file mode 100644 index 0000000000000..6701d58ac6d13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsClientImpl.java @@ -0,0 +1,1047 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.SecurityUserRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.SecurityUserRuleCollectionListResult; +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 SecurityUserRuleCollectionsClient. + */ +public final class SecurityUserRuleCollectionsClientImpl implements SecurityUserRuleCollectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecurityUserRuleCollectionsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityUserRuleCollectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityUserRuleCollectionsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(SecurityUserRuleCollectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityUserRuleCollections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface SecurityUserRuleCollectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, + @BodyParam("application/json") SecurityUserRuleCollectionInner securityUserRuleCollection, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @QueryParam("force") Boolean force, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, top, skipToken, accept, context)) + .>map(res -> new 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 security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security user configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user configuration rule collection list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, top, + skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security user configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken)); + } + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, networkManagerName, configurationName, top, skipToken, context)); + } + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security user configuration rule collection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security user configuration rule collection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, accept, context); + } + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security user configuration rule collection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security user configuration rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + context).block(); + } + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 manager security user configuration rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityUserRuleCollectionInner get(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + Context.NONE).getValue(); + } + + /** + * Creates or updates a security user rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param securityUserRuleCollection The Security User Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user rule collection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + SecurityUserRuleCollectionInner securityUserRuleCollection) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (securityUserRuleCollection == null) { + return Mono.error( + new IllegalArgumentException("Parameter securityUserRuleCollection is required and cannot be null.")); + } else { + securityUserRuleCollection.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, securityUserRuleCollection, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a security user rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param securityUserRuleCollection The Security User Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user rule collection along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + SecurityUserRuleCollectionInner securityUserRuleCollection, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (securityUserRuleCollection == null) { + return Mono.error( + new IllegalArgumentException("Parameter securityUserRuleCollection is required and cannot be null.")); + } else { + securityUserRuleCollection.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, securityUserRuleCollection, + accept, context); + } + + /** + * Creates or updates a security user rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param securityUserRuleCollection The Security User Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user rule collection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + SecurityUserRuleCollectionInner securityUserRuleCollection) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, securityUserRuleCollection).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a security user rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param securityUserRuleCollection The Security User Rule Collection to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user rule collection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, + SecurityUserRuleCollectionInner securityUserRuleCollection, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, securityUserRuleCollection, context).block(); + } + + /** + * Creates or updates a security user rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param securityUserRuleCollection The Security User Rule Collection to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the security user rule collection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityUserRuleCollectionInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, + SecurityUserRuleCollectionInner securityUserRuleCollection) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + securityUserRuleCollection, Context.NONE).getValue(); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Boolean force, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, force, accept, context); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Boolean force = null; + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .getSyncPoller(); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Boolean force, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, + context) + .getSyncPoller(); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force).block(); + } + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security user configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user configuration rule collection list result along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsImpl.java new file mode 100644 index 0000000000000..e350bb84a2cbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleCollectionsImpl.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.SecurityUserRuleCollectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleCollectionInner; +import com.azure.resourcemanager.network.generated.models.SecurityUserRuleCollection; +import com.azure.resourcemanager.network.generated.models.SecurityUserRuleCollections; + +public final class SecurityUserRuleCollectionsImpl implements SecurityUserRuleCollections { + private static final ClientLogger LOGGER = new ClientLogger(SecurityUserRuleCollectionsImpl.class); + + private final SecurityUserRuleCollectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityUserRuleCollectionsImpl(SecurityUserRuleCollectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, configurationName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityUserRuleCollectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, networkManagerName, configurationName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new SecurityUserRuleCollectionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityUserRuleCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecurityUserRuleCollection get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + SecurityUserRuleCollectionInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + if (inner != null) { + return new SecurityUserRuleCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context); + } + + public SecurityUserRuleCollection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, localForce, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force, context); + } + + private SecurityUserRuleCollectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityUserRuleCollectionImpl define(String name) { + return new SecurityUserRuleCollectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleImpl.java new file mode 100644 index 0000000000000..69c24104b1f17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRuleImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleInner; +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import com.azure.resourcemanager.network.generated.models.SecurityUserRule; +import java.util.Collections; +import java.util.List; + +public final class SecurityUserRuleImpl + implements SecurityUserRule, SecurityUserRule.Definition, SecurityUserRule.Update { + private SecurityUserRuleInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public SecurityConfigurationRuleProtocol protocol() { + return this.innerModel().protocol(); + } + + public List sources() { + List inner = this.innerModel().sources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinations() { + List inner = this.innerModel().destinations(); + 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 SecurityConfigurationRuleDirection direction() { + return this.innerModel().direction(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGuid() { + return this.innerModel().resourceGuid(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SecurityUserRuleInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String configurationName; + + private String ruleCollectionName; + + private String ruleName; + + public SecurityUserRuleImpl withExistingRuleCollection(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + this.configurationName = configurationName; + this.ruleCollectionName = ruleCollectionName; + return this; + } + + public SecurityUserRule create() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecurityUserRule create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + SecurityUserRuleImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new SecurityUserRuleInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public SecurityUserRuleImpl update() { + return this; + } + + public SecurityUserRule apply() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SecurityUserRule apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRules() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, this.innerModel(), context) + .getValue(); + return this; + } + + SecurityUserRuleImpl(SecurityUserRuleInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.configurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityUserConfigurations"); + this.ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "ruleCollections"); + this.ruleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "rules"); + } + + public SecurityUserRule refresh() { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRules() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + Context.NONE) + .getValue(); + return this; + } + + public SecurityUserRule refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSecurityUserRules() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + context) + .getValue(); + return this; + } + + public SecurityUserRuleImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SecurityUserRuleImpl withProtocol(SecurityConfigurationRuleProtocol protocol) { + this.innerModel().withProtocol(protocol); + return this; + } + + public SecurityUserRuleImpl withSources(List sources) { + this.innerModel().withSources(sources); + return this; + } + + public SecurityUserRuleImpl withDestinations(List destinations) { + this.innerModel().withDestinations(destinations); + return this; + } + + public SecurityUserRuleImpl withSourcePortRanges(List sourcePortRanges) { + this.innerModel().withSourcePortRanges(sourcePortRanges); + return this; + } + + public SecurityUserRuleImpl withDestinationPortRanges(List destinationPortRanges) { + this.innerModel().withDestinationPortRanges(destinationPortRanges); + return this; + } + + public SecurityUserRuleImpl withDirection(SecurityConfigurationRuleDirection 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/SecurityUserRulesClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRulesClientImpl.java new file mode 100644 index 0000000000000..ca8b9e55d0b0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRulesClientImpl.java @@ -0,0 +1,1096 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.SecurityUserRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityUserRuleListResult; +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 SecurityUserRulesClient. + */ +public final class SecurityUserRulesClientImpl implements SecurityUserRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecurityUserRulesService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SecurityUserRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecurityUserRulesClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(SecurityUserRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSecurityUserRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface SecurityUserRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @QueryParam("$top") Integer top, + @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @BodyParam("application/json") SecurityUserRuleInner securityUserRule, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("configurationName") String configurationName, + @PathParam("ruleCollectionName") String ruleCollectionName, @PathParam("ruleName") String ruleName, + @QueryParam("force") Boolean force, @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 Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, accept, + context)) + .>map(res -> new 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 User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, Integer top, String skipToken, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken)); + } + + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, top, skipToken, context)); + } + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, 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 (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, ruleName, accept, context); + } + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, context).block(); + } + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityUserRuleInner get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + return getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + Context.NONE).getValue(); + } + + /** + * Creates or updates a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param securityUserRule The security user rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + SecurityUserRuleInner securityUserRule) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (securityUserRule == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityUserRule is required and cannot be null.")); + } else { + securityUserRule.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, securityUserRule, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param securityUserRule The security user rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + SecurityUserRuleInner securityUserRule, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (securityUserRule == null) { + return Mono + .error(new IllegalArgumentException("Parameter securityUserRule is required and cannot be null.")); + } else { + securityUserRule.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, securityUserRule, + accept, context); + } + + /** + * Creates or updates a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param securityUserRule The security user rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, SecurityUserRuleInner securityUserRule) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, securityUserRule).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param securityUserRule The security user rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + SecurityUserRuleInner securityUserRule, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, securityUserRule, context).block(); + } + + /** + * Creates or updates a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param securityUserRule The security user rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecurityUserRuleInner createOrUpdate(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, SecurityUserRuleInner securityUserRule) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, securityUserRule, Context.NONE).getValue(); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, + Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), resourceGroupName, networkManagerName, configurationName, + ruleCollectionName, ruleName, force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String networkManagerName, String configurationName, String ruleCollectionName, String ruleName, Boolean force, + 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (ruleCollectionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter ruleCollectionName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, configurationName, ruleCollectionName, ruleName, force, accept, context); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + final Boolean force = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, networkManagerName, + configurationName, ruleCollectionName, ruleName, force, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName) { + final Boolean force = null; + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force) + .getSyncPoller(); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Boolean force, Context context) { + return this + .beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force, context) + .getSyncPoller(); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + final Boolean force = null; + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + return beginDeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + force, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + final Boolean force = null; + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force) + .block(); + } + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + deleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return security user rule list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 user rule list result along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRulesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRulesImpl.java new file mode 100644 index 0000000000000..3783f922c4ed2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SecurityUserRulesImpl.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.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.SecurityUserRulesClient; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleInner; +import com.azure.resourcemanager.network.generated.models.SecurityUserRule; +import com.azure.resourcemanager.network.generated.models.SecurityUserRules; + +public final class SecurityUserRulesImpl implements SecurityUserRules { + private static final ClientLogger LOGGER = new ClientLogger(SecurityUserRulesImpl.class); + + private final SecurityUserRulesClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SecurityUserRulesImpl(SecurityUserRulesClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, configurationName, ruleCollectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityUserRuleImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityUserRuleImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SecurityUserRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SecurityUserRule get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + SecurityUserRuleInner inner = this.serviceClient() + .get(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName); + if (inner != null) { + return new SecurityUserRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName); + } + + public void delete(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context) { + this.serviceClient() + .delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context); + } + + public SecurityUserRule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, + ruleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + Boolean localForce = null; + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, localForce, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean force, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String configurationName = ResourceManagerUtils.getValueFromIdByName(id, "securityUserConfigurations"); + if (configurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'securityUserConfigurations'.", id))); + } + String ruleCollectionName = ResourceManagerUtils.getValueFromIdByName(id, "ruleCollections"); + if (ruleCollectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'ruleCollections'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "rules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + this.delete(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force, + context); + } + + private SecurityUserRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public SecurityUserRuleImpl define(String name) { + return new SecurityUserRuleImpl(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..5da02a2875994 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksClientImpl.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.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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String virtualNetworkName, + String subnetName) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String virtualNetworkName, String subnetName, Context context) { + return listWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listWithResponse(resourceGroupName, virtualNetworkName, subnetName, Context.NONE).getValue(); + } +} 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..fdfe9d584f05d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksImpl.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.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; + +public final class ServiceAssociationLinksImpl implements ServiceAssociationLinks { + private static 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 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; + } + } + + 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; + } + } + + 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..0a3c005edaaf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceAssociationLinksListResultImpl.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.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..99aa1e3392c88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesClientImpl.java @@ -0,0 +1,1217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceEndpointPolicyName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceEndpointPolicyName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String serviceEndpointPolicyName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String serviceEndpointPolicyName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, serviceEndpointPolicyName, expand, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) { + return this.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 the {@link SyncPoller} for polling of service End point policy resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyInner> beginCreateOrUpdate( + String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String serviceEndpointPolicyName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String serviceEndpointPolicyName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public ServiceEndpointPolicyInner updateTags(String resourceGroupName, String serviceEndpointPolicyName, + TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, serviceEndpointPolicyName, parameters, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListServiceEndpointPolicies API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..cde77267ed6fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPoliciesImpl.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.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; + +public final class ServiceEndpointPoliciesImpl implements ServiceEndpointPolicies { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceEndpointPolicyImpl(inner1, this.manager())); + } + + public ServiceEndpointPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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..6561661019cfc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionImpl.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.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, + ServiceEndpointPolicyDefinition.Definition, ServiceEndpointPolicyDefinition.Update { + private ServiceEndpointPolicyDefinitionInner 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 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 String resourceGroupName() { + return resourceGroupName; + } + + public ServiceEndpointPolicyDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceEndpointPolicyName; + + private String serviceEndpointPolicyDefinitionName; + + public ServiceEndpointPolicyDefinitionImpl withExistingServiceEndpointPolicy(String resourceGroupName, + String serviceEndpointPolicyName) { + this.resourceGroupName = resourceGroupName; + this.serviceEndpointPolicyName = serviceEndpointPolicyName; + return this; + } + + public ServiceEndpointPolicyDefinition create() { + this.innerObject = serviceManager.serviceClient() + .getServiceEndpointPolicyDefinitions() + .createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + this.innerModel(), Context.NONE); + return this; + } + + public ServiceEndpointPolicyDefinition create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getServiceEndpointPolicyDefinitions() + .createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + this.innerModel(), context); + return this; + } + + ServiceEndpointPolicyDefinitionImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new ServiceEndpointPolicyDefinitionInner(); + this.serviceManager = serviceManager; + this.serviceEndpointPolicyDefinitionName = name; + } + + public ServiceEndpointPolicyDefinitionImpl update() { + return this; + } + + public ServiceEndpointPolicyDefinition apply() { + this.innerObject = serviceManager.serviceClient() + .getServiceEndpointPolicyDefinitions() + .createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + this.innerModel(), Context.NONE); + return this; + } + + public ServiceEndpointPolicyDefinition apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getServiceEndpointPolicyDefinitions() + .createOrUpdate(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + this.innerModel(), context); + return this; + } + + ServiceEndpointPolicyDefinitionImpl(ServiceEndpointPolicyDefinitionInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceEndpointPolicyName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "serviceEndpointPolicies"); + this.serviceEndpointPolicyDefinitionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "serviceEndpointPolicyDefinitions"); + } + + public ServiceEndpointPolicyDefinition refresh() { + this.innerObject = serviceManager.serviceClient() + .getServiceEndpointPolicyDefinitions() + .getWithResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + Context.NONE) + .getValue(); + return this; + } + + public ServiceEndpointPolicyDefinition refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getServiceEndpointPolicyDefinitions() + .getWithResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context) + .getValue(); + return this; + } + + public ServiceEndpointPolicyDefinitionImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public ServiceEndpointPolicyDefinitionImpl withType(String type) { + this.innerModel().withType(type); + return this; + } + + public ServiceEndpointPolicyDefinitionImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public ServiceEndpointPolicyDefinitionImpl withService(String service) { + this.innerModel().withService(service); + return this; + } + + public ServiceEndpointPolicyDefinitionImpl withServiceResources(List serviceResources) { + this.innerModel().withServiceResources(serviceResources); + return this; + } +} 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..bc1f89d9e90eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsClientImpl.java @@ -0,0 +1,1009 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, + String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { + return getWithResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, Context context) { + return getWithResponseAsync(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) + public ServiceEndpointPolicyDefinitionInner get(String resourceGroupName, String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName) { + return getWithResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions) { + return this + .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 the {@link SyncPoller} for polling of service Endpoint policy definitions. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceEndpointPolicyDefinitionInner> + beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, + String serviceEndpointPolicyDefinitionName, + ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListServiceEndpointPolicyDefinition API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..c4ec89a58a8e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyDefinitionsImpl.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.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; + +public final class ServiceEndpointPolicyDefinitionsImpl implements ServiceEndpointPolicyDefinitions { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName, + String serviceEndpointPolicyName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, serviceEndpointPolicyName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new ServiceEndpointPolicyDefinitionImpl(inner1, this.manager())); + } + + public ServiceEndpointPolicyDefinition getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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 serviceEndpointPolicyDefinitionName + = ResourceManagerUtils.getValueFromIdByName(id, "serviceEndpointPolicyDefinitions"); + if (serviceEndpointPolicyDefinitionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicyDefinitions'.", id))); + } + return this + .getWithResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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 serviceEndpointPolicyDefinitionName + = ResourceManagerUtils.getValueFromIdByName(id, "serviceEndpointPolicyDefinitions"); + if (serviceEndpointPolicyDefinitionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicyDefinitions'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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 serviceEndpointPolicyDefinitionName + = ResourceManagerUtils.getValueFromIdByName(id, "serviceEndpointPolicyDefinitions"); + if (serviceEndpointPolicyDefinitionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicyDefinitions'.", id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceEndpointPolicyName = ResourceManagerUtils.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 serviceEndpointPolicyDefinitionName + = ResourceManagerUtils.getValueFromIdByName(id, "serviceEndpointPolicyDefinitions"); + if (serviceEndpointPolicyDefinitionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'serviceEndpointPolicyDefinitions'.", id))); + } + this.delete(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, context); + } + + private ServiceEndpointPolicyDefinitionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public ServiceEndpointPolicyDefinitionImpl define(String name) { + return new ServiceEndpointPolicyDefinitionImpl(name, this.manager()); + } +} 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..6cdbe522da4d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceEndpointPolicyImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 serviceAlias() { + return this.innerModel().serviceAlias(); + } + + public List contextualServiceEndpointPolicies() { + List inner = this.innerModel().contextualServiceEndpointPolicies(); + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceEndpointPolicyName + = ResourceManagerUtils.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; + } + + public ServiceEndpointPolicyImpl withServiceAlias(String serviceAlias) { + this.innerModel().withServiceAlias(serviceAlias); + return this; + } + + public ServiceEndpointPolicyImpl + withContextualServiceEndpointPolicies(List contextualServiceEndpointPolicies) { + this.innerModel().withContextualServiceEndpointPolicies(contextualServiceEndpointPolicies); + 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/ServiceTagInformationImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationImpl.java new file mode 100644 index 0000000000000..91221e5c7b36f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationImpl.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.ServiceTagInformationInner; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformation; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformationPropertiesFormat; + +public final class ServiceTagInformationImpl implements ServiceTagInformation { + private ServiceTagInformationInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + ServiceTagInformationImpl(ServiceTagInformationInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ServiceTagInformationPropertiesFormat properties() { + return this.innerModel().properties(); + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String serviceTagChangeNumber() { + return this.innerModel().serviceTagChangeNumber(); + } + + public ServiceTagInformationInner 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/ServiceTagInformationsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsClientImpl.java new file mode 100644 index 0000000000000..2fecbb95e9e93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsClientImpl.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.resourcemanager.network.generated.fluent.ServiceTagInformationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagInformationInner; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ServiceTagInformationsClient. + */ +public final class ServiceTagInformationsClientImpl implements ServiceTagInformationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ServiceTagInformationsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of ServiceTagInformationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceTagInformationsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(ServiceTagInformationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientServiceTagInformations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface ServiceTagInformationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("location") String location, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("noAddressPrefixes") Boolean noAddressPrefixes, @QueryParam("tagName") String tagName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 noAddressPrefixes Do not return address prefixes for the tag(s). + * @param tagName Return tag information for a particular tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 with pagination along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, + Boolean noAddressPrefixes, String tagName) { + 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), location, apiVersion, + this.client.getSubscriptionId(), noAddressPrefixes, tagName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 noAddressPrefixes Do not return address prefixes for the tag(s). + * @param tagName Return tag information for a particular tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 with pagination along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, + Boolean noAddressPrefixes, String tagName, 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), noAddressPrefixes, + tagName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 noAddressPrefixes Do not return address prefixes for the tag(s). + * @param tagName Return tag information for a particular tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 with pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Boolean noAddressPrefixes, + String tagName) { + return new PagedFlux<>(() -> listSinglePageAsync(location, noAddressPrefixes, tagName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 with pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + final Boolean noAddressPrefixes = null; + final String tagName = null; + return new PagedFlux<>(() -> listSinglePageAsync(location, noAddressPrefixes, tagName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 noAddressPrefixes Do not return address prefixes for the tag(s). + * @param tagName Return tag information for a particular tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 with pagination as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Boolean noAddressPrefixes, String tagName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, noAddressPrefixes, tagName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 with pagination as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + final Boolean noAddressPrefixes = null; + final String tagName = null; + return new PagedIterable<>(listAsync(location, noAddressPrefixes, tagName)); + } + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 noAddressPrefixes Do not return address prefixes for the tag(s). + * @param tagName Return tag information for a particular tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 with pagination as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Boolean noAddressPrefixes, String tagName, + Context context) { + return new PagedIterable<>(listAsync(location, noAddressPrefixes, tagName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Get ServiceTagInformation API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Get ServiceTagInformation API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsImpl.java new file mode 100644 index 0000000000000..525ff03f4769b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagInformationsImpl.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.ServiceTagInformationsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagInformationInner; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformation; +import com.azure.resourcemanager.network.generated.models.ServiceTagInformations; + +public final class ServiceTagInformationsImpl implements ServiceTagInformations { + private static final ClientLogger LOGGER = new ClientLogger(ServiceTagInformationsImpl.class); + + private final ServiceTagInformationsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public ServiceTagInformationsImpl(ServiceTagInformationsClient 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 ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceTagInformationImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Boolean noAddressPrefixes, String tagName, + Context context) { + PagedIterable inner + = this.serviceClient().list(location, noAddressPrefixes, tagName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceTagInformationImpl(inner1, this.manager())); + } + + private ServiceTagInformationsClient 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/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..676f48e29aa42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsClientImpl.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.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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String location) { + return listWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String location, Context context) { + return listWithResponseAsync(location, context).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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 listWithResponse(location, Context.NONE).getValue(); + } +} 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..0115af7dda870 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsImpl.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.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; + +public final class ServiceTagsImpl implements ServiceTags { + private static 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 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; + } + } + + public ServiceTagsListResult list(String location) { + ServiceTagsListResultInner inner = this.serviceClient().list(location); + if (inner != null) { + return new ServiceTagsListResultImpl(inner, 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..6cd332c2b0a34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/ServiceTagsListResultImpl.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.ServiceTagInformationInner; +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; +import java.util.stream.Collectors; + +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.stream() + .map(inner1 -> new ServiceTagInformationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } 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/SignatureOverridesFilterValuesResponseImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignatureOverridesFilterValuesResponseImpl.java new file mode 100644 index 0000000000000..a4e744426641c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignatureOverridesFilterValuesResponseImpl.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.SignatureOverridesFilterValuesResponseInner; +import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesResponse; +import java.util.Collections; +import java.util.List; + +public final class SignatureOverridesFilterValuesResponseImpl implements SignatureOverridesFilterValuesResponse { + private SignatureOverridesFilterValuesResponseInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SignatureOverridesFilterValuesResponseImpl(SignatureOverridesFilterValuesResponseInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List filterValues() { + List inner = this.innerModel().filterValues(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SignatureOverridesFilterValuesResponseInner 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/SignaturesOverridesImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesImpl.java new file mode 100644 index 0000000000000..95005be1ad26a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesImpl.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.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.models.SignaturesOverrides; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; + +public final class SignaturesOverridesImpl implements SignaturesOverrides { + private SignaturesOverridesInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SignaturesOverridesImpl(SignaturesOverridesInner 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 SignaturesOverridesProperties properties() { + return this.innerModel().properties(); + } + + public SignaturesOverridesInner 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/SignaturesOverridesListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesListImpl.java new file mode 100644 index 0000000000000..c459277fa3b17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SignaturesOverridesListImpl.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.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesListInner; +import com.azure.resourcemanager.network.generated.models.SignaturesOverrides; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SignaturesOverridesListImpl implements SignaturesOverridesList { + private SignaturesOverridesListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SignaturesOverridesListImpl(SignaturesOverridesListInner 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 SignaturesOverridesImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public SignaturesOverridesListInner 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/StaticMemberImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMemberImpl.java new file mode 100644 index 0000000000000..50c3c7a342c69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMemberImpl.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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.StaticMemberInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.StaticMember; + +public final class StaticMemberImpl implements StaticMember, StaticMember.Definition, StaticMember.Update { + private StaticMemberInner 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 etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public String region() { + return this.innerModel().region(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StaticMemberInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String networkManagerName; + + private String networkGroupName; + + private String staticMemberName; + + public StaticMemberImpl withExistingNetworkGroup(String resourceGroupName, String networkManagerName, + String networkGroupName) { + this.resourceGroupName = resourceGroupName; + this.networkManagerName = networkManagerName; + this.networkGroupName = networkGroupName; + return this; + } + + public StaticMember create() { + this.innerObject = serviceManager.serviceClient() + .getStaticMembers() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StaticMember create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStaticMembers() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + this.innerModel(), context) + .getValue(); + return this; + } + + StaticMemberImpl(String name, com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new StaticMemberInner(); + this.serviceManager = serviceManager; + this.staticMemberName = name; + } + + public StaticMemberImpl update() { + return this; + } + + public StaticMember apply() { + this.innerObject = serviceManager.serviceClient() + .getStaticMembers() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public StaticMember apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStaticMembers() + .createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + this.innerModel(), context) + .getValue(); + return this; + } + + StaticMemberImpl(StaticMemberInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkManagerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkManagers"); + this.networkGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkGroups"); + this.staticMemberName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "staticMembers"); + } + + public StaticMember refresh() { + this.innerObject = serviceManager.serviceClient() + .getStaticMembers() + .getWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, Context.NONE) + .getValue(); + return this; + } + + public StaticMember refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getStaticMembers() + .getWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, context) + .getValue(); + return this; + } + + public StaticMemberImpl withResourceId(String resourceId) { + this.innerModel().withResourceId(resourceId); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersClientImpl.java new file mode 100644 index 0000000000000..bb5d4e387e689 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersClientImpl.java @@ -0,0 +1,862 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.StaticMembersClient; +import com.azure.resourcemanager.network.generated.fluent.models.StaticMemberInner; +import com.azure.resourcemanager.network.generated.models.StaticMemberListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in StaticMembersClient. + */ +public final class StaticMembersClientImpl implements StaticMembersClient { + /** + * The proxy service used to perform REST calls. + */ + private final StaticMembersService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of StaticMembersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StaticMembersClientImpl(NetworkManagementClientImpl client) { + this.service + = RestProxy.create(StaticMembersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientStaticMembers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface StaticMembersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("networkGroupName") String networkGroupName, + @PathParam("staticMemberName") String staticMemberName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("networkGroupName") String networkGroupName, + @PathParam("staticMemberName") String staticMemberName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StaticMemberInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("networkGroupName") String networkGroupName, + @PathParam("staticMemberName") String staticMemberName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("networkManagerName") String networkManagerName, + @PathParam("networkGroupName") String networkGroupName, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @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 static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + if (staticMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter staticMemberName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, networkGroupName, staticMemberName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + if (staticMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter staticMemberName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, networkGroupName, staticMemberName, apiVersion, accept, context); + } + + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName) { + return getWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, Context context) { + return getWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, context) + .block(); + } + + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StaticMemberInner get(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName) { + return getWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param parameters Parameters supplied to the specify the static member to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return staticMember Item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, String staticMemberName, StaticMemberInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + if (staticMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter staticMemberName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, networkGroupName, staticMemberName, apiVersion, parameters, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param parameters Parameters supplied to the specify the static member to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return staticMember Item along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, String staticMemberName, StaticMemberInner 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + if (staticMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter staticMemberName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, networkGroupName, staticMemberName, apiVersion, parameters, accept, context); + } + + /** + * Creates or updates a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param parameters Parameters supplied to the specify the static member to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return staticMember Item on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, StaticMemberInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, + staticMemberName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param parameters Parameters supplied to the specify the static member to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return staticMember Item along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, StaticMemberInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, + staticMemberName, parameters, context).block(); + } + + /** + * Creates or updates a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param parameters Parameters supplied to the specify the static member to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return staticMember Item. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StaticMemberInner createOrUpdate(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, StaticMemberInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + parameters, Context.NONE).getValue(); + } + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + if (staticMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter staticMemberName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, networkGroupName, staticMemberName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + if (staticMemberName == null) { + return Mono + .error(new IllegalArgumentException("Parameter staticMemberName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + networkManagerName, networkGroupName, staticMemberName, apiVersion, accept, context); + } + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName) { + return deleteWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, Context context) { + return deleteWithResponseAsync(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + context).block(); + } + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 networkManagerName, String networkGroupName, + String staticMemberName) { + deleteWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, Context.NONE); + } + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StaticMember along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, networkManagerName, networkGroupName, apiVersion, top, skipToken, accept, context)) + .>map(res -> new 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 the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StaticMember along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String networkManagerName, String networkGroupName, Integer top, String skipToken, 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 (networkManagerName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkManagerName is required and cannot be null.")); + } + if (networkGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter networkGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, networkManagerName, + networkGroupName, apiVersion, top, skipToken, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StaticMember as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 StaticMember as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String networkGroupName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StaticMember as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String networkManagerName, + String networkGroupName, Integer top, String skipToken, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 StaticMember as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String networkGroupName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken)); + } + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StaticMember as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String networkManagerName, + String networkGroupName, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, networkManagerName, networkGroupName, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list StaticMember along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 StaticMember along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersImpl.java new file mode 100644 index 0000000000000..11650959f1199 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/StaticMembersImpl.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.StaticMembersClient; +import com.azure.resourcemanager.network.generated.fluent.models.StaticMemberInner; +import com.azure.resourcemanager.network.generated.models.StaticMember; +import com.azure.resourcemanager.network.generated.models.StaticMembers; + +public final class StaticMembersImpl implements StaticMembers { + private static final ClientLogger LOGGER = new ClientLogger(StaticMembersImpl.class); + + private final StaticMembersClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public StaticMembersImpl(StaticMembersClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StaticMemberImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StaticMember get(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName) { + StaticMemberInner inner + = this.serviceClient().get(resourceGroupName, networkManagerName, networkGroupName, staticMemberName); + if (inner != null) { + return new StaticMemberImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String networkManagerName, + String networkGroupName, String staticMemberName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, context); + } + + public void delete(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName) { + this.serviceClient().delete(resourceGroupName, networkManagerName, networkGroupName, staticMemberName); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String networkGroupName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkManagerName, networkGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StaticMemberImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String networkManagerName, + String networkGroupName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, networkManagerName, networkGroupName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StaticMemberImpl(inner1, this.manager())); + } + + public StaticMember getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + String staticMemberName = ResourceManagerUtils.getValueFromIdByName(id, "staticMembers"); + if (staticMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'staticMembers'.", id))); + } + return this + .getWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + String staticMemberName = ResourceManagerUtils.getValueFromIdByName(id, "staticMembers"); + if (staticMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'staticMembers'.", id))); + } + return this.getWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + String staticMemberName = ResourceManagerUtils.getValueFromIdByName(id, "staticMembers"); + if (staticMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'staticMembers'.", id))); + } + this.deleteWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkManagerName = ResourceManagerUtils.getValueFromIdByName(id, "networkManagers"); + if (networkManagerName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkManagers'.", id))); + } + String networkGroupName = ResourceManagerUtils.getValueFromIdByName(id, "networkGroups"); + if (networkGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'networkGroups'.", id))); + } + String staticMemberName = ResourceManagerUtils.getValueFromIdByName(id, "staticMembers"); + if (staticMemberName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'staticMembers'.", id))); + } + return this.deleteWithResponse(resourceGroupName, networkManagerName, networkGroupName, staticMemberName, + context); + } + + private StaticMembersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public StaticMemberImpl define(String name) { + return new StaticMemberImpl(name, this.manager()); + } +} 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..f368960999775 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetImpl.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SharingScope; +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 SharingScope sharingScope() { + return this.innerModel().sharingScope(); + } + + public Boolean defaultOutboundAccess() { + return this.innerModel().defaultOutboundAccess(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.subnetName = ResourceManagerUtils.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; + } + + public SubnetImpl withSharingScope(SharingScope sharingScope) { + this.innerModel().withSharingScope(sharingScope); + return this; + } + + public SubnetImpl withDefaultOutboundAccess(Boolean defaultOutboundAccess) { + this.innerModel().withDefaultOutboundAccess(defaultOutboundAccess); + return this; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetPropertiesFormatImpl.java new file mode 100644 index 0000000000000..be0f6dd045f27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetPropertiesFormatImpl.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.management.SubResource; +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.SubnetPropertiesFormatInner; +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.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.SharingScope; +import com.azure.resourcemanager.network.generated.models.SubnetPropertiesFormat; +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 SubnetPropertiesFormatImpl implements SubnetPropertiesFormat { + private SubnetPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SubnetPropertiesFormatImpl(SubnetPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 SharingScope sharingScope() { + return this.innerModel().sharingScope(); + } + + public Boolean defaultOutboundAccess() { + return this.innerModel().defaultOutboundAccess(); + } + + public SubnetPropertiesFormatInner 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/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..86db4f4682b32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsClientImpl.java @@ -0,0 +1,1522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, + String subnetName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, + String subnetName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + final String expand = null; + return getWithResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 getWithResponse(resourceGroupName, virtualNetworkName, subnetName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SubnetInner> beginCreateOrUpdate(String resourceGroupName, + String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return this.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 the {@link SyncPoller} for polling of subnet in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SubnetInner> beginCreateOrUpdate(String resourceGroupName, + String virtualNetworkName, String subnetName, SubnetInner subnetParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPrepareNetworkPolicies(String resourceGroupName, + String virtualNetworkName, String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters) { + return this + .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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginPrepareNetworkPolicies(String resourceGroupName, + String virtualNetworkName, String subnetName, + PrepareNetworkPoliciesRequest prepareNetworkPoliciesRequestParameters, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUnprepareNetworkPolicies(String resourceGroupName, + String virtualNetworkName, String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters) { + return this + .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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUnprepareNetworkPolicies(String resourceGroupName, + String virtualNetworkName, String subnetName, + UnprepareNetworkPoliciesRequest unprepareNetworkPoliciesRequestParameters, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..2c684aaaa10d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubnetsImpl.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.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; + +public final class SubnetsImpl implements Subnets { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new SubnetImpl(inner1, this.manager())); + } + + public Subnet getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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/SubscriptionNetworkManagerConnectionsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsClientImpl.java new file mode 100644 index 0000000000000..997150f598518 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsClientImpl.java @@ -0,0 +1,668 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.network.generated.fluent.SubscriptionNetworkManagerConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerConnectionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * SubscriptionNetworkManagerConnectionsClient. + */ +public final class SubscriptionNetworkManagerConnectionsClientImpl + implements SubscriptionNetworkManagerConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SubscriptionNetworkManagerConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of SubscriptionNetworkManagerConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubscriptionNetworkManagerConnectionsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(SubscriptionNetworkManagerConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientSubscriptionNetworkManagerConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface SubscriptionNetworkManagerConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkManagerConnectionName") String networkManagerConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NetworkManagerConnectionInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkManagerConnectionName") String networkManagerConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkManagerConnectionName") String networkManagerConnectionName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @QueryParam("$top") Integer top, @QueryParam("$skipToken") String skipToken, + @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 a network manager connection on this subscription. + * + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + createOrUpdateWithResponseAsync(String networkManagerConnectionName, NetworkManagerConnectionInner 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 (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + networkManagerConnectionName, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a network manager connection on this subscription. + * + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String networkManagerConnectionName, NetworkManagerConnectionInner 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 (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + networkManagerConnectionName, apiVersion, parameters, accept, context); + } + + /** + * Create a network manager connection on this subscription. + * + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String networkManagerConnectionName, + NetworkManagerConnectionInner parameters) { + return createOrUpdateWithResponseAsync(networkManagerConnectionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a network manager connection on this subscription. + * + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String networkManagerConnectionName, + NetworkManagerConnectionInner parameters, Context context) { + return createOrUpdateWithResponseAsync(networkManagerConnectionName, parameters, context).block(); + } + + /** + * Create a network manager connection on this subscription. + * + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerConnectionInner createOrUpdate(String networkManagerConnectionName, + NetworkManagerConnectionInner parameters) { + return createOrUpdateWithResponse(networkManagerConnectionName, parameters, Context.NONE).getValue(); + } + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkManagerConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + networkManagerConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String networkManagerConnectionName, + 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 (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), networkManagerConnectionName, + apiVersion, accept, context); + } + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String networkManagerConnectionName) { + return getWithResponseAsync(networkManagerConnectionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String networkManagerConnectionName, + Context context) { + return getWithResponseAsync(networkManagerConnectionName, context).block(); + } + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkManagerConnectionInner get(String networkManagerConnectionName) { + return getWithResponse(networkManagerConnectionName, Context.NONE).getValue(); + } + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String networkManagerConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + networkManagerConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String networkManagerConnectionName, 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 (networkManagerConnectionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter networkManagerConnectionName is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), networkManagerConnectionName, + apiVersion, accept, context); + } + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String networkManagerConnectionName) { + return deleteWithResponseAsync(networkManagerConnectionName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String networkManagerConnectionName, Context context) { + return deleteWithResponseAsync(networkManagerConnectionName, context).block(); + } + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 networkManagerConnectionName) { + deleteWithResponse(networkManagerConnectionName, Context.NONE); + } + + /** + * List all network manager connections created by this subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, + top, skipToken, accept, context)) + .>map(res -> new 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 network manager connections created by this subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Integer top, String skipToken, + 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, top, skipToken, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all network manager connections created by this subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager connections created by this 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 network manager connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>(() -> listSinglePageAsync(top, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all network manager connections created by this subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(top, skipToken, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all network manager connections created by this 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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>(listAsync(top, skipToken)); + } + + /** + * List all network manager connections created by this subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, String skipToken, Context context) { + return new PagedIterable<>(listAsync(top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 network manager connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsImpl.java new file mode 100644 index 0000000000000..f13a3c17ec1aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SubscriptionNetworkManagerConnectionsImpl.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.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.SubscriptionNetworkManagerConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; +import com.azure.resourcemanager.network.generated.models.NetworkManagerConnection; +import com.azure.resourcemanager.network.generated.models.SubscriptionNetworkManagerConnections; + +public final class SubscriptionNetworkManagerConnectionsImpl implements SubscriptionNetworkManagerConnections { + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionNetworkManagerConnectionsImpl.class); + + private final SubscriptionNetworkManagerConnectionsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public SubscriptionNetworkManagerConnectionsImpl(SubscriptionNetworkManagerConnectionsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String networkManagerConnectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(networkManagerConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkManagerConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkManagerConnection get(String networkManagerConnectionName) { + NetworkManagerConnectionInner inner = this.serviceClient().get(networkManagerConnectionName); + if (inner != null) { + return new NetworkManagerConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String networkManagerConnectionName, Context context) { + return this.serviceClient().deleteWithResponse(networkManagerConnectionName, context); + } + + public void delete(String networkManagerConnectionName) { + this.serviceClient().delete(networkManagerConnectionName); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient().list(top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new NetworkManagerConnectionImpl(inner1, this.manager())); + } + + public NetworkManagerConnection getById(String id) { + String networkManagerConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "networkManagerConnections"); + if (networkManagerConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkManagerConnections'.", id))); + } + return this.getWithResponse(networkManagerConnectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String networkManagerConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "networkManagerConnections"); + if (networkManagerConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkManagerConnections'.", id))); + } + return this.getWithResponse(networkManagerConnectionName, context); + } + + public void deleteById(String id) { + String networkManagerConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "networkManagerConnections"); + if (networkManagerConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkManagerConnections'.", id))); + } + this.deleteWithResponse(networkManagerConnectionName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String networkManagerConnectionName + = ResourceManagerUtils.getValueFromIdByName(id, "networkManagerConnections"); + if (networkManagerConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'networkManagerConnections'.", id))); + } + return this.deleteWithResponse(networkManagerConnectionName, context); + } + + private SubscriptionNetworkManagerConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + public NetworkManagerConnectionImpl define(String name) { + return new NetworkManagerConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceImpl.java new file mode 100644 index 0000000000000..8bcdc34498bba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceImpl.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.SwapResourceInner; +import com.azure.resourcemanager.network.generated.models.SwapResource; +import com.azure.resourcemanager.network.generated.models.SwapResourceProperties; + +public final class SwapResourceImpl implements SwapResource { + private SwapResourceInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SwapResourceImpl(SwapResourceInner 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 SwapResourceProperties properties() { + return this.innerModel().properties(); + } + + public SwapResourceInner 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/SwapResourceListResultImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceListResultImpl.java new file mode 100644 index 0000000000000..fafae72a8176d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/SwapResourceListResultImpl.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.resourcemanager.network.generated.fluent.models.SwapResourceInner; +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceListResultInner; +import com.azure.resourcemanager.network.generated.models.SwapResource; +import com.azure.resourcemanager.network.generated.models.SwapResourceListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SwapResourceListResultImpl implements SwapResourceListResult { + private SwapResourceListResultInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + SwapResourceListResultImpl(SwapResourceListResultInner 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 SwapResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public SwapResourceListResultInner 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/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..ed51831edb7f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/TroubleshootingResultImpl.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.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..b63740ecf741b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesClientImpl.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list usages operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..5aed1cbe11023 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/UsagesImpl.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.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; + +public final class UsagesImpl implements Usages { + private static 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 ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.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/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..9f1f8814e4b6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VerificationIpFlowResultImpl.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.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/VipSwapsClientImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsClientImpl.java new file mode 100644 index 0000000000000..9d43265676c98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsClientImpl.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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VipSwapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceInner; +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceListResultInner; +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 VipSwapsClient. + */ +public final class VipSwapsClientImpl implements VipSwapsClient { + /** + * The proxy service used to perform REST calls. + */ + private final VipSwapsService service; + + /** + * The service client containing this operation class. + */ + private final NetworkManagementClientImpl client; + + /** + * Initializes an instance of VipSwapsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VipSwapsClientImpl(NetworkManagementClientImpl client) { + this.service = RestProxy.create(VipSwapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NetworkManagementClientVipSwaps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NetworkManagementCli") + public interface VipSwapsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("groupName") String groupName, @PathParam("resourceName") String resourceName, + @PathParam("singletonResource") String singletonResource, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("groupName") String groupName, @PathParam("resourceName") String resourceName, + @PathParam("singletonResource") String singletonResource, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SwapResourceInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("groupName") String groupName, @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String groupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String singletonResource = "swap"; + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), groupName, resourceName, singletonResource, + apiVersion, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String groupName, String resourceName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String singletonResource = "swap"; + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), groupName, resourceName, singletonResource, apiVersion, + this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String groupName, String resourceName) { + return getWithResponseAsync(groupName, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String groupName, String resourceName, Context context) { + return getWithResponseAsync(groupName, resourceName, context).block(); + } + + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SwapResourceInner get(String groupName, String resourceName) { + return getWithResponse(groupName, resourceName, Context.NONE).getValue(); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String groupName, String resourceName, + SwapResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.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 singletonResource = "swap"; + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), groupName, resourceName, + singletonResource, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String groupName, String resourceName, + SwapResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.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 singletonResource = "swap"; + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), groupName, resourceName, singletonResource, apiVersion, + this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCreateAsync(String groupName, String resourceName, + SwapResourceInner parameters) { + Mono>> mono = createWithResponseAsync(groupName, resourceName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginCreateAsync(String groupName, String resourceName, + SwapResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(groupName, resourceName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCreate(String groupName, String resourceName, + SwapResourceInner parameters) { + return this.beginCreateAsync(groupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginCreate(String groupName, String resourceName, + SwapResourceInner parameters, Context context) { + return this.beginCreateAsync(groupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String groupName, String resourceName, SwapResourceInner parameters) { + return beginCreateAsync(groupName, resourceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String groupName, String resourceName, SwapResourceInner parameters, + Context context) { + return beginCreateAsync(groupName, resourceName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void create(String groupName, String resourceName, SwapResourceInner parameters) { + createAsync(groupName, resourceName, parameters).block(); + } + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void create(String groupName, String resourceName, SwapResourceInner parameters, Context context) { + createAsync(groupName, resourceName, parameters, context).block(); + } + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String groupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), groupName, resourceName, apiVersion, + this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String groupName, String resourceName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), groupName, resourceName, apiVersion, + this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String groupName, String resourceName) { + return listWithResponseAsync(groupName, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String groupName, String resourceName, + Context context) { + return listWithResponseAsync(groupName, resourceName, context).block(); + } + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SwapResourceListResultInner list(String groupName, String resourceName) { + return listWithResponse(groupName, resourceName, Context.NONE).getValue(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsImpl.java new file mode 100644 index 0000000000000..4237e73895335 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VipSwapsImpl.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.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.VipSwapsClient; +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceInner; +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceListResultInner; +import com.azure.resourcemanager.network.generated.models.SwapResource; +import com.azure.resourcemanager.network.generated.models.SwapResourceListResult; +import com.azure.resourcemanager.network.generated.models.VipSwaps; + +public final class VipSwapsImpl implements VipSwaps { + private static final ClientLogger LOGGER = new ClientLogger(VipSwapsImpl.class); + + private final VipSwapsClient innerClient; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + public VipSwapsImpl(VipSwapsClient innerClient, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String groupName, String resourceName, Context context) { + Response inner = this.serviceClient().getWithResponse(groupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SwapResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SwapResource get(String groupName, String resourceName) { + SwapResourceInner inner = this.serviceClient().get(groupName, resourceName); + if (inner != null) { + return new SwapResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void create(String groupName, String resourceName, SwapResourceInner parameters) { + this.serviceClient().create(groupName, resourceName, parameters); + } + + public void create(String groupName, String resourceName, SwapResourceInner parameters, Context context) { + this.serviceClient().create(groupName, resourceName, parameters, context); + } + + public Response listWithResponse(String groupName, String resourceName, Context context) { + Response inner + = this.serviceClient().listWithResponse(groupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SwapResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SwapResourceListResult list(String groupName, String resourceName) { + SwapResourceListResultInner inner = this.serviceClient().list(groupName, resourceName); + if (inner != null) { + return new SwapResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private VipSwapsClient 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/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..ede342afada20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSiteImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.networkVirtualApplianceName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "networkVirtualAppliances"); + this.siteName = ResourceManagerUtils.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..a635479fb0a4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesClientImpl.java @@ -0,0 +1,953 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkVirtualApplianceName, + String siteName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String networkVirtualApplianceName, + String siteName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String networkVirtualApplianceName, + String siteName) { + return getWithResponseAsync(resourceGroupName, networkVirtualApplianceName, siteName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String siteName, Context context) { + return getWithResponseAsync(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) + public VirtualApplianceSiteInner get(String resourceGroupName, String networkVirtualApplianceName, + String siteName) { + return getWithResponse(resourceGroupName, networkVirtualApplianceName, siteName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, String siteName, + VirtualApplianceSiteInner parameters) { + return this.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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualApplianceSiteInner> beginCreateOrUpdate( + String resourceGroupName, String networkVirtualApplianceName, String siteName, + VirtualApplianceSiteInner parameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSites API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..26a0a66034ca4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSitesImpl.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.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; + +public final class VirtualApplianceSitesImpl implements VirtualApplianceSites { + private static 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 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 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 PagedIterable list(String resourceGroupName, String networkVirtualApplianceName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, networkVirtualApplianceName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualApplianceSiteImpl(inner1, this.manager())); + } + + public VirtualApplianceSite getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String networkVirtualApplianceName = ResourceManagerUtils.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 = ResourceManagerUtils.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..110e457b387a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusClientImpl.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 available NetworkVirtualApplianceSkus along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 available NetworkVirtualApplianceSkus along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 available NetworkVirtualApplianceSkus on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String skuName) { + return getWithResponseAsync(skuName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 available NetworkVirtualApplianceSkus along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String skuName, Context context) { + return getWithResponseAsync(skuName, context).block(); + } + + /** + * 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 available NetworkVirtualApplianceSkus. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkVirtualApplianceSkuInner get(String skuName) { + return getWithResponse(skuName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListNetworkVirtualApplianceSkus API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..f7312bcae64b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualApplianceSkusImpl.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.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; + +public final class VirtualApplianceSkusImpl implements VirtualApplianceSkus { + private static 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 ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkVirtualApplianceSkuImpl(inner1, this.manager())); + } + + 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; + } + } + + public NetworkVirtualApplianceSku get(String skuName) { + NetworkVirtualApplianceSkuInner inner = this.serviceClient().get(skuName); + if (inner != null) { + return new NetworkVirtualApplianceSkuImpl(inner, 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..dd29d25e76e4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsClientImpl.java @@ -0,0 +1,1415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import com.azure.resourcemanager.network.generated.fluent.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.models.ListVirtualHubBgpConnectionResults; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; +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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, String connectionName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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 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 getWithResponse(resourceGroupName, virtualHubName, connectionName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BgpConnectionInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String connectionName, BgpConnectionInner parameters) { + return this.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 the {@link SyncPoller} for polling of virtual Appliance Site resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BgpConnectionInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, String connectionName, BgpConnectionInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String connectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String connectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 map from virtual router instance to list of peer routes along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 map from virtual router instance to list of peer routes along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>>, Map>> + beginListLearnedRoutesAsync(String resourceGroupName, String hubName, String connectionName) { + Mono>> mono + = listLearnedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName); + return this.client.>, Map>>getLroResult(mono, + this.client.getHttpPipeline(), new TypeReference>>() { + }.getJavaType(), new TypeReference>>() { + }.getJavaType(), this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>>, Map>> + beginListLearnedRoutesAsync(String resourceGroupName, String hubName, String connectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = listLearnedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName, context); + return this.client.>, Map>>getLroResult(mono, + this.client.getHttpPipeline(), new TypeReference>>() { + }.getJavaType(), new TypeReference>>() { + }.getJavaType(), 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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>>, Map>> + beginListLearnedRoutes(String resourceGroupName, String hubName, String connectionName) { + return this.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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>>, Map>> + beginListLearnedRoutes(String resourceGroupName, String hubName, String connectionName, Context context) { + return this.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 map from virtual router instance to list of peer routes on successful completion of {@link Mono}. + */ + @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 map from virtual router instance to list of peer routes on successful completion of {@link Mono}. + */ + @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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map> 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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map> 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 map from virtual router instance to list of peer routes along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 map from virtual router instance to list of peer routes along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>>, Map>> + beginListAdvertisedRoutesAsync(String resourceGroupName, String hubName, String connectionName) { + Mono>> mono + = listAdvertisedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName); + return this.client.>, Map>>getLroResult(mono, + this.client.getHttpPipeline(), new TypeReference>>() { + }.getJavaType(), new TypeReference>>() { + }.getJavaType(), this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux>>, Map>> + beginListAdvertisedRoutesAsync(String resourceGroupName, String hubName, String connectionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = listAdvertisedRoutesWithResponseAsync(resourceGroupName, hubName, connectionName, context); + return this.client.>, Map>>getLroResult(mono, + this.client.getHttpPipeline(), new TypeReference>>() { + }.getJavaType(), new TypeReference>>() { + }.getJavaType(), 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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>>, Map>> + beginListAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName) { + return this.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 the {@link SyncPoller} for polling of map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller>>, Map>> + beginListAdvertisedRoutes(String resourceGroupName, String hubName, String connectionName, Context context) { + return this.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 map from virtual router instance to list of peer routes on successful completion of {@link Mono}. + */ + @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 map from virtual router instance to list of peer routes on successful completion of {@link Mono}. + */ + @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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map> 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 map from virtual router instance to list of peer routes. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map> 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubBgpConnections list along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..3645dfdde7aea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubBgpConnectionsImpl.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.VirtualHubBgpConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import com.azure.resourcemanager.network.generated.models.BgpConnection; +import com.azure.resourcemanager.network.generated.models.PeerRoute; +import com.azure.resourcemanager.network.generated.models.VirtualHubBgpConnections; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class VirtualHubBgpConnectionsImpl implements VirtualHubBgpConnections { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new BgpConnectionImpl(inner1, this.manager())); + } + + public Map> listLearnedRoutes(String resourceGroupName, String hubName, + String connectionName) { + Map> inner + = this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map> listLearnedRoutes(String resourceGroupName, String hubName, + String connectionName, Context context) { + Map> inner + = this.serviceClient().listLearnedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map> listAdvertisedRoutes(String resourceGroupName, String hubName, + String connectionName) { + Map> inner + = this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map> listAdvertisedRoutes(String resourceGroupName, String hubName, + String connectionName, Context context) { + Map> inner + = this.serviceClient().listAdvertisedRoutes(resourceGroupName, hubName, connectionName, context); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public BgpConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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/VirtualHubEffectiveRouteListImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubEffectiveRouteListImpl.java new file mode 100644 index 0000000000000..c79e735f29354 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubEffectiveRouteListImpl.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.VirtualHubEffectiveRouteListInner; +import com.azure.resourcemanager.network.generated.models.VirtualHubEffectiveRoute; +import com.azure.resourcemanager.network.generated.models.VirtualHubEffectiveRouteList; +import java.util.Collections; +import java.util.List; + +public final class VirtualHubEffectiveRouteListImpl implements VirtualHubEffectiveRouteList { + private VirtualHubEffectiveRouteListInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualHubEffectiveRouteListImpl(VirtualHubEffectiveRouteListInner 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 VirtualHubEffectiveRouteListInner 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/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..86e6445495e58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubImpl.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.EffectiveRouteMapRouteList; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetInboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetOutboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.HubRoutingPreference; +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.VirtualHubEffectiveRouteList; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTable; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteTableV2; +import com.azure.resourcemanager.network.generated.models.VirtualRouterAutoScaleConfiguration; +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 String kind() { + return this.innerModel().kind(); + } + + public String id() { + return this.innerModel().id(); + } + + 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 List routeMaps() { + List inner = this.innerModel().routeMaps(); + 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 HubRoutingPreference hubRoutingPreference() { + return this.innerModel().hubRoutingPreference(); + } + + public VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration() { + return this.innerModel().virtualRouterAutoScaleConfiguration(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualHubName = ResourceManagerUtils.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 VirtualHubEffectiveRouteList getEffectiveVirtualHubRoutes() { + return serviceManager.virtualHubs().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + } + + public VirtualHubEffectiveRouteList + getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, Context context) { + return serviceManager.virtualHubs() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + } + + public EffectiveRouteMapRouteList getInboundRoutes(GetInboundRoutesParameters getInboundRoutesParameters) { + return serviceManager.virtualHubs() + .getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters); + } + + public EffectiveRouteMapRouteList getInboundRoutes(GetInboundRoutesParameters getInboundRoutesParameters, + Context context) { + return serviceManager.virtualHubs() + .getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters, context); + } + + public EffectiveRouteMapRouteList getOutboundRoutes(GetOutboundRoutesParameters getOutboundRoutesParameters) { + return serviceManager.virtualHubs() + .getOutboundRoutes(resourceGroupName, virtualHubName, getOutboundRoutesParameters); + } + + public EffectiveRouteMapRouteList getOutboundRoutes(GetOutboundRoutesParameters getOutboundRoutesParameters, + Context context) { + return serviceManager.virtualHubs() + .getOutboundRoutes(resourceGroupName, virtualHubName, getOutboundRoutesParameters, 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; + } + + public VirtualHubImpl withHubRoutingPreference(HubRoutingPreference hubRoutingPreference) { + this.innerModel().withHubRoutingPreference(hubRoutingPreference); + return this; + } + + public VirtualHubImpl withVirtualRouterAutoScaleConfiguration( + VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration) { + this.innerModel().withVirtualRouterAutoScaleConfiguration(virtualRouterAutoScaleConfiguration); + 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..8ac3bcca688fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsClientImpl.java @@ -0,0 +1,941 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, + String ipConfigName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String virtualHubName, + String ipConfigName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, ipConfigName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, virtualHubName, ipConfigName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters) { + return this.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 the {@link SyncPoller} for polling of ipConfigurations. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, HubIpConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String ipConfigName, HubIpConfigurationInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String ipConfigName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String ipConfigName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return virtualHubIpConfigurations list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..a0c6e406120f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubIpConfigurationsImpl.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.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; + +public final class VirtualHubIpConfigurationsImpl implements VirtualHubIpConfigurations { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new HubIpConfigurationImpl(inner1, this.manager())); + } + + public HubIpConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.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..c34470e894c51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2Impl.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.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..1847bf59dbad3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SClientImpl.java @@ -0,0 +1,949 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualHubName, + String routeTableName) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String virtualHubName, + String routeTableName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualHubName, routeTableName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, virtualHubName, routeTableName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters) { + return this + .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 the {@link SyncPoller} for polling of virtualHubRouteTableV2 Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubRouteTableV2Inner> beginCreateOrUpdate( + String resourceGroupName, String virtualHubName, String routeTableName, + VirtualHubRouteTableV2Inner virtualHubRouteTableV2Parameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routeTableName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + String routeTableName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response + * with {@link PagedFlux}. + */ + @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 as paginated response + * with {@link PagedFlux}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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 as paginated response + * with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..b3d518eb86577 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubRouteTableV2SImpl.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.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; + +public final class VirtualHubRouteTableV2SImpl implements VirtualHubRouteTableV2S { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.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..d9b0e2dde647b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsClientImpl.java @@ -0,0 +1,2028 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.EffectiveRouteMapRouteListInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubEffectiveRouteListInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetInboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetOutboundRoutesParameters; +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 { + /** + * 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") + public 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/inboundRoutes") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getInboundRoutes(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GetInboundRoutesParameters getInboundRoutesParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/outboundRoutes") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getOutboundRoutes(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualHubName") String virtualHubName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GetOutboundRoutesParameters getOutboundRoutesParameters, + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualHubName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHubName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String virtualHubName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualHubName, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, virtualHubName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, VirtualHubInner virtualHubParameters) { + return this.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 the {@link SyncPoller} for polling of virtualHub Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubInner> beginCreateOrUpdate(String resourceGroupName, + String virtualHubName, VirtualHubInner virtualHubParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String virtualHubName, + TagsObject virtualHubParameters) { + return updateTagsWithResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String virtualHubName, + TagsObject virtualHubParameters, Context context) { + return updateTagsWithResponseAsync(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) + public VirtualHubInner updateTags(String resourceGroupName, String virtualHubName, + TagsObject virtualHubParameters) { + return updateTagsWithResponse(resourceGroupName, virtualHubName, virtualHubParameters, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualHubName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the effective routes configured for the Virtual Hub resource or the + * specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualHubEffectiveRouteListInner> + beginGetEffectiveVirtualHubRoutesAsync(String resourceGroupName, String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters) { + Mono>> mono = getEffectiveVirtualHubRoutesWithResponseAsync(resourceGroupName, + virtualHubName, effectiveRoutesParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualHubEffectiveRouteListInner.class, + VirtualHubEffectiveRouteListInner.class, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the effective routes configured for the Virtual Hub resource or the + * specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualHubEffectiveRouteListInner> + beginGetEffectiveVirtualHubRoutesAsync(String resourceGroupName, String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + Mono>> mono = getEffectiveVirtualHubRoutesWithResponseAsync(resourceGroupName, + virtualHubName, effectiveRoutesParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualHubEffectiveRouteListInner.class, + VirtualHubEffectiveRouteListInner.class, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the effective routes configured for the Virtual Hub resource or the + * specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualHubEffectiveRouteListInner> + 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(), VirtualHubEffectiveRouteListInner.class, + VirtualHubEffectiveRouteListInner.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the effective routes configured for the Virtual Hub resource or the + * specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubEffectiveRouteListInner> + beginGetEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + return this.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 {@link SyncPoller} for polling of the effective routes configured for the Virtual Hub resource or the + * specified resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualHubEffectiveRouteListInner> + beginGetEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, Context context) { + return this + .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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 VirtualHubEffectiveRouteListInner getEffectiveVirtualHubRoutes(String resourceGroupName, + String virtualHubName) { + final EffectiveRoutesParameters effectiveRoutesParameters = null; + return 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. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VirtualHubEffectiveRouteListInner getEffectiveVirtualHubRoutes(String resourceGroupName, + String virtualHubName, EffectiveRoutesParameters effectiveRoutesParameters, Context context) { + return getEffectiveVirtualHubRoutesAsync(resourceGroupName, virtualHubName, effectiveRoutesParameters, context) + .block(); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getInboundRoutesWithResponseAsync(String resourceGroupName, + String virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (getInboundRoutesParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter getInboundRoutesParameters is required and cannot be null.")); + } else { + getInboundRoutesParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getInboundRoutes(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, apiVersion, getInboundRoutesParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getInboundRoutesWithResponseAsync(String resourceGroupName, + String virtualHubName, GetInboundRoutesParameters getInboundRoutesParameters, 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 (getInboundRoutesParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter getInboundRoutesParameters is required and cannot be null.")); + } else { + getInboundRoutesParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getInboundRoutes(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, apiVersion, getInboundRoutesParameters, accept, context); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the inbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EffectiveRouteMapRouteListInner> + beginGetInboundRoutesAsync(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters) { + Mono>> mono + = getInboundRoutesWithResponseAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EffectiveRouteMapRouteListInner.class, EffectiveRouteMapRouteListInner.class, + this.client.getContext()); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the inbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EffectiveRouteMapRouteListInner> + beginGetInboundRoutesAsync(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = getInboundRoutesWithResponseAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EffectiveRouteMapRouteListInner.class, EffectiveRouteMapRouteListInner.class, + context); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the inbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteMapRouteListInner> + beginGetInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters) { + return this.beginGetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters) + .getSyncPoller(); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the inbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteMapRouteListInner> + beginGetInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, Context context) { + return this.beginGetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, context) + .getSyncPoller(); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInboundRoutesAsync(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters) { + return beginGetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInboundRoutesAsync(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, Context context) { + return beginGetInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveRouteMapRouteListInner getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters) { + return getInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters).block(); + } + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveRouteMapRouteListInner getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, Context context) { + return getInboundRoutesAsync(resourceGroupName, virtualHubName, getInboundRoutesParameters, context).block(); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getOutboundRoutesWithResponseAsync(String resourceGroupName, + String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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 (getOutboundRoutesParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter getOutboundRoutesParameters is required and cannot be null.")); + } else { + getOutboundRoutesParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getOutboundRoutes(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, virtualHubName, apiVersion, getOutboundRoutesParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getOutboundRoutesWithResponseAsync(String resourceGroupName, + String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, 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 (getOutboundRoutesParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter getOutboundRoutesParameters is required and cannot be null.")); + } else { + getOutboundRoutesParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getOutboundRoutes(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + virtualHubName, apiVersion, getOutboundRoutesParameters, accept, context); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the outbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EffectiveRouteMapRouteListInner> + beginGetOutboundRoutesAsync(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters) { + Mono>> mono + = getOutboundRoutesWithResponseAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EffectiveRouteMapRouteListInner.class, EffectiveRouteMapRouteListInner.class, + this.client.getContext()); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the outbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EffectiveRouteMapRouteListInner> + beginGetOutboundRoutesAsync(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = getOutboundRoutesWithResponseAsync(resourceGroupName, virtualHubName, + getOutboundRoutesParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EffectiveRouteMapRouteListInner.class, EffectiveRouteMapRouteListInner.class, + context); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the outbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteMapRouteListInner> + beginGetOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters) { + return this.beginGetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters) + .getSyncPoller(); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the outbound routes configured for the Virtual Hub on a particular + * connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EffectiveRouteMapRouteListInner> + beginGetOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, Context context) { + return this.beginGetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, context) + .getSyncPoller(); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOutboundRoutesAsync(String resourceGroupName, + String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters) { + return beginGetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOutboundRoutesAsync(String resourceGroupName, + String virtualHubName, GetOutboundRoutesParameters getOutboundRoutesParameters, Context context) { + return beginGetOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveRouteMapRouteListInner getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters) { + return getOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters).block(); + } + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EffectiveRouteMapRouteListInner getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, Context context) { + return getOutboundRoutesAsync(resourceGroupName, virtualHubName, getOutboundRoutesParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualHubs along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..04802a64b8594 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualHubsImpl.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.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.EffectiveRouteMapRouteListInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubEffectiveRouteListInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import com.azure.resourcemanager.network.generated.models.EffectiveRouteMapRouteList; +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetInboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.GetOutboundRoutesParameters; +import com.azure.resourcemanager.network.generated.models.VirtualHub; +import com.azure.resourcemanager.network.generated.models.VirtualHubEffectiveRouteList; +import com.azure.resourcemanager.network.generated.models.VirtualHubs; + +public final class VirtualHubsImpl implements VirtualHubs { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualHubImpl(inner1, this.manager())); + } + + public VirtualHubEffectiveRouteList getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName) { + VirtualHubEffectiveRouteListInner inner + = this.serviceClient().getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName); + if (inner != null) { + return new VirtualHubEffectiveRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualHubEffectiveRouteList getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, Context context) { + VirtualHubEffectiveRouteListInner inner = this.serviceClient() + .getEffectiveVirtualHubRoutes(resourceGroupName, virtualHubName, effectiveRoutesParameters, context); + if (inner != null) { + return new VirtualHubEffectiveRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveRouteMapRouteList getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters) { + EffectiveRouteMapRouteListInner inner + = this.serviceClient().getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters); + if (inner != null) { + return new EffectiveRouteMapRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveRouteMapRouteList getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, Context context) { + EffectiveRouteMapRouteListInner inner = this.serviceClient() + .getInboundRoutes(resourceGroupName, virtualHubName, getInboundRoutesParameters, context); + if (inner != null) { + return new EffectiveRouteMapRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveRouteMapRouteList getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters) { + EffectiveRouteMapRouteListInner inner + = this.serviceClient().getOutboundRoutes(resourceGroupName, virtualHubName, getOutboundRoutesParameters); + if (inner != null) { + return new EffectiveRouteMapRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public EffectiveRouteMapRouteList getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, Context context) { + EffectiveRouteMapRouteListInner inner = this.serviceClient() + .getOutboundRoutes(resourceGroupName, virtualHubName, getOutboundRoutesParameters, context); + if (inner != null) { + return new EffectiveRouteMapRouteListImpl(inner, this.manager()); + } else { + return null; + } + } + + public VirtualHub getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualHubName = ResourceManagerUtils.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..e2267a9648d93 --- /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.GatewayCustomBgpIpAddressIpConfiguration; +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 id() { + return this.innerModel().id(); + } + + 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 List gatewayCustomBgpIpAddresses() { + List inner = this.innerModel().gatewayCustomBgpIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 Boolean enablePrivateLinkFastPath() { + return this.innerModel().enablePrivateLinkFastPath(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayConnectionName + = ResourceManagerUtils.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() { + 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 + withGatewayCustomBgpIpAddresses(List gatewayCustomBgpIpAddresses) { + this.innerModel().withGatewayCustomBgpIpAddresses(gatewayCustomBgpIpAddresses); + 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; + } + + public VirtualNetworkGatewayConnectionImpl withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath) { + this.innerModel().withEnablePrivateLinkFastPath(enablePrivateLinkFastPath); + 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..b502e74f7d7cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionListEntityImpl.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.implementation; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 id() { + return this.innerModel().id(); + } + + 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 List gatewayCustomBgpIpAddresses() { + List inner = this.innerModel().gatewayCustomBgpIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 Boolean enablePrivateLinkFastPath() { + return this.innerModel().enablePrivateLinkFastPath(); + } + + 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/VirtualNetworkGatewayConnectionPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionPropertiesFormatImpl.java new file mode 100644 index 0000000000000..6e564ce2d1609 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionPropertiesFormatImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionPropertiesFormatInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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.TrafficSelectorPolicy; +import com.azure.resourcemanager.network.generated.models.TunnelConnectionHealth; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionPropertiesFormat; +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; + +public final class VirtualNetworkGatewayConnectionPropertiesFormatImpl + implements VirtualNetworkGatewayConnectionPropertiesFormat { + private VirtualNetworkGatewayConnectionPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualNetworkGatewayConnectionPropertiesFormatImpl( + VirtualNetworkGatewayConnectionPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 List gatewayCustomBgpIpAddresses() { + List inner = this.innerModel().gatewayCustomBgpIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 Boolean enablePrivateLinkFastPath() { + return this.innerModel().enablePrivateLinkFastPath(); + } + + public VirtualNetworkGatewayConnectionPropertiesFormatInner 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..5d5ad4507ecad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsClientImpl.java @@ -0,0 +1,2874 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters) { + return this.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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, + VirtualNetworkGatewayConnectionInner parameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, 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) + public VirtualNetworkGatewayConnectionInner getByResourceGroup(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE) + .getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, + String virtualNetworkGatewayConnectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters) { + return this.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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayConnectionInner> + beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayConnectionName, TagsObject parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters) { + return this.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 the {@link SyncPoller} for polling of response for GetConnectionSharedKey API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionSharedKeyInner> beginSetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionSharedKeyInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSharedKeyAsync(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSharedKeyWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, Context context) { + return getSharedKeyWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, 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) + public ConnectionSharedKeyInner getSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getSharedKeyWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, + ConnectionResetSharedKeyInner parameters) { + return this.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 {@link SyncPoller} for polling of the virtual network connection reset shared key. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionResetSharedKeyInner> beginResetSharedKey( + String resourceGroupName, String virtualNetworkGatewayConnectionName, ConnectionResetSharedKeyInner parameters, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, String> beginStartPacketCaptureAsync(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + final VpnPacketCaptureStartParameters parameters = null; + Mono>> mono + = startPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + final VpnPacketCaptureStartParameters parameters = null; + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnPacketCaptureStartParameters parameters, Context context) { + return this + .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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnPacketCaptureStopParameters parameters, Context context) { + return this + .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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas(String resourceGroupName, + String virtualNetworkGatewayConnectionName, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection(String resourceGroupName, + String virtualNetworkGatewayConnectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection(String resourceGroupName, + String virtualNetworkGatewayConnectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGatewayConnections API service call along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..34a754fe68929 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayConnectionsImpl.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.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; + +public final class VirtualNetworkGatewayConnectionsImpl implements VirtualNetworkGatewayConnections { + private static 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 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 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 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new VirtualNetworkGatewayConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.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) { + 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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayConnectionName = ResourceManagerUtils.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..ca5134eab5541 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayImpl.java @@ -0,0 +1,591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.AdminState; +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.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.ResiliencyModel; +import com.azure.resourcemanager.network.generated.models.TagsObject; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayNatRule; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayPolicyGroup; +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 ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public String id() { + return this.innerModel().id(); + } + + public VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration() { + return this.innerModel().autoScaleConfiguration(); + } + + 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 Boolean disableIpSecReplayProtection() { + return this.innerModel().disableIpSecReplayProtection(); + } + + public SubResource gatewayDefaultSite() { + return this.innerModel().gatewayDefaultSite(); + } + + public VirtualNetworkGatewaySku sku() { + return this.innerModel().sku(); + } + + public VpnClientConfiguration vpnClientConfiguration() { + return this.innerModel().vpnClientConfiguration(); + } + + public List virtualNetworkGatewayPolicyGroups() { + List inner = this.innerModel().virtualNetworkGatewayPolicyGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 Boolean allowVirtualWanTraffic() { + return this.innerModel().allowVirtualWanTraffic(); + } + + public Boolean allowRemoteVnetTraffic() { + return this.innerModel().allowRemoteVnetTraffic(); + } + + public AdminState adminState() { + return this.innerModel().adminState(); + } + + public ResiliencyModel resiliencyModel() { + return this.innerModel().resiliencyModel(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName + = ResourceManagerUtils.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() { + 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() { + return serviceManager.virtualNetworkGateways().getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName); + } + + public BgpPeerStatusListResult getBgpPeerStatus(String peer, Context context) { + return serviceManager.virtualNetworkGateways() + .getBgpPeerStatus(resourceGroupName, virtualNetworkGatewayName, peer, context); + } + + public Response supportedVpnDevicesWithResponse(Context context) { + return serviceManager.virtualNetworkGateways() + .supportedVpnDevicesWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String supportedVpnDevices() { + return serviceManager.virtualNetworkGateways() + .supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName); + } + + 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() { + 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 withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public VirtualNetworkGatewayImpl + withAutoScaleConfiguration(VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration) { + this.innerModel().withAutoScaleConfiguration(autoScaleConfiguration); + 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 withDisableIpSecReplayProtection(Boolean disableIpSecReplayProtection) { + this.innerModel().withDisableIpSecReplayProtection(disableIpSecReplayProtection); + 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 withVirtualNetworkGatewayPolicyGroups( + List virtualNetworkGatewayPolicyGroups) { + this.innerModel().withVirtualNetworkGatewayPolicyGroups(virtualNetworkGatewayPolicyGroups); + 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; + } + + public VirtualNetworkGatewayImpl withAllowVirtualWanTraffic(Boolean allowVirtualWanTraffic) { + this.innerModel().withAllowVirtualWanTraffic(allowVirtualWanTraffic); + return this; + } + + public VirtualNetworkGatewayImpl withAllowRemoteVnetTraffic(Boolean allowRemoteVnetTraffic) { + this.innerModel().withAllowRemoteVnetTraffic(allowRemoteVnetTraffic); + return this; + } + + public VirtualNetworkGatewayImpl withAdminState(AdminState adminState) { + this.innerModel().withAdminState(adminState); + return this; + } + + public VirtualNetworkGatewayImpl withResiliencyModel(ResiliencyModel resiliencyModel) { + this.innerModel().withResiliencyModel(resiliencyModel); + 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..158a225c1ea81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRuleImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkGatewayName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualNetworkGateways"); + this.natRuleName = ResourceManagerUtils.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..882453d731d4b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesClientImpl.java @@ -0,0 +1,973 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualNetworkGatewayName, + String natRuleName) { + return getWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String virtualNetworkGatewayName, String natRuleName, Context context) { + return getWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, virtualNetworkGatewayName, natRuleName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters) { + return this + .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 the {@link SyncPoller} for polling of virtualNetworkGatewayNatRule Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayNatRuleInner> + beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, String natRuleName, + VirtualNetworkGatewayNatRuleInner natRuleParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkGatewayName, + String natRuleName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkGatewayName, + String natRuleName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all nat rules to a virtual network gateway along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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..ccd318b5b0071 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewayNatRulesImpl.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.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; + +public final class VirtualNetworkGatewayNatRulesImpl implements VirtualNetworkGatewayNatRules { + private static 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 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 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 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 ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new VirtualNetworkGatewayNatRuleImpl(inner1, this.manager())); + } + + public VirtualNetworkGatewayNatRule getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.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..cccd75fd19643 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysClientImpl.java @@ -0,0 +1,5250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return this.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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String virtualNetworkGatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkGatewayName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, 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) + public VirtualNetworkGatewayInner getByResourceGroup(String resourceGroupName, String virtualNetworkGatewayName) { + return getByResourceGroupWithResponse(resourceGroupName, virtualNetworkGatewayName, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkGatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> + beginUpdateTags(String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters) { + return this.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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> beginUpdateTags( + String resourceGroupName, String virtualNetworkGatewayName, TagsObject parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualNetworkGatewayInner> + beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName) { + final String gatewayVip = null; + Mono>> mono + = resetWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualNetworkGatewayInner.class, VirtualNetworkGatewayInner.class, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> + beginReset(String resourceGroupName, String virtualNetworkGatewayName) { + final String gatewayVip = null; + return this.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 the {@link SyncPoller} for polling of a common class for general resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkGatewayInner> + beginReset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetVpnClientSharedKey(String resourceGroupName, + String virtualNetworkGatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetVpnClientSharedKey(String resourceGroupName, + String virtualNetworkGatewayName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGeneratevpnclientpackage(String resourceGroupName, + String virtualNetworkGatewayName, VpnClientParameters parameters) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGeneratevpnclientpackage(String resourceGroupName, + String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return this + .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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGenerateVpnProfile(String resourceGroupName, + String virtualNetworkGatewayName, VpnClientParameters parameters) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGenerateVpnProfile(String resourceGroupName, + String virtualNetworkGatewayName, VpnClientParameters parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of pre-generated VPN profile for P2S client of the virtual network + * gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of pre-generated VPN profile for P2S client of the virtual network + * gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of pre-generated VPN profile for P2S client of the virtual network + * gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetVpnProfilePackageUrl(String resourceGroupName, + String virtualNetworkGatewayName) { + return this.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 the {@link SyncPoller} for polling of pre-generated VPN profile for P2S client of the virtual network + * gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetVpnProfilePackageUrl(String resourceGroupName, + String virtualNetworkGatewayName, Context context) { + return this.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 + * on successful completion of {@link Mono}. + */ + @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 + * on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BgpPeerStatusListResultInner> + beginGetBgpPeerStatusAsync(String resourceGroupName, String virtualNetworkGatewayName) { + final String peer = null; + Mono>> mono + = getBgpPeerStatusWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, peer); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BgpPeerStatusListResultInner.class, BgpPeerStatusListResultInner.class, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BgpPeerStatusListResultInner> + beginGetBgpPeerStatus(String resourceGroupName, String virtualNetworkGatewayName) { + final String peer = null; + return this.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 the {@link SyncPoller} for polling of response for list BGP peer status API service call. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BgpPeerStatusListResultInner> beginGetBgpPeerStatus( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono supportedVpnDevicesAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response supportedVpnDevicesWithResponse(String resourceGroupName, String virtualNetworkGatewayName, + Context context) { + return supportedVpnDevicesWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, 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) + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return supportedVpnDevicesWithResponse(resourceGroupName, virtualNetworkGatewayName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> + beginGetLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName) { + return this.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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> + beginGetLearnedRoutes(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> + beginGetAdvertisedRoutes(String resourceGroupName, String virtualNetworkGatewayName, String peer) { + return this.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 the {@link SyncPoller} for polling of list of virtual network gateway routes. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteListResultInner> beginGetAdvertisedRoutes( + String resourceGroupName, String virtualNetworkGatewayName, String peer, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams) { + return this + .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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginSetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, + VpnClientIPsecParametersInner vpnclientIpsecParams, Context context) { + return this + .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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName) { + return this.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 the {@link SyncPoller} for polling of an IPSec parameters for a virtual network gateway P2S connection. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnClientIPsecParametersInner> + beginGetVpnclientIpsecParameters(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return this.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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono vpnDeviceConfigurationScriptAsync(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response vpnDeviceConfigurationScriptWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, Context context) { + return vpnDeviceConfigurationScriptWithResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, + parameters, 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) + public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters) { + return vpnDeviceConfigurationScriptWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, + parameters, Context.NONE).getValue(); + } + + /** + * 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, String> beginStartPacketCaptureAsync(String resourceGroupName, + String virtualNetworkGatewayName) { + final VpnPacketCaptureStartParameters parameters = null; + Mono>> mono + = startPacketCaptureWithResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, + String virtualNetworkGatewayName) { + final VpnPacketCaptureStartParameters parameters = null; + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, + String virtualNetworkGatewayName, VpnPacketCaptureStartParameters parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, + String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, + String virtualNetworkGatewayName, VpnPacketCaptureStopParameters parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vPN client connection health detail per P2S client connection of + * the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealthAsync(String resourceGroupName, String virtualNetworkGatewayName) { + Mono>> mono + = getVpnclientConnectionHealthWithResponseAsync(resourceGroupName, virtualNetworkGatewayName); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), VpnClientConnectionHealthDetailListResultInner.class, + VpnClientConnectionHealthDetailListResultInner.class, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vPN client connection health detail per P2S client connection of + * the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, 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 the {@link SyncPoller} for polling of vPN client connection health detail per P2S client connection of + * the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName) { + return this.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 the {@link SyncPoller} for polling of vPN client connection health detail per P2S client connection of + * the virtual network gateway in the specified resource group. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, VpnClientConnectionHealthDetailListResultInner> + beginGetVpnclientConnectionHealth(String resourceGroupName, String virtualNetworkGatewayName, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request) { + return this + .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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisconnectVirtualNetworkGatewayVpnConnections( + String resourceGroupName, String virtualNetworkGatewayName, P2SVpnConnectionRequest request, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworkGateways API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the VirtualNetworkGatewayListConnections API service call along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @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..1b3a27db34267 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkGatewaysImpl.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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; + +public final class VirtualNetworkGatewaysImpl implements VirtualNetworkGateways { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listConnections(String resourceGroupName, + String virtualNetworkGatewayName) { + PagedIterable inner + = this.serviceClient().listConnections(resourceGroupName, virtualNetworkGatewayName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, + inner1 -> new VirtualNetworkGatewayConnectionListEntityImpl(inner1, this.manager())); + } + + 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) { + 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 Response supportedVpnDevicesWithResponse(String resourceGroupName, String virtualNetworkGatewayName, + Context context) { + return this.serviceClient() + .supportedVpnDevicesWithResponse(resourceGroupName, virtualNetworkGatewayName, context); + } + + public String supportedVpnDevices(String resourceGroupName, String virtualNetworkGatewayName) { + return this.serviceClient().supportedVpnDevices(resourceGroupName, virtualNetworkGatewayName); + } + + 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 Response vpnDeviceConfigurationScriptWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, Context context) { + return this.serviceClient() + .vpnDeviceConfigurationScriptWithResponse(resourceGroupName, virtualNetworkGatewayConnectionName, + parameters, context); + } + + public String vpnDeviceConfigurationScript(String resourceGroupName, String virtualNetworkGatewayConnectionName, + VpnDeviceScriptParameters parameters) { + return this.serviceClient() + .vpnDeviceConfigurationScript(resourceGroupName, virtualNetworkGatewayConnectionName, 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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkGatewayName = ResourceManagerUtils.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..8caa18e538fb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkImpl.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.management.Region; +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +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.FlowLog; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointVNetPolicies; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.PublicIpDdosProtectionStatusResult; +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.VirtualNetworkEncryption; +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 String id() { + return this.innerModel().id(); + } + + 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 VirtualNetworkEncryption encryption() { + return this.innerModel().encryption(); + } + + public List ipAllocations() { + List inner = this.innerModel().ipAllocations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } 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 PrivateEndpointVNetPolicies privateEndpointVNetPolicies() { + return this.innerModel().privateEndpointVNetPolicies(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = ResourceManagerUtils.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 PagedIterable listDdosProtectionStatus() { + return serviceManager.virtualNetworks().listDdosProtectionStatus(resourceGroupName, virtualNetworkName); + } + + public PagedIterable listDdosProtectionStatus(Integer top, String skipToken, + Context context) { + return serviceManager.virtualNetworks() + .listDdosProtectionStatus(resourceGroupName, virtualNetworkName, top, skipToken, context); + } + + 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 withEncryption(VirtualNetworkEncryption encryption) { + this.innerModel().withEncryption(encryption); + return this; + } + + public VirtualNetworkImpl withIpAllocations(List ipAllocations) { + this.innerModel().withIpAllocations(ipAllocations); + return this; + } + + public VirtualNetworkImpl withPrivateEndpointVNetPolicies(PrivateEndpointVNetPolicies privateEndpointVNetPolicies) { + this.innerModel().withPrivateEndpointVNetPolicies(privateEndpointVNetPolicies); + 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..1d1c0f70c645c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.VirtualNetworkEncryption; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeering; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringLevel; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkPeeringState; +import java.util.Collections; +import java.util.List; + +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 localAddressSpace() { + return this.innerModel().localAddressSpace(); + } + + public AddressSpace localVirtualNetworkAddressSpace() { + return this.innerModel().localVirtualNetworkAddressSpace(); + } + + public AddressSpace remoteAddressSpace() { + return this.innerModel().remoteAddressSpace(); + } + + public AddressSpace remoteVirtualNetworkAddressSpace() { + return this.innerModel().remoteVirtualNetworkAddressSpace(); + } + + public VirtualNetworkBgpCommunities remoteBgpCommunities() { + return this.innerModel().remoteBgpCommunities(); + } + + public VirtualNetworkEncryption remoteVirtualNetworkEncryption() { + return this.innerModel().remoteVirtualNetworkEncryption(); + } + + 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 Boolean peerCompleteVnets() { + return this.innerModel().peerCompleteVnets(); + } + + public Boolean enableOnlyIPv6Peering() { + return this.innerModel().enableOnlyIPv6Peering(); + } + + public List localSubnetNames() { + List inner = this.innerModel().localSubnetNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List remoteSubnetNames() { + List inner = this.innerModel().remoteSubnetNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualNetworks"); + this.virtualNetworkPeeringName + = ResourceManagerUtils.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 withLocalAddressSpace(AddressSpace localAddressSpace) { + this.innerModel().withLocalAddressSpace(localAddressSpace); + return this; + } + + public VirtualNetworkPeeringImpl withLocalVirtualNetworkAddressSpace(AddressSpace localVirtualNetworkAddressSpace) { + this.innerModel().withLocalVirtualNetworkAddressSpace(localVirtualNetworkAddressSpace); + 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 withPeerCompleteVnets(Boolean peerCompleteVnets) { + this.innerModel().withPeerCompleteVnets(peerCompleteVnets); + return this; + } + + public VirtualNetworkPeeringImpl withEnableOnlyIPv6Peering(Boolean enableOnlyIPv6Peering) { + this.innerModel().withEnableOnlyIPv6Peering(enableOnlyIPv6Peering); + return this; + } + + public VirtualNetworkPeeringImpl withLocalSubnetNames(List localSubnetNames) { + this.innerModel().withLocalSubnetNames(localSubnetNames); + return this; + } + + public VirtualNetworkPeeringImpl withRemoteSubnetNames(List remoteSubnetNames) { + this.innerModel().withRemoteSubnetNames(remoteSubnetNames); + 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..8c8b5a5eb5a6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsClientImpl.java @@ -0,0 +1,1054 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, + String virtualNetworkPeeringName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, + String virtualNetworkPeeringName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualNetworkName, + String virtualNetworkPeeringName) { + return getWithResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String virtualNetworkName, + String virtualNetworkPeeringName, Context context) { + return getWithResponseAsync(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) + public VirtualNetworkPeeringInner get(String resourceGroupName, String virtualNetworkName, + String virtualNetworkPeeringName) { + return getWithResponse(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VirtualNetworkPeeringInner> beginCreateOrUpdateAsync( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + final SyncRemoteAddressSpace syncRemoteAddressSpace = null; + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, virtualNetworkName, + virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), VirtualNetworkPeeringInner.class, VirtualNetworkPeeringInner.class, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + final SyncRemoteAddressSpace syncRemoteAddressSpace = null; + return this + .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 the {@link SyncPoller} for polling of peerings in a virtual network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, + VirtualNetworkPeeringInner virtualNetworkPeeringParameters, SyncRemoteAddressSpace syncRemoteAddressSpace, + Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListSubnets API service call along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..53a70f52807f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkPeeringsImpl.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.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; + +public final class VirtualNetworkPeeringsImpl implements VirtualNetworkPeerings { + private static 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 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 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 PagedIterable list(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, virtualNetworkName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkPeeringImpl(inner1, this.manager())); + } + + public VirtualNetworkPeering getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.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..0e35d5ac70f4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.tapName = ResourceManagerUtils.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/VirtualNetworkTapPropertiesFormatImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapPropertiesFormatImpl.java new file mode 100644 index 0000000000000..16e887d25b680 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapPropertiesFormatImpl.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.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.VirtualNetworkTapPropertiesFormatInner; +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.VirtualNetworkTapPropertiesFormat; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualNetworkTapPropertiesFormatImpl implements VirtualNetworkTapPropertiesFormat { + private VirtualNetworkTapPropertiesFormatInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager serviceManager; + + VirtualNetworkTapPropertiesFormatImpl(VirtualNetworkTapPropertiesFormatInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + 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 VirtualNetworkTapPropertiesFormatInner 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/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..db390ba2235f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsClientImpl.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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String tapName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String tapName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String tapName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, tapName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String tapName, + Context context) { + return getByResourceGroupWithResponseAsync(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) + public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) { + return getByResourceGroupWithResponse(resourceGroupName, tapName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkTapInner> + beginCreateOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) { + return this.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 the {@link SyncPoller} for polling of virtual Network Tap resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkTapInner> beginCreateOrUpdate( + String resourceGroupName, String tapName, VirtualNetworkTapInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String tapName, + TagsObject tapParameters) { + return updateTagsWithResponseAsync(resourceGroupName, tapName, tapParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String tapName, + TagsObject tapParameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, tapName, tapParameters, 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) + public VirtualNetworkTapInner updateTags(String resourceGroupName, String tapName, TagsObject tapParameters) { + return updateTagsWithResponse(resourceGroupName, tapName, tapParameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualNetworkTap API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualNetworkTap API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListVirtualNetworkTap API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..5d5913112261f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkTapsImpl.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.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; + +public final class VirtualNetworkTapsImpl implements VirtualNetworkTaps { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkTapImpl(inner1, this.manager())); + } + + public VirtualNetworkTap getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String tapName = ResourceManagerUtils.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..5a2ff6a18c2cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworkUsageImpl.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.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..1cdeea8c375d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksClientImpl.java @@ -0,0 +1,1862 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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.PublicIpDdosProtectionStatusResultInner; +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.VirtualNetworkDdosProtectionStatusResult; +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 { + /** + * 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") + public 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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listDdosProtectionStatus(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("virtualNetworkName") String virtualNetworkName, @QueryParam("top") Integer top, + @QueryParam("skipToken") String skipToken, @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); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDdosProtectionStatusNext( + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualNetworkName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualNetworkName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualNetworkName, expand, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 getByResourceGroupWithResponse(resourceGroupName, virtualNetworkName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkInner> + beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return this.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 the {@link SyncPoller} for polling of virtual Network resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualNetworkInner> beginCreateOrUpdate( + String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String virtualNetworkName, + TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, virtualNetworkName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String virtualNetworkName, + TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(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) + public VirtualNetworkInner updateTags(String resourceGroupName, String virtualNetworkName, TagsObject parameters) { + return updateTagsWithResponse(resourceGroupName, virtualNetworkName, parameters, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkIpAddressAvailabilityAsync(String resourceGroupName, + String virtualNetworkName, String ipAddress) { + return checkIpAddressAvailabilityWithResponseAsync(resourceGroupName, virtualNetworkName, ipAddress) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkIpAddressAvailabilityWithResponse(String resourceGroupName, + String virtualNetworkName, String ipAddress, Context context) { + return checkIpAddressAvailabilityWithResponseAsync(resourceGroupName, virtualNetworkName, ipAddress, context) + .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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 checkIpAddressAvailabilityWithResponse(resourceGroupName, virtualNetworkName, ipAddress, Context.NONE) + .getValue(); + } + + /** + * 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUsage(String resourceGroupName, String virtualNetworkName, + Context context) { + return new PagedIterable<>(listUsageAsync(resourceGroupName, virtualNetworkName, context)); + } + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDdosProtectionStatusSinglePageAsync( + String resourceGroupName, String virtualNetworkName, Integer top, String skipToken) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> { + Mono>> mono = service + .listDdosProtectionStatus(this.client.getEndpoint(), resourceGroupName, virtualNetworkName, top, + skipToken, apiVersion, this.client.getSubscriptionId(), accept, context) + .cache(); + return Mono.zip(mono, + this.client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualNetworkDdosProtectionStatusResult.class, + VirtualNetworkDdosProtectionStatusResult.class, this.client.getContext()) + .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())); + } + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDdosProtectionStatusSinglePageAsync( + String resourceGroupName, String virtualNetworkName, Integer top, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + Mono>> mono = service + .listDdosProtectionStatus(this.client.getEndpoint(), resourceGroupName, virtualNetworkName, top, skipToken, + apiVersion, this.client.getSubscriptionId(), accept, context) + .cache(); + return Mono + .zip(mono, + this.client + .getLroResult( + mono, this.client.getHttpPipeline(), VirtualNetworkDdosProtectionStatusResult.class, + VirtualNetworkDdosProtectionStatusResult.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)); + } + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDdosProtectionStatusAsync(String resourceGroupName, + String virtualNetworkName, Integer top, String skipToken) { + return new PagedFlux<>( + () -> listDdosProtectionStatusSinglePageAsync(resourceGroupName, virtualNetworkName, top, skipToken), + nextLink -> listDdosProtectionStatusNextSinglePageAsync(nextLink)); + } + + /** + * Gets the Ddos Protection Status of all IP Addresses under the 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 Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDdosProtectionStatusAsync(String resourceGroupName, + String virtualNetworkName) { + final Integer top = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listDdosProtectionStatusSinglePageAsync(resourceGroupName, virtualNetworkName, top, skipToken), + nextLink -> listDdosProtectionStatusNextSinglePageAsync(nextLink)); + } + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listDdosProtectionStatusAsync(String resourceGroupName, + String virtualNetworkName, Integer top, String skipToken, Context context) { + return new PagedFlux<>(() -> listDdosProtectionStatusSinglePageAsync(resourceGroupName, virtualNetworkName, top, + skipToken, context), nextLink -> listDdosProtectionStatusNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the Ddos Protection Status of all IP Addresses under the 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 Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName) { + final Integer top = null; + final String skipToken = null; + return new PagedIterable<>( + listDdosProtectionStatusAsync(resourceGroupName, virtualNetworkName, top, skipToken)); + } + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName, Integer top, String skipToken, Context context) { + return new PagedIterable<>( + listDdosProtectionStatusAsync(resourceGroupName, virtualNetworkName, top, skipToken, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworks API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworks API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the ListVirtualNetworks API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for the virtual networks GetUsage API service call along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetVirtualNetworkDdosProtectionStatusOperation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listDdosProtectionStatusNextSinglePageAsync(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.listDdosProtectionStatusNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for GetVirtualNetworkDdosProtectionStatusOperation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listDdosProtectionStatusNextSinglePageAsync(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.listDdosProtectionStatusNext(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..e65b9e8fb6472 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualNetworksImpl.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.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.PublicIpDdosProtectionStatusResultInner; +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.PublicIpDdosProtectionStatusResult; +import com.azure.resourcemanager.network.generated.models.VirtualNetwork; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkUsage; +import com.azure.resourcemanager.network.generated.models.VirtualNetworks; + +public final class VirtualNetworksImpl implements VirtualNetworks { + private static 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 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 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 PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkImpl(inner1, this.manager())); + } + + 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 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 PagedIterable listUsage(String resourceGroupName, String virtualNetworkName) { + PagedIterable inner + = this.serviceClient().listUsage(resourceGroupName, virtualNetworkName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualNetworkUsageImpl(inner1, this.manager())); + } + + public PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName) { + PagedIterable inner + = this.serviceClient().listDdosProtectionStatus(resourceGroupName, virtualNetworkName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PublicIpDdosProtectionStatusResultImpl(inner1, this.manager())); + } + + public PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName, Integer top, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .listDdosProtectionStatus(resourceGroupName, virtualNetworkName, top, skipToken, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new PublicIpDdosProtectionStatusResultImpl(inner1, this.manager())); + } + + public VirtualNetwork getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualNetworkName = ResourceManagerUtils.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..bcc67eff8e323 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = ResourceManagerUtils.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..bd4db6376b6ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualRouterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "virtualRouters"); + this.peeringName = ResourceManagerUtils.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..c5f284c2a294b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsClientImpl.java @@ -0,0 +1,940 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualRouterName, + String peeringName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualRouterName, + String peeringName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String virtualRouterName, + String peeringName) { + return getWithResponseAsync(resourceGroupName, virtualRouterName, peeringName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String virtualRouterName, + String peeringName, Context context) { + return getWithResponseAsync(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) + public VirtualRouterPeeringInner get(String resourceGroupName, String virtualRouterName, String peeringName) { + return getWithResponse(resourceGroupName, virtualRouterName, peeringName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { + return this.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 the {@link SyncPoller} for polling of virtual Router Peering resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterPeeringInner> beginCreateOrUpdate( + String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters, + Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..d362a8d5c41d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRouterPeeringsImpl.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.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; + +public final class VirtualRouterPeeringsImpl implements VirtualRouterPeerings { + private static 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 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 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 PagedIterable list(String resourceGroupName, String virtualRouterName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, virtualRouterName); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualRouterPeeringImpl(inner1, this.manager())); + } + + public VirtualRouterPeering getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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 = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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 = ResourceManagerUtils.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..200a987c29438 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersClientImpl.java @@ -0,0 +1,1049 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualRouterName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualRouterName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualRouterName) { + final String expand = null; + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualRouterName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualRouterName, String expand, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualRouterName, expand, context).block(); + } + + /** + * 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 getByResourceGroupWithResponse(resourceGroupName, virtualRouterName, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterInner> beginCreateOrUpdate(String resourceGroupName, + String virtualRouterName, VirtualRouterInner parameters) { + return this.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 the {@link SyncPoller} for polling of virtualRouter Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualRouterInner> beginCreateOrUpdate(String resourceGroupName, + String virtualRouterName, VirtualRouterInner parameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..984beaa7a447f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualRoutersImpl.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.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; + +public final class VirtualRoutersImpl implements VirtualRouters { + private static 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 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 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 PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualRouterImpl(inner1, this.manager())); + } + + public VirtualRouter getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualRouterName = ResourceManagerUtils.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..cb33d06c7db00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanImpl.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.virtualWanName = ResourceManagerUtils.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..a590751ea6634 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWanSecurityProvidersImpl.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.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..a1e94bf5d1675 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansClientImpl.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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String virtualWanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualWanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String virtualWanName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, virtualWanName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, virtualWanName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualWanInner> beginCreateOrUpdate(String resourceGroupName, + String virtualWanName, VirtualWanInner wanParameters) { + return this.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 the {@link SyncPoller} for polling of virtualWAN Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VirtualWanInner> beginCreateOrUpdate(String resourceGroupName, + String virtualWanName, VirtualWanInner wanParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String virtualWanName, + TagsObject wanParameters) { + return updateTagsWithResponseAsync(resourceGroupName, virtualWanName, wanParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String virtualWanName, + TagsObject wanParameters, Context context) { + return updateTagsWithResponseAsync(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) + public VirtualWanInner updateTags(String resourceGroupName, String virtualWanName, TagsObject wanParameters) { + return updateTagsWithResponse(resourceGroupName, virtualWanName, wanParameters, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualWanName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String virtualWanName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VirtualWANs along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..b0d9302213fb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VirtualWansImpl.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.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; + +public final class VirtualWansImpl implements VirtualWans { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VirtualWanImpl(inner1, this.manager())); + } + + public VirtualWan getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String virtualWanName = ResourceManagerUtils.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..2324f91ac9e0e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientConnectionHealthDetailListResultImpl.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.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..c6f978cfe3d82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnClientIPsecParametersImpl.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.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..fb66227830bf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionImpl.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.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..17fd8759af33b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsClientImpl.java @@ -0,0 +1,1552 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String gatewayName, String connectionName) { + return getWithResponseAsync(resourceGroupName, gatewayName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String gatewayName, + String connectionName, Context context) { + return getWithResponseAsync(resourceGroupName, gatewayName, connectionName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, gatewayName, connectionName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnConnectionInner> beginCreateOrUpdate(String resourceGroupName, + String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { + return this.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 the {@link SyncPoller} for polling of vpnConnection Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnConnectionInner> beginCreateOrUpdate(String resourceGroupName, + String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, + String connectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, + String connectionName, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, String> beginStartPacketCaptureAsync(String resourceGroupName, + String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStartParameters parameters = null; + Mono>> mono + = startPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, String gatewayName, + String vpnConnectionName) { + final VpnConnectionPacketCaptureStartParameters parameters = null; + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, String gatewayName, + String vpnConnectionName, VpnConnectionPacketCaptureStartParameters parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, String> beginStopPacketCaptureAsync(String resourceGroupName, + String gatewayName, String vpnConnectionName) { + final VpnConnectionPacketCaptureStopParameters parameters = null; + Mono>> mono + = stopPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, vpnConnectionName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, String gatewayName, + String vpnConnectionName) { + final VpnConnectionPacketCaptureStopParameters parameters = null; + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, String gatewayName, + String vpnConnectionName, VpnConnectionPacketCaptureStopParameters parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..d23ad1208581e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnConnectionsImpl.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.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; + +public final class VpnConnectionsImpl implements VpnConnections { + private static 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 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 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 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) { + 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) { + 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 ResourceManagerUtils.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 ResourceManagerUtils.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..628ec6bd8a1e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 enableBgpRouteTranslationForNat() { + return this.innerModel().enableBgpRouteTranslationForNat(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = ResourceManagerUtils.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(String ipConfigurationId, Context context) { + return serviceManager.vpnGateways().reset(resourceGroupName, gatewayName, ipConfigurationId, context); + } + + 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() { + 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 withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat) { + this.innerModel().withEnableBgpRouteTranslationForNat(enableBgpRouteTranslationForNat); + 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..187e2151d69ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewayNatRuleImpl.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.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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.gatewayName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vpnGateways"); + this.natRuleName = ResourceManagerUtils.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..413a09581e91d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysClientImpl.java @@ -0,0 +1,2105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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("ipConfigurationId") String ipConfigurationId, @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String gatewayName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, gatewayName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, gatewayName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginCreateOrUpdate(String resourceGroupName, + String gatewayName, VpnGatewayInner vpnGatewayParameters) { + return this.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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginCreateOrUpdate(String resourceGroupName, + String gatewayName, VpnGatewayInner vpnGatewayParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginUpdateTags(String resourceGroupName, + String gatewayName, TagsObject vpnGatewayParameters) { + return this.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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginUpdateTags(String resourceGroupName, + String gatewayName, TagsObject vpnGatewayParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String gatewayName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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. + * @param ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync(String resourceGroupName, String gatewayName, + String ipConfigurationId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reset(this.client.getEndpoint(), resourceGroupName, gatewayName, + ipConfigurationId, 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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetWithResponseAsync(String resourceGroupName, String gatewayName, + String ipConfigurationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.reset(this.client.getEndpoint(), resourceGroupName, gatewayName, ipConfigurationId, 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. + * @param ipConfigurationId VpnGateway ipConfigurationId to specify the gateway instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VpnGatewayInner> beginResetAsync(String resourceGroupName, + String gatewayName, String ipConfigurationId) { + Mono>> mono + = resetWithResponseAsync(resourceGroupName, gatewayName, ipConfigurationId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VpnGatewayInner.class, VpnGatewayInner.class, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VpnGatewayInner> beginResetAsync(String resourceGroupName, + String gatewayName) { + final String ipConfigurationId = null; + Mono>> mono + = resetWithResponseAsync(resourceGroupName, gatewayName, ipConfigurationId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VpnGatewayInner.class, VpnGatewayInner.class, this.client.getContext()); + } + + /** + * 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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VpnGatewayInner> beginResetAsync(String resourceGroupName, + String gatewayName, String ipConfigurationId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = resetWithResponseAsync(resourceGroupName, gatewayName, ipConfigurationId, 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 the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginReset(String resourceGroupName, + String gatewayName) { + final String ipConfigurationId = null; + return this.beginResetAsync(resourceGroupName, gatewayName, ipConfigurationId).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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnGatewayInner> beginReset(String resourceGroupName, + String gatewayName, String ipConfigurationId, Context context) { + return this.beginResetAsync(resourceGroupName, gatewayName, ipConfigurationId, 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. + * @param ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String gatewayName, String ipConfigurationId) { + return beginResetAsync(resourceGroupName, gatewayName, ipConfigurationId).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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String gatewayName) { + final String ipConfigurationId = null; + return beginResetAsync(resourceGroupName, gatewayName, ipConfigurationId).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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAsync(String resourceGroupName, String gatewayName, String ipConfigurationId, + Context context) { + return beginResetAsync(resourceGroupName, gatewayName, ipConfigurationId, 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) { + final String ipConfigurationId = null; + return resetAsync(resourceGroupName, gatewayName, ipConfigurationId).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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VpnGatewayInner reset(String resourceGroupName, String gatewayName, String ipConfigurationId, + Context context) { + return resetAsync(resourceGroupName, gatewayName, ipConfigurationId, 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, String> beginStartPacketCaptureAsync(String resourceGroupName, + String gatewayName) { + final VpnGatewayPacketCaptureStartParameters parameters = null; + Mono>> mono + = startPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, + String gatewayName) { + final VpnGatewayPacketCaptureStartParameters parameters = null; + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStartPacketCapture(String resourceGroupName, String gatewayName, + VpnGatewayPacketCaptureStartParameters parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, String> beginStopPacketCaptureAsync(String resourceGroupName, + String gatewayName) { + final VpnGatewayPacketCaptureStopParameters parameters = null; + Mono>> mono + = stopPacketCaptureWithResponseAsync(resourceGroupName, gatewayName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), String.class, String.class, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, String gatewayName) { + final VpnGatewayPacketCaptureStopParameters parameters = null; + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginStopPacketCapture(String resourceGroupName, String gatewayName, + VpnGatewayPacketCaptureStopParameters parameters, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnGateways along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..94e2aea3a9401 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnGatewaysImpl.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.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; + +public final class VpnGatewaysImpl implements VpnGateways { + private static 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 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 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 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, String ipConfigurationId, Context context) { + VpnGatewayInner inner = this.serviceClient().reset(resourceGroupName, gatewayName, ipConfigurationId, context); + if (inner != null) { + return new VpnGatewayImpl(inner, this.manager()); + } else { + return null; + } + } + + 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) { + 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 ResourceManagerUtils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnGatewayImpl(inner1, this.manager())); + } + + public VpnGateway getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String gatewayName = ResourceManagerUtils.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..397d082f9d36f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsClientImpl.java @@ -0,0 +1,1734 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.network.generated.fluent.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKeyResultList; +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 { + /** + * 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") + public 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" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/sharedKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAllSharedKeys(@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/{linkConnectionName}/sharedKeys/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDefaultSharedKey(@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" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/sharedKeys/default") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setOrInitDefaultSharedKey(@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, + @BodyParam("application/json") ConnectionSharedKeyResultInner connectionSharedKeyParameters, + @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}/sharedKeys/default/listSharedKey") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDefaultSharedKey(@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> getAllSharedKeysNext( + @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> 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginResetConnection(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context) { + return this + .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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 all shared keys of 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 list of shared keys for the vpn link connection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAllSharedKeysSinglePageAsync( + 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAllSharedKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, gatewayName, connectionName, linkConnectionName, 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 shared keys of 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 list of shared keys for the vpn link connection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAllSharedKeysSinglePageAsync( + 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAllSharedKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + gatewayName, connectionName, linkConnectionName, apiVersion, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAllSharedKeysAsync(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName) { + return new PagedFlux<>( + () -> getAllSharedKeysSinglePageAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName), + nextLink -> getAllSharedKeysNextSinglePageAsync(nextLink)); + } + + /** + * Lists all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux getAllSharedKeysAsync(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, Context context) { + return new PagedFlux<>(() -> getAllSharedKeysSinglePageAsync(resourceGroupName, gatewayName, connectionName, + linkConnectionName, context), nextLink -> getAllSharedKeysNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return new PagedIterable<>( + getAllSharedKeysAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName)); + } + + /** + * Lists all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context) { + return new PagedIterable<>( + getAllSharedKeysAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, context)); + } + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDefaultSharedKeyWithResponseAsync( + 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getDefaultSharedKey(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, gatewayName, connectionName, linkConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDefaultSharedKeyWithResponseAsync( + 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getDefaultSharedKey(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, gatewayName, connectionName, linkConnectionName, apiVersion, accept, context); + } + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDefaultSharedKeyAsync(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return getDefaultSharedKeyWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDefaultSharedKeyWithResponse(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, Context context) { + return getDefaultSharedKeyWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + context).block(); + } + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyResultInner getDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return getDefaultSharedKeyWithResponse(resourceGroupName, gatewayName, connectionName, linkConnectionName, + Context.NONE).getValue(); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setOrInitDefaultSharedKeyWithResponseAsync(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, + ConnectionSharedKeyResultInner connectionSharedKeyParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.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.")); + } + if (connectionSharedKeyParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter connectionSharedKeyParameters is required and cannot be null.")); + } else { + connectionSharedKeyParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setOrInitDefaultSharedKey(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, gatewayName, connectionName, linkConnectionName, + apiVersion, connectionSharedKeyParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setOrInitDefaultSharedKeyWithResponseAsync(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, + ConnectionSharedKeyResultInner connectionSharedKeyParameters, 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.")); + } + if (connectionSharedKeyParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter connectionSharedKeyParameters is required and cannot be null.")); + } else { + connectionSharedKeyParameters.validate(); + } + final String apiVersion = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.setOrInitDefaultSharedKey(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, gatewayName, connectionName, linkConnectionName, apiVersion, + connectionSharedKeyParameters, accept, context); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 {@link PollerFlux} for polling of sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectionSharedKeyResultInner> + beginSetOrInitDefaultSharedKeyAsync(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters) { + Mono>> mono = setOrInitDefaultSharedKeyWithResponseAsync(resourceGroupName, + gatewayName, connectionName, linkConnectionName, connectionSharedKeyParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConnectionSharedKeyResultInner.class, ConnectionSharedKeyResultInner.class, + this.client.getContext()); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 {@link PollerFlux} for polling of sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectionSharedKeyResultInner> + beginSetOrInitDefaultSharedKeyAsync(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = setOrInitDefaultSharedKeyWithResponseAsync(resourceGroupName, + gatewayName, connectionName, linkConnectionName, connectionSharedKeyParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ConnectionSharedKeyResultInner.class, ConnectionSharedKeyResultInner.class, + context); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 {@link SyncPoller} for polling of sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionSharedKeyResultInner> + beginSetOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters) { + return this + .beginSetOrInitDefaultSharedKeyAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters) + .getSyncPoller(); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 {@link SyncPoller} for polling of sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionSharedKeyResultInner> + beginSetOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters, Context context) { + return this + .beginSetOrInitDefaultSharedKeyAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters, context) + .getSyncPoller(); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setOrInitDefaultSharedKeyAsync(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, + ConnectionSharedKeyResultInner connectionSharedKeyParameters) { + return beginSetOrInitDefaultSharedKeyAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setOrInitDefaultSharedKeyAsync(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, + ConnectionSharedKeyResultInner connectionSharedKeyParameters, Context context) { + return beginSetOrInitDefaultSharedKeyAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyResultInner setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, + ConnectionSharedKeyResultInner connectionSharedKeyParameters) { + return setOrInitDefaultSharedKeyAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters).block(); + } + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyResultInner setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters, + Context context) { + return setOrInitDefaultSharedKeyAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters, context).block(); + } + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDefaultSharedKeyWithResponseAsync( + 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 = "2024-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listDefaultSharedKey(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, gatewayName, connectionName, linkConnectionName, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDefaultSharedKeyWithResponseAsync( + 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 = "2024-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listDefaultSharedKey(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, gatewayName, connectionName, linkConnectionName, apiVersion, accept, context); + } + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listDefaultSharedKeyAsync(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return listDefaultSharedKeyWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listDefaultSharedKeyWithResponse(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, Context context) { + return listDefaultSharedKeyWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName, + context).block(); + } + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionSharedKeyResultInner listDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return listDefaultSharedKeyWithResponse(resourceGroupName, gatewayName, connectionName, linkConnectionName, + Context.NONE).getValue(); + } + + /** + * 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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, String> beginGetIkeSas(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context) { + return this.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 body on successful completion of {@link Mono}. + */ + @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 body on successful completion of {@link Mono}. + */ + @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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of shared keys for the vpn link connection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAllSharedKeysNextSinglePageAsync(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.getAllSharedKeysNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 of shared keys for the vpn link connection along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAllSharedKeysNextSinglePageAsync(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.getAllSharedKeysNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all vpn connections to a virtual wan vpn gateway along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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..daa2cec4b5d75 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnLinkConnectionsImpl.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.VpnLinkConnectionsClient; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyResultInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.ConnectionSharedKeyResult; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnections; +import com.azure.resourcemanager.network.generated.models.VpnSiteLinkConnection; + +public final class VpnLinkConnectionsImpl implements VpnLinkConnections { + private static 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 PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + PagedIterable inner + = this.serviceClient().getAllSharedKeys(resourceGroupName, gatewayName, connectionName, linkConnectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectionSharedKeyResultImpl(inner1, this.manager())); + } + + public PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context) { + PagedIterable inner = this.serviceClient() + .getAllSharedKeys(resourceGroupName, gatewayName, connectionName, linkConnectionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectionSharedKeyResultImpl(inner1, this.manager())); + } + + public Response getDefaultSharedKeyWithResponse(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, Context context) { + Response inner = this.serviceClient() + .getDefaultSharedKeyWithResponse(resourceGroupName, gatewayName, connectionName, linkConnectionName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionSharedKeyResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConnectionSharedKeyResult getDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + ConnectionSharedKeyResultInner inner = this.serviceClient() + .getDefaultSharedKey(resourceGroupName, gatewayName, connectionName, linkConnectionName); + if (inner != null) { + return new ConnectionSharedKeyResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionSharedKeyResult setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, + ConnectionSharedKeyResultInner connectionSharedKeyParameters) { + ConnectionSharedKeyResultInner inner = this.serviceClient() + .setOrInitDefaultSharedKey(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters); + if (inner != null) { + return new ConnectionSharedKeyResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConnectionSharedKeyResult setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters, + Context context) { + ConnectionSharedKeyResultInner inner = this.serviceClient() + .setOrInitDefaultSharedKey(resourceGroupName, gatewayName, connectionName, linkConnectionName, + connectionSharedKeyParameters, context); + if (inner != null) { + return new ConnectionSharedKeyResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listDefaultSharedKeyWithResponse(String resourceGroupName, + String gatewayName, String connectionName, String linkConnectionName, Context context) { + Response inner = this.serviceClient() + .listDefaultSharedKeyWithResponse(resourceGroupName, gatewayName, connectionName, linkConnectionName, + context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionSharedKeyResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConnectionSharedKeyResult listDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + ConnectionSharedKeyResultInner inner = this.serviceClient() + .listDefaultSharedKey(resourceGroupName, gatewayName, connectionName, linkConnectionName); + if (inner != null) { + return new ConnectionSharedKeyResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 ResourceManagerUtils.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 ResourceManagerUtils.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..ce6d076cf5aa3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnProfileResponseImpl.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.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..3a02b98d32a0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationImpl.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.fluent.models.VpnServerConfigurationPolicyGroupInner; +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 com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroup; +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 id() { + return this.innerModel().id(); + } + + 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 List configurationPolicyGroups() { + List inner = this.innerModel().configurationPolicyGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new VpnServerConfigurationPolicyGroupImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String etagPropertiesEtag() { + return this.innerModel().etagPropertiesEtag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnServerConfigurationName + = ResourceManagerUtils.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; + } + + public VpnServerConfigurationImpl + withConfigurationPolicyGroups(List configurationPolicyGroups) { + this.innerModel().withConfigurationPolicyGroups(configurationPolicyGroups); + 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/VpnServerConfigurationPolicyGroupImpl.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationPolicyGroupImpl.java new file mode 100644 index 0000000000000..1bda2bb008661 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationPolicyGroupImpl.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.implementation; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import com.azure.resourcemanager.network.generated.models.ProvisioningState; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroup; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroupMember; +import java.util.Collections; +import java.util.List; + +public final class VpnServerConfigurationPolicyGroupImpl implements VpnServerConfigurationPolicyGroup, + VpnServerConfigurationPolicyGroup.Definition, VpnServerConfigurationPolicyGroup.Update { + private VpnServerConfigurationPolicyGroupInner innerObject; + + private final com.azure.resourcemanager.network.generated.NetworkManager 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 Boolean isDefault() { + return this.innerModel().isDefault(); + } + + public Integer priority() { + return this.innerModel().priority(); + } + + public List policyMembers() { + List inner = this.innerModel().policyMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + public VpnServerConfigurationPolicyGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.network.generated.NetworkManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vpnServerConfigurationName; + + private String configurationPolicyGroupName; + + public VpnServerConfigurationPolicyGroupImpl withExistingVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName) { + this.resourceGroupName = resourceGroupName; + this.vpnServerConfigurationName = vpnServerConfigurationName; + return this; + } + + public VpnServerConfigurationPolicyGroup create() { + this.innerObject = serviceManager.serviceClient() + .getConfigurationPolicyGroups() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + this.innerModel(), Context.NONE); + return this; + } + + public VpnServerConfigurationPolicyGroup create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigurationPolicyGroups() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + this.innerModel(), context); + return this; + } + + VpnServerConfigurationPolicyGroupImpl(String name, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = new VpnServerConfigurationPolicyGroupInner(); + this.serviceManager = serviceManager; + this.configurationPolicyGroupName = name; + } + + public VpnServerConfigurationPolicyGroupImpl update() { + return this; + } + + public VpnServerConfigurationPolicyGroup apply() { + this.innerObject = serviceManager.serviceClient() + .getConfigurationPolicyGroups() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + this.innerModel(), Context.NONE); + return this; + } + + public VpnServerConfigurationPolicyGroup apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigurationPolicyGroups() + .createOrUpdate(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, + this.innerModel(), context); + return this; + } + + VpnServerConfigurationPolicyGroupImpl(VpnServerConfigurationPolicyGroupInner innerObject, + com.azure.resourcemanager.network.generated.NetworkManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnServerConfigurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vpnServerConfigurations"); + this.configurationPolicyGroupName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "configurationPolicyGroups"); + } + + public VpnServerConfigurationPolicyGroup refresh() { + this.innerObject = serviceManager.serviceClient() + .getConfigurationPolicyGroups() + .getWithResponse(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, Context.NONE) + .getValue(); + return this; + } + + public VpnServerConfigurationPolicyGroup refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConfigurationPolicyGroups() + .getWithResponse(resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, context) + .getValue(); + return this; + } + + public VpnServerConfigurationPolicyGroupImpl withName(String name) { + this.innerModel().withName(name); + return this; + } + + public VpnServerConfigurationPolicyGroupImpl withIsDefault(Boolean isDefault) { + this.innerModel().withIsDefault(isDefault); + return this; + } + + public VpnServerConfigurationPolicyGroupImpl withPriority(Integer priority) { + this.innerModel().withPriority(priority); + return this; + } + + public VpnServerConfigurationPolicyGroupImpl + withPolicyMembers(List policyMembers) { + this.innerModel().withPolicyMembers(policyMembers); + return this; + } +} 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..b7891891879bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansClientImpl.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.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.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 { + /** + * 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") + public 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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationsResponseInner> + beginList(String resourceGroupName, String virtualWanName) { + return this.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 the {@link SyncPoller} for polling of vpnServerConfigurations list associated with VirtualWan Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationsResponseInner> + beginList(String resourceGroupName, String virtualWanName, Context context) { + return this.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 on successful completion of + * {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @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..202d04527d9ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsAssociatedWithVirtualWansImpl.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.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; + +public final class VpnServerConfigurationsAssociatedWithVirtualWansImpl + implements VpnServerConfigurationsAssociatedWithVirtualWans { + private static 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..2dc25c8d6ea47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsClientImpl.java @@ -0,0 +1,1234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String vpnServerConfigurationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnServerConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String vpnServerConfigurationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnServerConfigurationName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, vpnServerConfigurationName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters) { + return this + .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 the {@link SyncPoller} for polling of vpnServerConfiguration Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnServerConfigurationInner> beginCreateOrUpdate( + String resourceGroupName, String vpnServerConfigurationName, + VpnServerConfigurationInner vpnServerConfigurationParameters, Context context) { + return this + .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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, + String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters) { + return updateTagsWithResponseAsync(resourceGroupName, vpnServerConfigurationName, + vpnServerConfigurationParameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, + String vpnServerConfigurationName, TagsObject vpnServerConfigurationParameters, Context context) { + return updateTagsWithResponseAsync(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) + public VpnServerConfigurationInner updateTags(String resourceGroupName, String vpnServerConfigurationName, + TagsObject vpnServerConfigurationParameters) { + return updateTagsWithResponse(resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters, + Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnServerConfigurationName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnServerConfigurationName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list all VpnServerConfigurations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..f6bdf25357804 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsImpl.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.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; + +public final class VpnServerConfigurationsImpl implements VpnServerConfigurations { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnServerConfigurationImpl(inner1, this.manager())); + } + + public VpnServerConfiguration getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnServerConfigurationName = ResourceManagerUtils.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..8e71ea296db66 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnServerConfigurationsResponseImpl.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.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..5d355a9ae416c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteImpl.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.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 String id() { + return this.innerModel().id(); + } + + 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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vpnSiteName = ResourceManagerUtils.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..3450b6b6a22aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionImpl.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +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 List vpnGatewayCustomBgpAddresses() { + List inner = this.innerModel().vpnGatewayCustomBgpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + 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 Integer dpdTimeoutSeconds() { + return this.innerModel().dpdTimeoutSeconds(); + } + + 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..c1bec751d873f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsClientImpl.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.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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName) { + return getWithResponseAsync(resourceGroupName, gatewayName, connectionName, linkConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @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(); + } + + /** + * 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 getWithResponse(resourceGroupName, gatewayName, connectionName, linkConnectionName, Context.NONE) + .getValue(); + } +} 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..00eb61d974bcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinkConnectionsImpl.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.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; + +public final class VpnSiteLinkConnectionsImpl implements VpnSiteLinkConnections { + private static 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 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; + } + } + + 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; + } + } + + 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..b780fedf2ec89 --- /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..4afe69bd66869 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksClientImpl.java @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName) { + return getWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vpnSiteName, + String vpnSiteLinkName, Context context) { + return getWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteLinkName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getWithResponse(resourceGroupName, vpnSiteName, vpnSiteLinkName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSiteLinks along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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..02c394ad56e57 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSiteLinksImpl.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.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; + +public final class VpnSiteLinksImpl implements VpnSiteLinks { + private static 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 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 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 PagedIterable listByVpnSite(String resourceGroupName, String vpnSiteName) { + PagedIterable inner = this.serviceClient().listByVpnSite(resourceGroupName, vpnSiteName); + return ResourceManagerUtils.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 ResourceManagerUtils.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..adcf96ab08c31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesClientImpl.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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnSiteName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String vpnSiteName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, vpnSiteName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, vpnSiteName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 the {@link PollerFlux} for polling of vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnSiteInner> beginCreateOrUpdate(String resourceGroupName, + String vpnSiteName, VpnSiteInner vpnSiteParameters) { + return this.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 the {@link SyncPoller} for polling of vpnSite Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VpnSiteInner> beginCreateOrUpdate(String resourceGroupName, + String vpnSiteName, VpnSiteInner vpnSiteParameters, Context context) { + return this.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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String vpnSiteName, + TagsObject vpnSiteParameters) { + return updateTagsWithResponseAsync(resourceGroupName, vpnSiteName, vpnSiteParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse(String resourceGroupName, String vpnSiteName, + TagsObject vpnSiteParameters, Context context) { + return updateTagsWithResponseAsync(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) + public VpnSiteInner updateTags(String resourceGroupName, String vpnSiteName, TagsObject vpnSiteParameters) { + return updateTagsWithResponse(resourceGroupName, vpnSiteName, vpnSiteParameters, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnSiteName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String vpnSiteName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list VpnSites along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/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..bf8dd45f2d57d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsClientImpl.java @@ -0,0 +1,306 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDownload(String resourceGroupName, String virtualWanName, + GetVpnSitesConfigurationRequest request) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDownload(String resourceGroupName, String virtualWanName, + GetVpnSitesConfigurationRequest request, Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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..ad6b4efa1b0dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesConfigurationsImpl.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.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; + +public final class VpnSitesConfigurationsImpl implements VpnSitesConfigurations { + private static 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..d905fa14672aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/VpnSitesImpl.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.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; + +public final class VpnSitesImpl implements VpnSites { + private static 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 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 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 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 ResourceManagerUtils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new VpnSiteImpl(inner1, this.manager())); + } + + public VpnSite getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vpnSiteName = ResourceManagerUtils.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..6aabd4e8666ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesClientImpl.java @@ -0,0 +1,952 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 = "2024-03-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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedFlux}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 as paginated response with + * {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String policyName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String policyName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, policyName, context).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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 getByResourceGroupWithResponse(resourceGroupName, policyName, Context.NONE).getValue(); + } + + /** + * 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2024-03-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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String policyName, + WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, policyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String policyName, WebApplicationFirewallPolicyInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, policyName, parameters, 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) + public WebApplicationFirewallPolicyInner createOrUpdate(String resourceGroupName, String policyName, + WebApplicationFirewallPolicyInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, policyName, parameters, Context.NONE).getValue(); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String policyName) { + return this.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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String policyName, + Context context) { + return this.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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list WebApplicationFirewallPolicies along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..fb643970dbfdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPoliciesImpl.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.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; + +public final class WebApplicationFirewallPoliciesImpl implements WebApplicationFirewallPolicies { + private static 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 ResourceManagerUtils.mapPage(inner, + inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new WebApplicationFirewallPolicyImpl(inner1, this.manager())); + } + + 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 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 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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName + = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName + = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName + = ResourceManagerUtils.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 = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String policyName + = ResourceManagerUtils.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..cc0736d8712b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebApplicationFirewallPolicyImpl.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.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.ApplicationGatewayForContainersReferenceDefinition; +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 String id() { + return this.innerModel().id(); + } + + 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 List applicationGatewayForContainers() { + List inner + = this.innerModel().applicationGatewayForContainers(); + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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 = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.policyName = ResourceManagerUtils.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..212361d63ce6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesClientImpl.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 { + /** + * 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") + public 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2024-03-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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String name) { + final String expand = null; + return getWithResponseAsync(name, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String name, String expand, Context context) { + return getWithResponseAsync(name, expand, context).block(); + } + + /** + * 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 getWithResponse(name, expand, Context.NONE).getValue(); + } + + /** + * 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2024-03-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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListAzureWebCategories API service call along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..99e274810594d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/WebCategoriesImpl.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.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; + +public final class WebCategoriesImpl implements WebCategories { + private static 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 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 AzureWebCategory get(String name) { + AzureWebCategoryInner inner = this.serviceClient().get(name); + if (inner != null) { + return new AzureWebCategoryImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureWebCategoryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.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..f42feb07bfd10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/implementation/package-info.java @@ -0,0 +1,9 @@ +// 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..4adc5ea71deaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AadAuthenticationParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AAD Vpn authentication type related parameters. + */ +@Fluent +public final class AadAuthenticationParameters implements JsonSerializable { + /* + * AAD Vpn authentication parameter AAD tenant. + */ + private String aadTenant; + + /* + * AAD Vpn authentication parameter AAD audience. + */ + private String aadAudience; + + /* + * AAD Vpn authentication parameter AAD issuer. + */ + private String aadIssuer; + + /** + * Creates an instance of AadAuthenticationParameters class. + */ + public AadAuthenticationParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("aadTenant", this.aadTenant); + jsonWriter.writeStringField("aadAudience", this.aadAudience); + jsonWriter.writeStringField("aadIssuer", this.aadIssuer); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AadAuthenticationParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AadAuthenticationParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AadAuthenticationParameters. + */ + public static AadAuthenticationParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AadAuthenticationParameters deserializedAadAuthenticationParameters = new AadAuthenticationParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aadTenant".equals(fieldName)) { + deserializedAadAuthenticationParameters.aadTenant = reader.getString(); + } else if ("aadAudience".equals(fieldName)) { + deserializedAadAuthenticationParameters.aadAudience = reader.getString(); + } else if ("aadIssuer".equals(fieldName)) { + deserializedAadAuthenticationParameters.aadIssuer = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAadAuthenticationParameters; + }); + } +} 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..cd177d75eca53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Access.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access to be allowed or denied. + */ +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 a new instance of Access value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Access() { + } + + /** + * Creates or finds a Access from its string representation. + * + * @param name a name to look for. + * @return the corresponding Access. + */ + public static Access fromString(String name) { + return fromString(name, Access.class); + } + + /** + * Gets known Access values. + * + * @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/Action.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Action.java new file mode 100644 index 0000000000000..db1678074ce4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Action.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Action to be taken on a route matching a RouteMap criterion. + */ +@Fluent +public final class Action implements JsonSerializable { + /* + * Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.' + */ + private RouteMapActionType type; + + /* + * List of parameters relevant to the action.For instance if type is drop then parameters has list of prefixes to be + * dropped.If type is add, parameters would have list of ASN numbers to be added + */ + private List parameters; + + /** + * Creates an instance of Action class. + */ + public Action() { + } + + /** + * Get the type property: Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.'. + * + * @return the type value. + */ + public RouteMapActionType type() { + return this.type; + } + + /** + * Set the type property: Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.'. + * + * @param type the type value to set. + * @return the Action object itself. + */ + public Action withType(RouteMapActionType type) { + this.type = type; + return this; + } + + /** + * Get the parameters property: List of parameters relevant to the action.For instance if type is drop then + * parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be + * added. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: List of parameters relevant to the action.For instance if type is drop then + * parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be + * added. + * + * @param parameters the parameters value to set. + * @return the Action object itself. + */ + public Action withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Action from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Action if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Action. + */ + public static Action fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Action deserializedAction = new Action(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAction.type = RouteMapActionType.fromString(reader.getString()); + } else if ("parameters".equals(fieldName)) { + List parameters = reader.readArray(reader1 -> Parameter.fromJson(reader1)); + deserializedAction.parameters = parameters; + } else { + reader.skipChildren(); + } + } + + return deserializedAction; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActionType.java new file mode 100644 index 0000000000000..ba0ebd0978b44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActionType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the action to take on rule match. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value AnomalyScoring for ActionType. + */ + public static final ActionType ANOMALY_SCORING = fromString("AnomalyScoring"); + + /** + * Static value Allow for ActionType. + */ + public static final ActionType ALLOW = fromString("Allow"); + + /** + * Static value Block for ActionType. + */ + public static final ActionType BLOCK = fromString("Block"); + + /** + * Static value Log for ActionType. + */ + public static final ActionType LOG = fromString("Log"); + + /** + * Static value JSChallenge for ActionType. + */ + public static final ActionType JSCHALLENGE = fromString("JSChallenge"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveBaseSecurityAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveBaseSecurityAdminRule.java new file mode 100644 index 0000000000000..607e5d24f86b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveBaseSecurityAdminRule.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Network base admin rule. + */ +@Fluent +public class ActiveBaseSecurityAdminRule implements JsonSerializable { + /* + * Whether the rule is custom or default. + */ + private EffectiveAdminRuleKind kind = EffectiveAdminRuleKind.fromString("ActiveBaseSecurityAdminRule"); + + /* + * Resource ID. + */ + private String id; + + /* + * Deployment time string. + */ + private OffsetDateTime commitTime; + + /* + * Deployment region. + */ + private String region; + + /* + * A description of the security admin configuration. + */ + private String configurationDescription; + + /* + * A description of the rule collection. + */ + private String ruleCollectionDescription; + + /* + * Groups for rule collection + */ + private List ruleCollectionAppliesToGroups; + + /* + * Effective configuration groups. + */ + private List ruleGroups; + + /** + * Creates an instance of ActiveBaseSecurityAdminRule class. + */ + public ActiveBaseSecurityAdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + public EffectiveAdminRuleKind kind() { + return this.kind; + } + + /** + * 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 ActiveBaseSecurityAdminRule object itself. + */ + public ActiveBaseSecurityAdminRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get the commitTime property: Deployment time string. + * + * @return the commitTime value. + */ + public OffsetDateTime commitTime() { + return this.commitTime; + } + + /** + * Set the commitTime property: Deployment time string. + * + * @param commitTime the commitTime value to set. + * @return the ActiveBaseSecurityAdminRule object itself. + */ + public ActiveBaseSecurityAdminRule withCommitTime(OffsetDateTime commitTime) { + this.commitTime = commitTime; + return this; + } + + /** + * Get the region property: Deployment region. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Deployment region. + * + * @param region the region value to set. + * @return the ActiveBaseSecurityAdminRule object itself. + */ + public ActiveBaseSecurityAdminRule withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the configurationDescription property: A description of the security admin configuration. + * + * @return the configurationDescription value. + */ + public String configurationDescription() { + return this.configurationDescription; + } + + /** + * Set the configurationDescription property: A description of the security admin configuration. + * + * @param configurationDescription the configurationDescription value to set. + * @return the ActiveBaseSecurityAdminRule object itself. + */ + public ActiveBaseSecurityAdminRule withConfigurationDescription(String configurationDescription) { + this.configurationDescription = configurationDescription; + return this; + } + + /** + * Get the ruleCollectionDescription property: A description of the rule collection. + * + * @return the ruleCollectionDescription value. + */ + public String ruleCollectionDescription() { + return this.ruleCollectionDescription; + } + + /** + * Set the ruleCollectionDescription property: A description of the rule collection. + * + * @param ruleCollectionDescription the ruleCollectionDescription value to set. + * @return the ActiveBaseSecurityAdminRule object itself. + */ + public ActiveBaseSecurityAdminRule withRuleCollectionDescription(String ruleCollectionDescription) { + this.ruleCollectionDescription = ruleCollectionDescription; + return this; + } + + /** + * Get the ruleCollectionAppliesToGroups property: Groups for rule collection. + * + * @return the ruleCollectionAppliesToGroups value. + */ + public List ruleCollectionAppliesToGroups() { + return this.ruleCollectionAppliesToGroups; + } + + /** + * Set the ruleCollectionAppliesToGroups property: Groups for rule collection. + * + * @param ruleCollectionAppliesToGroups the ruleCollectionAppliesToGroups value to set. + * @return the ActiveBaseSecurityAdminRule object itself. + */ + public ActiveBaseSecurityAdminRule + withRuleCollectionAppliesToGroups(List ruleCollectionAppliesToGroups) { + this.ruleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + return this; + } + + /** + * Get the ruleGroups property: Effective configuration groups. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the ruleGroups property: Effective configuration groups. + * + * @param ruleGroups the ruleGroups value to set. + * @return the ActiveBaseSecurityAdminRule object itself. + */ + public ActiveBaseSecurityAdminRule withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleCollectionAppliesToGroups() != null) { + ruleCollectionAppliesToGroups().forEach(e -> e.validate()); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("commitTime", + this.commitTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.commitTime)); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("configurationDescription", this.configurationDescription); + jsonWriter.writeStringField("ruleCollectionDescription", this.ruleCollectionDescription); + jsonWriter.writeArrayField("ruleCollectionAppliesToGroups", this.ruleCollectionAppliesToGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ruleGroups", this.ruleGroups, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveBaseSecurityAdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveBaseSecurityAdminRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveBaseSecurityAdminRule. + */ + public static ActiveBaseSecurityAdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Custom".equals(discriminatorValue)) { + return ActiveSecurityAdminRule.fromJson(readerToUse.reset()); + } else if ("Default".equals(discriminatorValue)) { + return ActiveDefaultSecurityAdminRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ActiveBaseSecurityAdminRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveBaseSecurityAdminRule deserializedActiveBaseSecurityAdminRule = new ActiveBaseSecurityAdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedActiveBaseSecurityAdminRule.kind + = EffectiveAdminRuleKind.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + deserializedActiveBaseSecurityAdminRule.id = reader.getString(); + } else if ("commitTime".equals(fieldName)) { + deserializedActiveBaseSecurityAdminRule.commitTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("region".equals(fieldName)) { + deserializedActiveBaseSecurityAdminRule.region = reader.getString(); + } else if ("configurationDescription".equals(fieldName)) { + deserializedActiveBaseSecurityAdminRule.configurationDescription = reader.getString(); + } else if ("ruleCollectionDescription".equals(fieldName)) { + deserializedActiveBaseSecurityAdminRule.ruleCollectionDescription = reader.getString(); + } else if ("ruleCollectionAppliesToGroups".equals(fieldName)) { + List ruleCollectionAppliesToGroups + = reader.readArray(reader1 -> NetworkManagerSecurityGroupItem.fromJson(reader1)); + deserializedActiveBaseSecurityAdminRule.ruleCollectionAppliesToGroups + = ruleCollectionAppliesToGroups; + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedActiveBaseSecurityAdminRule.ruleGroups = ruleGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedActiveBaseSecurityAdminRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConfigurationParameter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConfigurationParameter.java new file mode 100644 index 0000000000000..90f8f4e6346e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConfigurationParameter.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Effective Virtual Networks Parameter. + */ +@Fluent +public final class ActiveConfigurationParameter implements JsonSerializable { + /* + * List of regions. + */ + private List regions; + + /* + * When present, the value can be passed to a subsequent query call (together with the same query and scopes used in + * the current request) to retrieve the next page of data. + */ + private String skipToken; + + /** + * Creates an instance of ActiveConfigurationParameter class. + */ + public ActiveConfigurationParameter() { + } + + /** + * Get the regions property: List of regions. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: List of regions. + * + * @param regions the regions value to set. + * @return the ActiveConfigurationParameter object itself. + */ + public ActiveConfigurationParameter withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @param skipToken the skipToken value to set. + * @return the ActiveConfigurationParameter object itself. + */ + public ActiveConfigurationParameter withSkipToken(String skipToken) { + this.skipToken = skipToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveConfigurationParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveConfigurationParameter if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveConfigurationParameter. + */ + public static ActiveConfigurationParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveConfigurationParameter deserializedActiveConfigurationParameter = new ActiveConfigurationParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("regions".equals(fieldName)) { + List regions = reader.readArray(reader1 -> reader1.getString()); + deserializedActiveConfigurationParameter.regions = regions; + } else if ("skipToken".equals(fieldName)) { + deserializedActiveConfigurationParameter.skipToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveConfigurationParameter; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfiguration.java new file mode 100644 index 0000000000000..7eab6410f18fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationProperties; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Active connectivity configuration. + */ +@Fluent +public final class ActiveConnectivityConfiguration extends EffectiveConnectivityConfiguration { + /* + * Deployment time string. + */ + private OffsetDateTime commitTime; + + /* + * Deployment region. + */ + private String region; + + /* + * Properties of a network manager connectivity configuration + */ + private ConnectivityConfigurationProperties innerProperties; + + /** + * Creates an instance of ActiveConnectivityConfiguration class. + */ + public ActiveConnectivityConfiguration() { + } + + /** + * Get the commitTime property: Deployment time string. + * + * @return the commitTime value. + */ + public OffsetDateTime commitTime() { + return this.commitTime; + } + + /** + * Set the commitTime property: Deployment time string. + * + * @param commitTime the commitTime value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withCommitTime(OffsetDateTime commitTime) { + this.commitTime = commitTime; + return this; + } + + /** + * Get the region property: Deployment region. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Deployment region. + * + * @param region the region value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the innerProperties property: Properties of a network manager connectivity configuration. + * + * @return the innerProperties value. + */ + private ConnectivityConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveConnectivityConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveConnectivityConfiguration withConfigurationGroups(List configurationGroups) { + super.withConfigurationGroups(configurationGroups); + return this; + } + + /** + * Get the description property: A description of the connectivity configuration. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the connectivity configuration. + * + * @param description the description value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the connectivityTopology property: Connectivity topology type. + * + * @return the connectivityTopology value. + */ + public ConnectivityTopology connectivityTopology() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityTopology(); + } + + /** + * Set the connectivityTopology property: Connectivity topology type. + * + * @param connectivityTopology the connectivityTopology value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withConnectivityTopology(ConnectivityTopology connectivityTopology) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withConnectivityTopology(connectivityTopology); + return this; + } + + /** + * Get the hubs property: List of hubItems. + * + * @return the hubs value. + */ + public List hubs() { + return this.innerProperties() == null ? null : this.innerProperties().hubs(); + } + + /** + * Set the hubs property: List of hubItems. + * + * @param hubs the hubs value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withHubs(List hubs) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withHubs(hubs); + return this; + } + + /** + * Get the isGlobal property: Flag if global mesh is supported. + * + * @return the isGlobal value. + */ + public IsGlobal isGlobal() { + return this.innerProperties() == null ? null : this.innerProperties().isGlobal(); + } + + /** + * Set the isGlobal property: Flag if global mesh is supported. + * + * @param isGlobal the isGlobal value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withIsGlobal(IsGlobal isGlobal) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withIsGlobal(isGlobal); + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.innerProperties() == null ? null : this.innerProperties().appliesToGroups(); + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withAppliesToGroups(List appliesToGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withAppliesToGroups(appliesToGroups); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the connectivity configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @return the deleteExistingPeering value. + */ + public DeleteExistingPeering deleteExistingPeering() { + return this.innerProperties() == null ? null : this.innerProperties().deleteExistingPeering(); + } + + /** + * Set the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @param deleteExistingPeering the deleteExistingPeering value to set. + * @return the ActiveConnectivityConfiguration object itself. + */ + public ActiveConnectivityConfiguration withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withDeleteExistingPeering(deleteExistingPeering); + return this; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (configurationGroups() != null) { + configurationGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", innerProperties()); + jsonWriter.writeArrayField("configurationGroups", configurationGroups(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("commitTime", + this.commitTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.commitTime)); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveConnectivityConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveConnectivityConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveConnectivityConfiguration. + */ + public static ActiveConnectivityConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveConnectivityConfiguration deserializedActiveConnectivityConfiguration + = new ActiveConnectivityConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActiveConnectivityConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedActiveConnectivityConfiguration.innerProperties + = ConnectivityConfigurationProperties.fromJson(reader); + } else if ("configurationGroups".equals(fieldName)) { + List configurationGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedActiveConnectivityConfiguration.withConfigurationGroups(configurationGroups); + } else if ("commitTime".equals(fieldName)) { + deserializedActiveConnectivityConfiguration.commitTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("region".equals(fieldName)) { + deserializedActiveConnectivityConfiguration.region = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveConnectivityConfiguration; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfigurationsListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfigurationsListResult.java new file mode 100644 index 0000000000000..f34676dddfdd5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveConnectivityConfigurationsListResult.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.resourcemanager.network.generated.fluent.models.ActiveConnectivityConfigurationsListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of ActiveConnectivityConfigurationsListResult. + */ +public interface ActiveConnectivityConfigurationsListResult { + /** + * Gets the value property: Gets a page of active connectivity configurations. + * + * @return the value value. + */ + List value(); + + /** + * Gets the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + String skipToken(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ActiveConnectivityConfigurationsListResultInner object. + * + * @return the inner object. + */ + ActiveConnectivityConfigurationsListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveDefaultSecurityAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveDefaultSecurityAdminRule.java new file mode 100644 index 0000000000000..4803d284c1060 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveDefaultSecurityAdminRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.DefaultAdminPropertiesFormat; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Network default admin rule. + */ +@Fluent +public final class ActiveDefaultSecurityAdminRule extends ActiveBaseSecurityAdminRule { + /* + * Whether the rule is custom or default. + */ + private EffectiveAdminRuleKind kind = EffectiveAdminRuleKind.DEFAULT; + + /* + * Indicates the properties of the default security admin rule + */ + private DefaultAdminPropertiesFormat innerProperties; + + /** + * Creates an instance of ActiveDefaultSecurityAdminRule class. + */ + public ActiveDefaultSecurityAdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + @Override + public EffectiveAdminRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Indicates the properties of the default security admin rule. + * + * @return the innerProperties value. + */ + private DefaultAdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveDefaultSecurityAdminRule withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveDefaultSecurityAdminRule withCommitTime(OffsetDateTime commitTime) { + super.withCommitTime(commitTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveDefaultSecurityAdminRule withRegion(String region) { + super.withRegion(region); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveDefaultSecurityAdminRule withConfigurationDescription(String configurationDescription) { + super.withConfigurationDescription(configurationDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveDefaultSecurityAdminRule withRuleCollectionDescription(String ruleCollectionDescription) { + super.withRuleCollectionDescription(ruleCollectionDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveDefaultSecurityAdminRule + withRuleCollectionAppliesToGroups(List ruleCollectionAppliesToGroups) { + super.withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveDefaultSecurityAdminRule withRuleGroups(List ruleGroups) { + super.withRuleGroups(ruleGroups); + return this; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the flag property: Default rule flag. + * + * @return the flag value. + */ + public String flag() { + return this.innerProperties() == null ? null : this.innerProperties().flag(); + } + + /** + * Set the flag property: Default rule flag. + * + * @param flag the flag value to set. + * @return the ActiveDefaultSecurityAdminRule object itself. + */ + public ActiveDefaultSecurityAdminRule withFlag(String flag) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultAdminPropertiesFormat(); + } + this.innerProperties().withFlag(flag); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.innerProperties() == null ? null : this.innerProperties().sources(); + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.innerProperties() == null ? null : this.innerProperties().destinations(); + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.innerProperties() == null ? null : this.innerProperties().access(); + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.innerProperties() == null ? null : this.innerProperties().direction(); + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (ruleCollectionAppliesToGroups() != null) { + ruleCollectionAppliesToGroups().forEach(e -> e.validate()); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("commitTime", + commitTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(commitTime())); + jsonWriter.writeStringField("region", region()); + jsonWriter.writeStringField("configurationDescription", configurationDescription()); + jsonWriter.writeStringField("ruleCollectionDescription", ruleCollectionDescription()); + jsonWriter.writeArrayField("ruleCollectionAppliesToGroups", ruleCollectionAppliesToGroups(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ruleGroups", ruleGroups(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveDefaultSecurityAdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveDefaultSecurityAdminRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveDefaultSecurityAdminRule. + */ + public static ActiveDefaultSecurityAdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveDefaultSecurityAdminRule deserializedActiveDefaultSecurityAdminRule + = new ActiveDefaultSecurityAdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActiveDefaultSecurityAdminRule.withId(reader.getString()); + } else if ("commitTime".equals(fieldName)) { + deserializedActiveDefaultSecurityAdminRule.withCommitTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("region".equals(fieldName)) { + deserializedActiveDefaultSecurityAdminRule.withRegion(reader.getString()); + } else if ("configurationDescription".equals(fieldName)) { + deserializedActiveDefaultSecurityAdminRule.withConfigurationDescription(reader.getString()); + } else if ("ruleCollectionDescription".equals(fieldName)) { + deserializedActiveDefaultSecurityAdminRule.withRuleCollectionDescription(reader.getString()); + } else if ("ruleCollectionAppliesToGroups".equals(fieldName)) { + List ruleCollectionAppliesToGroups + = reader.readArray(reader1 -> NetworkManagerSecurityGroupItem.fromJson(reader1)); + deserializedActiveDefaultSecurityAdminRule + .withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedActiveDefaultSecurityAdminRule.withRuleGroups(ruleGroups); + } else if ("kind".equals(fieldName)) { + deserializedActiveDefaultSecurityAdminRule.kind + = EffectiveAdminRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedActiveDefaultSecurityAdminRule.innerProperties + = DefaultAdminPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveDefaultSecurityAdminRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRule.java new file mode 100644 index 0000000000000..fddc623e9d97b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRule.java @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AdminPropertiesFormat; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Network admin rule. + */ +@Fluent +public final class ActiveSecurityAdminRule extends ActiveBaseSecurityAdminRule { + /* + * Whether the rule is custom or default. + */ + private EffectiveAdminRuleKind kind = EffectiveAdminRuleKind.CUSTOM; + + /* + * Indicates the properties of the security admin rule + */ + private AdminPropertiesFormat innerProperties; + + /** + * Creates an instance of ActiveSecurityAdminRule class. + */ + public ActiveSecurityAdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + @Override + public EffectiveAdminRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Indicates the properties of the security admin rule. + * + * @return the innerProperties value. + */ + private AdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveSecurityAdminRule withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveSecurityAdminRule withCommitTime(OffsetDateTime commitTime) { + super.withCommitTime(commitTime); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveSecurityAdminRule withRegion(String region) { + super.withRegion(region); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveSecurityAdminRule withConfigurationDescription(String configurationDescription) { + super.withConfigurationDescription(configurationDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveSecurityAdminRule withRuleCollectionDescription(String ruleCollectionDescription) { + super.withRuleCollectionDescription(ruleCollectionDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveSecurityAdminRule + withRuleCollectionAppliesToGroups(List ruleCollectionAppliesToGroups) { + super.withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ActiveSecurityAdminRule withRuleGroups(List ruleGroups) { + super.withRuleGroups(ruleGroups); + return this; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description for this rule. Restricted to 140 chars. + * + * @param description the description value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Set the protocol property: Network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withProtocol(SecurityConfigurationRuleProtocol protocol) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.innerProperties() == null ? null : this.innerProperties().sources(); + } + + /** + * Set the sources property: The CIDR or source IP ranges. + * + * @param sources the sources value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withSources(List sources) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withSources(sources); + return this; + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.innerProperties() == null ? null : this.innerProperties().destinations(); + } + + /** + * Set the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @param destinations the destinations value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withDestinations(List destinations) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDestinations(destinations); + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); + } + + /** + * Set the sourcePortRanges property: The source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withSourcePortRanges(List sourcePortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withSourcePortRanges(sourcePortRanges); + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); + } + + /** + * Set the destinationPortRanges property: The destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withDestinationPortRanges(List destinationPortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDestinationPortRanges(destinationPortRanges); + return this; + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.innerProperties() == null ? null : this.innerProperties().access(); + } + + /** + * Set the access property: Indicates the access allowed for this particular rule. + * + * @param access the access value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withAccess(SecurityConfigurationRuleAccess access) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withAccess(access); + return this; + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the rule. The value can be between 1 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 ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.innerProperties() == null ? null : this.innerProperties().direction(); + } + + /** + * Set the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @param direction the direction value to set. + * @return the ActiveSecurityAdminRule object itself. + */ + public ActiveSecurityAdminRule withDirection(SecurityConfigurationRuleDirection direction) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDirection(direction); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (ruleCollectionAppliesToGroups() != null) { + ruleCollectionAppliesToGroups().forEach(e -> e.validate()); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("commitTime", + commitTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(commitTime())); + jsonWriter.writeStringField("region", region()); + jsonWriter.writeStringField("configurationDescription", configurationDescription()); + jsonWriter.writeStringField("ruleCollectionDescription", ruleCollectionDescription()); + jsonWriter.writeArrayField("ruleCollectionAppliesToGroups", ruleCollectionAppliesToGroups(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ruleGroups", ruleGroups(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveSecurityAdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveSecurityAdminRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ActiveSecurityAdminRule. + */ + public static ActiveSecurityAdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveSecurityAdminRule deserializedActiveSecurityAdminRule = new ActiveSecurityAdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedActiveSecurityAdminRule.withId(reader.getString()); + } else if ("commitTime".equals(fieldName)) { + deserializedActiveSecurityAdminRule.withCommitTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("region".equals(fieldName)) { + deserializedActiveSecurityAdminRule.withRegion(reader.getString()); + } else if ("configurationDescription".equals(fieldName)) { + deserializedActiveSecurityAdminRule.withConfigurationDescription(reader.getString()); + } else if ("ruleCollectionDescription".equals(fieldName)) { + deserializedActiveSecurityAdminRule.withRuleCollectionDescription(reader.getString()); + } else if ("ruleCollectionAppliesToGroups".equals(fieldName)) { + List ruleCollectionAppliesToGroups + = reader.readArray(reader1 -> NetworkManagerSecurityGroupItem.fromJson(reader1)); + deserializedActiveSecurityAdminRule + .withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedActiveSecurityAdminRule.withRuleGroups(ruleGroups); + } else if ("kind".equals(fieldName)) { + deserializedActiveSecurityAdminRule.kind = EffectiveAdminRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedActiveSecurityAdminRule.innerProperties = AdminPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveSecurityAdminRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRulesListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRulesListResult.java new file mode 100644 index 0000000000000..b33b794ce2fc0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ActiveSecurityAdminRulesListResult.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.resourcemanager.network.generated.fluent.models.ActiveSecurityAdminRulesListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of ActiveSecurityAdminRulesListResult. + */ +public interface ActiveSecurityAdminRulesListResult { + /** + * Gets the value property: Gets a page of active security admin rules. + * + * @return the value value. + */ + List value(); + + /** + * Gets the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + String skipToken(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ActiveSecurityAdminRulesListResultInner + * object. + * + * @return the inner object. + */ + ActiveSecurityAdminRulesListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixItem.java new file mode 100644 index 0000000000000..49dadeca884aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixItem.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Address prefix item. + */ +@Fluent +public final class AddressPrefixItem implements JsonSerializable { + /* + * Address prefix. + */ + private String addressPrefix; + + /* + * Address prefix type. + */ + private AddressPrefixType addressPrefixType; + + /** + * Creates an instance of AddressPrefixItem class. + */ + public AddressPrefixItem() { + } + + /** + * 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 AddressPrefixItem object itself. + */ + public AddressPrefixItem withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get the addressPrefixType property: Address prefix type. + * + * @return the addressPrefixType value. + */ + public AddressPrefixType addressPrefixType() { + return this.addressPrefixType; + } + + /** + * Set the addressPrefixType property: Address prefix type. + * + * @param addressPrefixType the addressPrefixType value to set. + * @return the AddressPrefixItem object itself. + */ + public AddressPrefixItem withAddressPrefixType(AddressPrefixType addressPrefixType) { + this.addressPrefixType = addressPrefixType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + jsonWriter.writeStringField("addressPrefixType", + this.addressPrefixType == null ? null : this.addressPrefixType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddressPrefixItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddressPrefixItem if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AddressPrefixItem. + */ + public static AddressPrefixItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddressPrefixItem deserializedAddressPrefixItem = new AddressPrefixItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefix".equals(fieldName)) { + deserializedAddressPrefixItem.addressPrefix = reader.getString(); + } else if ("addressPrefixType".equals(fieldName)) { + deserializedAddressPrefixItem.addressPrefixType = AddressPrefixType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAddressPrefixItem; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixType.java new file mode 100644 index 0000000000000..bc5e6de04b91c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressPrefixType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Address prefix type. + */ +public final class AddressPrefixType extends ExpandableStringEnum { + /** + * Static value IPPrefix for AddressPrefixType. + */ + public static final AddressPrefixType IPPREFIX = fromString("IPPrefix"); + + /** + * Static value ServiceTag for AddressPrefixType. + */ + public static final AddressPrefixType SERVICE_TAG = fromString("ServiceTag"); + + /** + * Creates a new instance of AddressPrefixType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AddressPrefixType() { + } + + /** + * Creates or finds a AddressPrefixType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AddressPrefixType. + */ + public static AddressPrefixType fromString(String name) { + return fromString(name, AddressPrefixType.class); + } + + /** + * Gets known AddressPrefixType values. + * + * @return known AddressPrefixType values. + */ + public static Collection values() { + return values(AddressPrefixType.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..dc081df71e488 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AddressSpace.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * A list of address blocks reserved for this virtual network in CIDR notation. + */ + private List addressPrefixes; + + /** + * Creates an instance of AddressSpace class. + */ + public AddressSpace() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AddressSpace from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AddressSpace if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AddressSpace. + */ + public static AddressSpace fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AddressSpace deserializedAddressSpace = new AddressSpace(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedAddressSpace.addressPrefixes = addressPrefixes; + } else { + reader.skipChildren(); + } + } + + return deserializedAddressSpace; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRule.java new file mode 100644 index 0000000000000..7e92532a05ca9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRule.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AdminPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Network admin rule. + */ +@Fluent +public final class AdminRule extends BaseAdminRuleInner { + /* + * Whether the rule is custom or default. + */ + private AdminRuleKind kind = AdminRuleKind.CUSTOM; + + /* + * Indicates the properties of the security admin rule + */ + private AdminPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AdminRule class. + */ + public AdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + @Override + public AdminRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Indicates the properties of the security admin rule. + * + * @return the innerProperties value. + */ + private AdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description for this rule. Restricted to 140 chars. + * + * @param description the description value to set. + * @return the AdminRule object itself. + */ + public AdminRule withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Set the protocol property: Network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the AdminRule object itself. + */ + public AdminRule withProtocol(SecurityConfigurationRuleProtocol protocol) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.innerProperties() == null ? null : this.innerProperties().sources(); + } + + /** + * Set the sources property: The CIDR or source IP ranges. + * + * @param sources the sources value to set. + * @return the AdminRule object itself. + */ + public AdminRule withSources(List sources) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withSources(sources); + return this; + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.innerProperties() == null ? null : this.innerProperties().destinations(); + } + + /** + * Set the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @param destinations the destinations value to set. + * @return the AdminRule object itself. + */ + public AdminRule withDestinations(List destinations) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDestinations(destinations); + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); + } + + /** + * Set the sourcePortRanges property: The source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the AdminRule object itself. + */ + public AdminRule withSourcePortRanges(List sourcePortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withSourcePortRanges(sourcePortRanges); + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); + } + + /** + * Set the destinationPortRanges property: The destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the AdminRule object itself. + */ + public AdminRule withDestinationPortRanges(List destinationPortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDestinationPortRanges(destinationPortRanges); + return this; + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.innerProperties() == null ? null : this.innerProperties().access(); + } + + /** + * Set the access property: Indicates the access allowed for this particular rule. + * + * @param access the access value to set. + * @return the AdminRule object itself. + */ + public AdminRule withAccess(SecurityConfigurationRuleAccess access) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withAccess(access); + return this; + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the rule. The value can be between 1 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 AdminRule object itself. + */ + public AdminRule withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.innerProperties() == null ? null : this.innerProperties().direction(); + } + + /** + * Set the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @param direction the direction value to set. + * @return the AdminRule object itself. + */ + public AdminRule withDirection(SecurityConfigurationRuleDirection direction) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDirection(direction); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdminRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AdminRule. + */ + public static AdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdminRule deserializedAdminRule = new AdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAdminRule.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAdminRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAdminRule.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAdminRule.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedAdminRule.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedAdminRule.kind = AdminRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAdminRule.innerProperties = AdminPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAdminRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollection.java new file mode 100644 index 0000000000000..4604f7b7eb9f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollection.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.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.AdminRuleCollectionInner; +import java.util.List; + +/** + * An immutable client-side representation of AdminRuleCollection. + */ +public interface AdminRuleCollection { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the admin rule collection. + * + * @return the description value. + */ + String description(); + + /** + * Gets the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + List appliesToGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.AdminRuleCollectionInner object. + * + * @return the inner object. + */ + AdminRuleCollectionInner innerModel(); + + /** + * The entirety of the AdminRuleCollection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The AdminRuleCollection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AdminRuleCollection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AdminRuleCollection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName, configurationName. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @return the next definition stage. + */ + WithCreate withExistingSecurityAdminConfiguration(String resourceGroupName, String networkManagerName, + String configurationName); + } + + /** + * The stage of the AdminRuleCollection 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.WithDescription, DefinitionStages.WithAppliesToGroups { + /** + * Executes the create request. + * + * @return the created resource. + */ + AdminRuleCollection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AdminRuleCollection create(Context context); + } + + /** + * The stage of the AdminRuleCollection definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the admin rule collection.. + * + * @param description A description of the admin rule collection. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the AdminRuleCollection definition allowing to specify appliesToGroups. + */ + interface WithAppliesToGroups { + /** + * Specifies the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups Groups for configuration. + * @return the next definition stage. + */ + WithCreate withAppliesToGroups(List appliesToGroups); + } + } + + /** + * Begins update for the AdminRuleCollection resource. + * + * @return the stage of resource update. + */ + AdminRuleCollection.Update update(); + + /** + * The template for AdminRuleCollection update. + */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithAppliesToGroups { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AdminRuleCollection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AdminRuleCollection apply(Context context); + } + + /** + * The AdminRuleCollection update stages. + */ + interface UpdateStages { + /** + * The stage of the AdminRuleCollection update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the admin rule collection.. + * + * @param description A description of the admin rule collection. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the AdminRuleCollection update allowing to specify appliesToGroups. + */ + interface WithAppliesToGroups { + /** + * Specifies the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups Groups for configuration. + * @return the next definition stage. + */ + Update withAppliesToGroups(List appliesToGroups); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AdminRuleCollection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AdminRuleCollection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollectionListResult.java new file mode 100644 index 0000000000000..ce9d981861b4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AdminRuleCollectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Security admin configuration rule collection list result. + */ +@Fluent +public final class AdminRuleCollectionListResult implements JsonSerializable { + /* + * A list of network manager security admin configuration rule collections + */ + private List value; + + /* + * Gets the URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AdminRuleCollectionListResult class. + */ + public AdminRuleCollectionListResult() { + } + + /** + * Get the value property: A list of network manager security admin configuration rule collections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network manager security admin configuration rule collections. + * + * @param value the value value to set. + * @return the AdminRuleCollectionListResult object itself. + */ + public AdminRuleCollectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the AdminRuleCollectionListResult object itself. + */ + public AdminRuleCollectionListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdminRuleCollectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdminRuleCollectionListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AdminRuleCollectionListResult. + */ + public static AdminRuleCollectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdminRuleCollectionListResult deserializedAdminRuleCollectionListResult + = new AdminRuleCollectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AdminRuleCollectionInner.fromJson(reader1)); + deserializedAdminRuleCollectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAdminRuleCollectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdminRuleCollectionListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollections.java new file mode 100644 index 0000000000000..50848efc42ba2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleCollections.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 AdminRuleCollections. + */ +public interface AdminRuleCollections { + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security admin configuration rule collection list result as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Lists all the rule collections in a security admin configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 admin configuration rule collection list result as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security admin configuration rule collection along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context); + + /** + * Gets a network manager security admin configuration rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security admin configuration rule collection. + */ + AdminRuleCollection get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes an admin rule collection. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context); + + /** + * Gets a network manager security admin configuration rule collection. + * + * @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 network manager security admin configuration rule collection along with {@link Response}. + */ + AdminRuleCollection getById(String id); + + /** + * Gets a network manager security admin configuration rule collection. + * + * @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 network manager security admin configuration rule collection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an admin rule collection. + * + * @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 an admin rule collection. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new AdminRuleCollection resource. + * + * @param name resource name. + * @return the first stage of the new AdminRuleCollection definition. + */ + AdminRuleCollection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleKind.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleKind.java new file mode 100644 index 0000000000000..3ce4c7f953f4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleKind.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether the rule is custom or default. + */ +public final class AdminRuleKind extends ExpandableStringEnum { + /** + * Static value Custom for AdminRuleKind. + */ + public static final AdminRuleKind CUSTOM = fromString("Custom"); + + /** + * Static value Default for AdminRuleKind. + */ + public static final AdminRuleKind DEFAULT = fromString("Default"); + + /** + * Creates a new instance of AdminRuleKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdminRuleKind() { + } + + /** + * Creates or finds a AdminRuleKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdminRuleKind. + */ + public static AdminRuleKind fromString(String name) { + return fromString(name, AdminRuleKind.class); + } + + /** + * Gets known AdminRuleKind values. + * + * @return known AdminRuleKind values. + */ + public static Collection values() { + return values(AdminRuleKind.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleListResult.java new file mode 100644 index 0000000000000..c371dedfff956 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRuleListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * security configuration admin rule list result. + */ +@Fluent +public final class AdminRuleListResult implements JsonSerializable { + /* + * A list of admin rules + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AdminRuleListResult class. + */ + public AdminRuleListResult() { + } + + /** + * Get the value property: A list of admin rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of admin rules. + * + * @param value the value value to set. + * @return the AdminRuleListResult object itself. + */ + public AdminRuleListResult 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 AdminRuleListResult object itself. + */ + public AdminRuleListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AdminRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AdminRuleListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AdminRuleListResult. + */ + public static AdminRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AdminRuleListResult deserializedAdminRuleListResult = new AdminRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BaseAdminRuleInner.fromJson(reader1)); + deserializedAdminRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAdminRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAdminRuleListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRules.java new file mode 100644 index 0000000000000..8c3aa12e7c653 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminRules.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.BaseAdminRuleInner; + +/** + * Resource collection API of AdminRules. + */ +public interface AdminRules { + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 configuration admin rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * List all network manager security configuration admin rules. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 configuration admin rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context); + + /** + * Gets a network manager security configuration admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a network manager security configuration admin rule. + */ + BaseAdminRule get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base admin rule along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule, + Context context); + + /** + * Creates or updates an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param adminRule The admin rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 base admin rule. + */ + BaseAdminRule createOrUpdate(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, BaseAdminRuleInner adminRule); + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes an admin rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminState.java new file mode 100644 index 0000000000000..48d46c0a086f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AdminState.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 java.util.Collection; + +/** + * Property to indicate if the Express Route Gateway serves traffic when there are multiple Express Route Gateways in + * the vnet. + */ +public final class AdminState extends ExpandableStringEnum { + /** + * Static value Enabled for AdminState. + */ + public static final AdminState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for AdminState. + */ + public static final AdminState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AdminState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AdminState() { + } + + /** + * Creates or finds a AdminState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AdminState. + */ + public static AdminState fromString(String name) { + return fromString(name, AdminState.class); + } + + /** + * Gets known AdminState values. + * + * @return known AdminState values. + */ + public static Collection values() { + return values(AdminState.class); + } +} 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..217575a3c4a9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateway.java @@ -0,0 +1,1132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 backendSettingsCollection property: Backend 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 backendSettingsCollection value. + */ + List backendSettingsCollection(); + + /** + * 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 listeners property: 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 listeners value. + */ + List listeners(); + + /** + * 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 routingRules property: Routing rules of the application gateway resource. + * + * @return the routingRules value. + */ + List routingRules(); + + /** + * 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 loadDistributionPolicies property: Load distribution policies of the application gateway resource. + * + * @return the loadDistributionPolicies value. + */ + List loadDistributionPolicies(); + + /** + * Gets the globalConfiguration property: Global Configuration. + * + * @return the globalConfiguration value. + */ + ApplicationGatewayGlobalConfiguration globalConfiguration(); + + /** + * Gets the defaultPredefinedSslPolicy property: The default predefined SSL Policy applied on the application + * gateway resource. + * + * @return the defaultPredefinedSslPolicy value. + */ + ApplicationGatewaySslPolicyName defaultPredefinedSslPolicy(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithBackendSettingsCollection, + DefinitionStages.WithHttpListeners, DefinitionStages.WithListeners, DefinitionStages.WithSslProfiles, + DefinitionStages.WithUrlPathMaps, DefinitionStages.WithRequestRoutingRules, + DefinitionStages.WithRoutingRules, DefinitionStages.WithRewriteRuleSets, + DefinitionStages.WithRedirectConfigurations, DefinitionStages.WithWebApplicationFirewallConfiguration, + DefinitionStages.WithFirewallPolicy, DefinitionStages.WithEnableHttp2, DefinitionStages.WithEnableFips, + DefinitionStages.WithAutoscaleConfiguration, DefinitionStages.WithPrivateLinkConfigurations, + DefinitionStages.WithCustomErrorConfigurations, DefinitionStages.WithForceFirewallPolicyAssociation, + DefinitionStages.WithLoadDistributionPolicies, DefinitionStages.WithGlobalConfiguration { + /** + * 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 backendSettingsCollection. + */ + interface WithBackendSettingsCollection { + /** + * Specifies the backendSettingsCollection property: Backend 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 backendSettingsCollection Backend 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 withBackendSettingsCollection(List backendSettingsCollection); + } + + /** + * 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 listeners. + */ + interface WithListeners { + /** + * Specifies the listeners property: 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 listeners 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 withListeners(List listeners); + } + + /** + * 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 routingRules. + */ + interface WithRoutingRules { + /** + * Specifies the routingRules property: Routing rules of the application gateway resource.. + * + * @param routingRules Routing rules of the application gateway resource. + * @return the next definition stage. + */ + WithCreate withRoutingRules(List routingRules); + } + + /** + * 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); + } + + /** + * The stage of the ApplicationGateway definition allowing to specify loadDistributionPolicies. + */ + interface WithLoadDistributionPolicies { + /** + * Specifies the loadDistributionPolicies property: Load distribution policies of the application gateway + * resource.. + * + * @param loadDistributionPolicies Load distribution policies of the application gateway resource. + * @return the next definition stage. + */ + WithCreate + withLoadDistributionPolicies(List loadDistributionPolicies); + } + + /** + * The stage of the ApplicationGateway definition allowing to specify globalConfiguration. + */ + interface WithGlobalConfiguration { + /** + * Specifies the globalConfiguration property: Global Configuration.. + * + * @param globalConfiguration Global Configuration. + * @return the next definition stage. + */ + WithCreate withGlobalConfiguration(ApplicationGatewayGlobalConfiguration globalConfiguration); + } + } + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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..8e6ea618948c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAuthenticationCertificate.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayAuthenticationCertificatePropertiesFormat; +import java.io.IOException; + +/** + * Authentication certificates of an application gateway. + */ +@Fluent +public final class ApplicationGatewayAuthenticationCertificate extends SubResource { + /* + * Properties of the application gateway authentication certificate. + */ + private ApplicationGatewayAuthenticationCertificatePropertiesFormat innerProperties; + + /* + * Name of the authentication certificate that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayAuthenticationCertificate class. + */ + public ApplicationGatewayAuthenticationCertificate() { + } + + /** + * Get the innerProperties property: Properties of the application gateway authentication certificate. + * + * @return the innerProperties value. + */ + private ApplicationGatewayAuthenticationCertificatePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayAuthenticationCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the data property: Certificate public data. + * + * @return the data value. + */ + public String data() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayAuthenticationCertificatePropertiesFormat(); + } + this.innerProperties().withData(data); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the authentication certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayAuthenticationCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayAuthenticationCertificate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayAuthenticationCertificate. + */ + public static ApplicationGatewayAuthenticationCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayAuthenticationCertificate deserializedApplicationGatewayAuthenticationCertificate + = new ApplicationGatewayAuthenticationCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayAuthenticationCertificate.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayAuthenticationCertificate.innerProperties + = ApplicationGatewayAuthenticationCertificatePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayAuthenticationCertificate.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayAuthenticationCertificate.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayAuthenticationCertificate.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayAuthenticationCertificate; + }); + } +} 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..46bf7fb252b3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAutoscaleConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Application Gateway autoscale configuration. + */ +@Fluent +public final class ApplicationGatewayAutoscaleConfiguration + implements JsonSerializable { + /* + * Lower bound on number of Application Gateway capacity. + */ + private int minCapacity; + + /* + * Upper bound on number of Application Gateway capacity. + */ + private Integer maxCapacity; + + /** + * Creates an instance of ApplicationGatewayAutoscaleConfiguration class. + */ + public ApplicationGatewayAutoscaleConfiguration() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("minCapacity", this.minCapacity); + jsonWriter.writeNumberField("maxCapacity", this.maxCapacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayAutoscaleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayAutoscaleConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayAutoscaleConfiguration. + */ + public static ApplicationGatewayAutoscaleConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayAutoscaleConfiguration deserializedApplicationGatewayAutoscaleConfiguration + = new ApplicationGatewayAutoscaleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minCapacity".equals(fieldName)) { + deserializedApplicationGatewayAutoscaleConfiguration.minCapacity = reader.getInt(); + } else if ("maxCapacity".equals(fieldName)) { + deserializedApplicationGatewayAutoscaleConfiguration.maxCapacity + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayAutoscaleConfiguration; + }); + } +} 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..911113bdb0eb4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslOptions.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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..44be8e1e52360 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableSslPredefinedPolicies.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslPredefinedPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ApplicationGatewayAvailableSslOptions API service call. + */ +@Fluent +public final class ApplicationGatewayAvailableSslPredefinedPolicies + implements JsonSerializable { + /* + * List of available Ssl predefined policy. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ApplicationGatewayAvailableSslPredefinedPolicies class. + */ + public ApplicationGatewayAvailableSslPredefinedPolicies() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayAvailableSslPredefinedPolicies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayAvailableSslPredefinedPolicies if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayAvailableSslPredefinedPolicies. + */ + public static ApplicationGatewayAvailableSslPredefinedPolicies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayAvailableSslPredefinedPolicies deserializedApplicationGatewayAvailableSslPredefinedPolicies + = new ApplicationGatewayAvailableSslPredefinedPolicies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApplicationGatewaySslPredefinedPolicyInner.fromJson(reader1)); + deserializedApplicationGatewayAvailableSslPredefinedPolicies.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationGatewayAvailableSslPredefinedPolicies.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayAvailableSslPredefinedPolicies; + }); + } +} 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..2340fead96638 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayAvailableWafRuleSetsResult.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights 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..13809e50c204a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddress.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Backend address of an application gateway. + */ +@Fluent +public final class ApplicationGatewayBackendAddress implements JsonSerializable { + /* + * Fully qualified domain name (FQDN). + */ + private String fqdn; + + /* + * IP address. + */ + private String ipAddress; + + /** + * Creates an instance of ApplicationGatewayBackendAddress class. + */ + public ApplicationGatewayBackendAddress() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendAddress if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendAddress. + */ + public static ApplicationGatewayBackendAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendAddress deserializedApplicationGatewayBackendAddress + = new ApplicationGatewayBackendAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedApplicationGatewayBackendAddress.fqdn = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedApplicationGatewayBackendAddress.ipAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendAddress; + }); + } +} 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..156622b2216b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendAddressPool.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.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendAddressPoolPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Backend Address Pool of an application gateway. + */ +@Fluent +public final class ApplicationGatewayBackendAddressPool extends SubResource { + /* + * Properties of the application gateway backend address pool. + */ + private ApplicationGatewayBackendAddressPoolPropertiesFormat innerProperties; + + /* + * Name of the backend address pool that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayBackendAddressPool class. + */ + public ApplicationGatewayBackendAddressPool() { + } + + /** + * Get the innerProperties property: Properties of the application gateway backend address pool. + * + * @return the innerProperties value. + */ + private ApplicationGatewayBackendAddressPoolPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayBackendAddressPool withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the backendIpConfigurations property: Collection of references to IPs defined in network interfaces. + * + * @return the backendIpConfigurations value. + */ + public List backendIpConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().backendIpConfigurations(); + } + + /** + * Get the backendAddresses property: Backend addresses. + * + * @return the backendAddresses value. + */ + public List backendAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().backendAddresses(); + } + + /** + * Set the backendAddresses property: Backend addresses. + * + * @param backendAddresses the backendAddresses value to set. + * @return the ApplicationGatewayBackendAddressPool object itself. + */ + public ApplicationGatewayBackendAddressPool + withBackendAddresses(List backendAddresses) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendAddressPoolPropertiesFormat(); + } + this.innerProperties().withBackendAddresses(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendAddressPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendAddressPool if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendAddressPool. + */ + public static ApplicationGatewayBackendAddressPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendAddressPool deserializedApplicationGatewayBackendAddressPool + = new ApplicationGatewayBackendAddressPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayBackendAddressPool.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayBackendAddressPool.innerProperties + = ApplicationGatewayBackendAddressPoolPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayBackendAddressPool.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayBackendAddressPool.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayBackendAddressPool.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendAddressPool; + }); + } +} 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..91fd45922b3b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealth.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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..9d65ef7a8c37b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthHttpSettings.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHealthServerInner; +import java.io.IOException; +import java.util.List; + +/** + * Application gateway BackendHealthHttp settings. + */ +@Fluent +public final class ApplicationGatewayBackendHealthHttpSettings + implements JsonSerializable { + /* + * Reference to an ApplicationGatewayBackendHttpSettings resource. + */ + private ApplicationGatewayBackendHttpSettings backendHttpSettings; + + /* + * List of ApplicationGatewayBackendHealthServer resources. + */ + private List servers; + + /** + * Creates an instance of ApplicationGatewayBackendHealthHttpSettings class. + */ + public ApplicationGatewayBackendHealthHttpSettings() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backendHttpSettings", this.backendHttpSettings); + jsonWriter.writeArrayField("servers", this.servers, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendHealthHttpSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendHealthHttpSettings if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendHealthHttpSettings. + */ + public static ApplicationGatewayBackendHealthHttpSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendHealthHttpSettings deserializedApplicationGatewayBackendHealthHttpSettings + = new ApplicationGatewayBackendHealthHttpSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backendHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthHttpSettings.backendHttpSettings + = ApplicationGatewayBackendHttpSettings.fromJson(reader); + } else if ("servers".equals(fieldName)) { + List servers + = reader.readArray(reader1 -> ApplicationGatewayBackendHealthServerInner.fromJson(reader1)); + deserializedApplicationGatewayBackendHealthHttpSettings.servers = servers; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendHealthHttpSettings; + }); + } +} 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..3c5f8258e0ed3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthOnDemand.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.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..f3d981dc26b59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthPool.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Application gateway BackendHealth pool. + */ +@Fluent +public final class ApplicationGatewayBackendHealthPool + implements JsonSerializable { + /* + * Reference to an ApplicationGatewayBackendAddressPool resource. + */ + private ApplicationGatewayBackendAddressPool backendAddressPool; + + /* + * List of ApplicationGatewayBackendHealthHttpSettings resources. + */ + private List backendHttpSettingsCollection; + + /** + * Creates an instance of ApplicationGatewayBackendHealthPool class. + */ + public ApplicationGatewayBackendHealthPool() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeArrayField("backendHttpSettingsCollection", this.backendHttpSettingsCollection, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendHealthPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendHealthPool if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendHealthPool. + */ + public static ApplicationGatewayBackendHealthPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendHealthPool deserializedApplicationGatewayBackendHealthPool + = new ApplicationGatewayBackendHealthPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayBackendHealthPool.backendAddressPool + = ApplicationGatewayBackendAddressPool.fromJson(reader); + } else if ("backendHttpSettingsCollection".equals(fieldName)) { + List backendHttpSettingsCollection + = reader.readArray(reader1 -> ApplicationGatewayBackendHealthHttpSettings.fromJson(reader1)); + deserializedApplicationGatewayBackendHealthPool.backendHttpSettingsCollection + = backendHttpSettingsCollection; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendHealthPool; + }); + } +} 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..6d132cffc95da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServer.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.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..97d67fca89353 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHealthServerHealth.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Health of backend server. + */ +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 a new instance of ApplicationGatewayBackendHealthServerHealth value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayBackendHealthServerHealth() { + } + + /** + * Creates or finds a ApplicationGatewayBackendHealthServerHealth from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayBackendHealthServerHealth. + */ + public static ApplicationGatewayBackendHealthServerHealth fromString(String name) { + return fromString(name, ApplicationGatewayBackendHealthServerHealth.class); + } + + /** + * Gets known ApplicationGatewayBackendHealthServerHealth values. + * + * @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..de63e8dbc9e55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendHttpSettings.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendHttpSettingsPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Backend address pool settings of an application gateway. + */ +@Fluent +public final class ApplicationGatewayBackendHttpSettings extends SubResource { + /* + * Properties of the application gateway backend HTTP settings. + */ + private ApplicationGatewayBackendHttpSettingsPropertiesFormat innerProperties; + + /* + * Name of the backend http settings that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayBackendHttpSettings class. + */ + public ApplicationGatewayBackendHttpSettings() { + } + + /** + * Get the innerProperties property: Properties of the application gateway backend HTTP settings. + * + * @return the innerProperties value. + */ + private ApplicationGatewayBackendHttpSettingsPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayBackendHttpSettings withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the port property: The destination port on the backend. + * + * @return the port value. + */ + public Integer port() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withPort(port); + return this; + } + + /** + * Get the protocol property: The protocol used to communicate with the backend. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the cookieBasedAffinity property: Cookie based affinity. + * + * @return the cookieBasedAffinity value. + */ + public ApplicationGatewayCookieBasedAffinity cookieBasedAffinity() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withCookieBasedAffinity(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withRequestTimeout(requestTimeout); + return this; + } + + /** + * Get the probe property: Probe resource of an application gateway. + * + * @return the probe value. + */ + public SubResource probe() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withProbe(probe); + return this; + } + + /** + * Get the authenticationCertificates property: Array of references to application gateway authentication + * certificates. + * + * @return the authenticationCertificates value. + */ + public List authenticationCertificates() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withAuthenticationCertificates(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withTrustedRootCertificates(trustedRootCertificates); + return this; + } + + /** + * Get the connectionDraining property: Connection draining of the backend http settings resource. + * + * @return the connectionDraining value. + */ + public ApplicationGatewayConnectionDraining connectionDraining() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withConnectionDraining(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withHostname(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withPickHostnameFromBackendAddress(pickHostnameFromBackendAddress); + return this; + } + + /** + * Get the affinityCookieName property: Cookie name to use for the affinity cookie. + * + * @return the affinityCookieName value. + */ + public String affinityCookieName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withAffinityCookieName(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withProbeEnabled(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendHttpSettingsPropertiesFormat(); + } + this.innerProperties().withPath(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendHttpSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendHttpSettings if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendHttpSettings. + */ + public static ApplicationGatewayBackendHttpSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendHttpSettings deserializedApplicationGatewayBackendHttpSettings + = new ApplicationGatewayBackendHttpSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettings.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettings.innerProperties + = ApplicationGatewayBackendHttpSettingsPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettings.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettings.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayBackendHttpSettings.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendHttpSettings; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendSettings.java new file mode 100644 index 0000000000000..76dd7e8dcaa15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayBackendSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayBackendSettingsPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Backend address pool settings of an application gateway. + */ +@Fluent +public final class ApplicationGatewayBackendSettings extends SubResource { + /* + * Properties of the application gateway backend settings. + */ + private ApplicationGatewayBackendSettingsPropertiesFormat innerProperties; + + /* + * Name of the backend settings that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayBackendSettings class. + */ + public ApplicationGatewayBackendSettings() { + } + + /** + * Get the innerProperties property: Properties of the application gateway backend settings. + * + * @return the innerProperties value. + */ + private ApplicationGatewayBackendSettingsPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the name property: Name of the backend 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 settings that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayBackendSettings withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the port property: The destination port on the backend. + * + * @return the port value. + */ + public Integer port() { + return this.innerProperties() == null ? null : this.innerProperties().port(); + } + + /** + * Set the port property: The destination port on the backend. + * + * @param port the port value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings withPort(Integer port) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendSettingsPropertiesFormat(); + } + this.innerProperties().withPort(port); + return this; + } + + /** + * Get the protocol property: The protocol used to communicate with the backend. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Set the protocol property: The protocol used to communicate with the backend. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings withProtocol(ApplicationGatewayProtocol protocol) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendSettingsPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the timeout property: Connection timeout in seconds. Application Gateway will fail the request if response is + * not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @return the timeout value. + */ + public Integer timeout() { + return this.innerProperties() == null ? null : this.innerProperties().timeout(); + } + + /** + * Set the timeout property: Connection timeout in seconds. Application Gateway will fail the request if response is + * not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. + * + * @param timeout the timeout value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings withTimeout(Integer timeout) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendSettingsPropertiesFormat(); + } + this.innerProperties().withTimeout(timeout); + return this; + } + + /** + * Get the probe property: Probe resource of an application gateway. + * + * @return the probe value. + */ + public SubResource probe() { + return this.innerProperties() == null ? null : this.innerProperties().probe(); + } + + /** + * Set the probe property: Probe resource of an application gateway. + * + * @param probe the probe value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings withProbe(SubResource probe) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendSettingsPropertiesFormat(); + } + this.innerProperties().withProbe(probe); + return this; + } + + /** + * Get the trustedRootCertificates property: Array of references to application gateway trusted root certificates. + * + * @return the trustedRootCertificates value. + */ + public List trustedRootCertificates() { + return this.innerProperties() == null ? null : this.innerProperties().trustedRootCertificates(); + } + + /** + * Set the trustedRootCertificates property: Array of references to application gateway trusted root certificates. + * + * @param trustedRootCertificates the trustedRootCertificates value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings withTrustedRootCertificates(List trustedRootCertificates) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendSettingsPropertiesFormat(); + } + this.innerProperties().withTrustedRootCertificates(trustedRootCertificates); + return this; + } + + /** + * Get the hostname property: Server name indication to be sent to the backend servers for Tls protocol. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Set the hostname property: Server name indication to be sent to the backend servers for Tls protocol. + * + * @param hostname the hostname value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings withHostname(String hostname) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendSettingsPropertiesFormat(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the pickHostnameFromBackendAddress property: Whether to pick server name indication from the host name of the + * backend server for Tls protocol. Default value is false. + * + * @return the pickHostnameFromBackendAddress value. + */ + public Boolean pickHostnameFromBackendAddress() { + return this.innerProperties() == null ? null : this.innerProperties().pickHostnameFromBackendAddress(); + } + + /** + * Set the pickHostnameFromBackendAddress property: Whether to pick server name indication from the host name of the + * backend server for Tls protocol. Default value is false. + * + * @param pickHostnameFromBackendAddress the pickHostnameFromBackendAddress value to set. + * @return the ApplicationGatewayBackendSettings object itself. + */ + public ApplicationGatewayBackendSettings + withPickHostnameFromBackendAddress(Boolean pickHostnameFromBackendAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayBackendSettingsPropertiesFormat(); + } + this.innerProperties().withPickHostnameFromBackendAddress(pickHostnameFromBackendAddress); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the backend HTTP settings resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayBackendSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayBackendSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayBackendSettings. + */ + public static ApplicationGatewayBackendSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayBackendSettings deserializedApplicationGatewayBackendSettings + = new ApplicationGatewayBackendSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayBackendSettings.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayBackendSettings.innerProperties + = ApplicationGatewayBackendSettingsPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayBackendSettings.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayBackendSettings.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayBackendSettings.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayBackendSettings; + }); + } +} 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..a99d8dff8286e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientAuthConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Application gateway client authentication configuration. + */ +@Fluent +public final class ApplicationGatewayClientAuthConfiguration + implements JsonSerializable { + /* + * Verify client certificate issuer name on the application gateway. + */ + private Boolean verifyClientCertIssuerDN; + + /* + * Verify client certificate revocation status. + */ + private ApplicationGatewayClientRevocationOptions verifyClientRevocation; + + /** + * Creates an instance of ApplicationGatewayClientAuthConfiguration class. + */ + public ApplicationGatewayClientAuthConfiguration() { + } + + /** + * 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; + } + + /** + * Get the verifyClientRevocation property: Verify client certificate revocation status. + * + * @return the verifyClientRevocation value. + */ + public ApplicationGatewayClientRevocationOptions verifyClientRevocation() { + return this.verifyClientRevocation; + } + + /** + * Set the verifyClientRevocation property: Verify client certificate revocation status. + * + * @param verifyClientRevocation the verifyClientRevocation value to set. + * @return the ApplicationGatewayClientAuthConfiguration object itself. + */ + public ApplicationGatewayClientAuthConfiguration + withVerifyClientRevocation(ApplicationGatewayClientRevocationOptions verifyClientRevocation) { + this.verifyClientRevocation = verifyClientRevocation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("verifyClientCertIssuerDN", this.verifyClientCertIssuerDN); + jsonWriter.writeStringField("verifyClientRevocation", + this.verifyClientRevocation == null ? null : this.verifyClientRevocation.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayClientAuthConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayClientAuthConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayClientAuthConfiguration. + */ + public static ApplicationGatewayClientAuthConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayClientAuthConfiguration deserializedApplicationGatewayClientAuthConfiguration + = new ApplicationGatewayClientAuthConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("verifyClientCertIssuerDN".equals(fieldName)) { + deserializedApplicationGatewayClientAuthConfiguration.verifyClientCertIssuerDN + = reader.getNullable(JsonReader::getBoolean); + } else if ("verifyClientRevocation".equals(fieldName)) { + deserializedApplicationGatewayClientAuthConfiguration.verifyClientRevocation + = ApplicationGatewayClientRevocationOptions.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayClientAuthConfiguration; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientRevocationOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientRevocationOptions.java new file mode 100644 index 0000000000000..c82762130b7cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayClientRevocationOptions.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 java.util.Collection; + +/** + * Verify client certificate revocation status. + */ +public final class ApplicationGatewayClientRevocationOptions + extends ExpandableStringEnum { + /** + * Static value None for ApplicationGatewayClientRevocationOptions. + */ + public static final ApplicationGatewayClientRevocationOptions NONE = fromString("None"); + + /** + * Static value OCSP for ApplicationGatewayClientRevocationOptions. + */ + public static final ApplicationGatewayClientRevocationOptions OCSP = fromString("OCSP"); + + /** + * Creates a new instance of ApplicationGatewayClientRevocationOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayClientRevocationOptions() { + } + + /** + * Creates or finds a ApplicationGatewayClientRevocationOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayClientRevocationOptions. + */ + public static ApplicationGatewayClientRevocationOptions fromString(String name) { + return fromString(name, ApplicationGatewayClientRevocationOptions.class); + } + + /** + * Gets known ApplicationGatewayClientRevocationOptions values. + * + * @return known ApplicationGatewayClientRevocationOptions values. + */ + public static Collection values() { + return values(ApplicationGatewayClientRevocationOptions.class); + } +} 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..b9188f607e615 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayConnectionDraining.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * 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 + implements JsonSerializable { + /* + * Whether connection draining is enabled or not. + */ + private boolean enabled; + + /* + * The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + */ + private int drainTimeoutInSec; + + /** + * Creates an instance of ApplicationGatewayConnectionDraining class. + */ + public ApplicationGatewayConnectionDraining() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeIntField("drainTimeoutInSec", this.drainTimeoutInSec); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayConnectionDraining from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayConnectionDraining if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayConnectionDraining. + */ + public static ApplicationGatewayConnectionDraining fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayConnectionDraining deserializedApplicationGatewayConnectionDraining + = new ApplicationGatewayConnectionDraining(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedApplicationGatewayConnectionDraining.enabled = reader.getBoolean(); + } else if ("drainTimeoutInSec".equals(fieldName)) { + deserializedApplicationGatewayConnectionDraining.drainTimeoutInSec = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayConnectionDraining; + }); + } +} 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..a679632df6585 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCookieBasedAffinity.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 java.util.Collection; + +/** + * Cookie based affinity. + */ +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 a new instance of ApplicationGatewayCookieBasedAffinity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayCookieBasedAffinity() { + } + + /** + * Creates or finds a ApplicationGatewayCookieBasedAffinity from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayCookieBasedAffinity. + */ + public static ApplicationGatewayCookieBasedAffinity fromString(String name) { + return fromString(name, ApplicationGatewayCookieBasedAffinity.class); + } + + /** + * Gets known ApplicationGatewayCookieBasedAffinity values. + * + * @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..5331dc597ad23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomError.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Custom error of an application gateway. + */ +@Fluent +public final class ApplicationGatewayCustomError implements JsonSerializable { + /* + * Status code of the application gateway custom error. + */ + private ApplicationGatewayCustomErrorStatusCode statusCode; + + /* + * Error page URL of the application gateway custom error. + */ + private String customErrorPageUrl; + + /** + * Creates an instance of ApplicationGatewayCustomError class. + */ + public ApplicationGatewayCustomError() { + } + + /** + * Get the statusCode property: Status code of the application gateway custom error. + * + * @return the statusCode value. + */ + public ApplicationGatewayCustomErrorStatusCode statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: Status code of the application gateway custom 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 custom error. + * + * @return the customErrorPageUrl value. + */ + public String customErrorPageUrl() { + return this.customErrorPageUrl; + } + + /** + * Set the customErrorPageUrl property: Error page URL of the application gateway custom 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("statusCode", this.statusCode == null ? null : this.statusCode.toString()); + jsonWriter.writeStringField("customErrorPageUrl", this.customErrorPageUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayCustomError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayCustomError if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayCustomError. + */ + public static ApplicationGatewayCustomError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayCustomError deserializedApplicationGatewayCustomError + = new ApplicationGatewayCustomError(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("statusCode".equals(fieldName)) { + deserializedApplicationGatewayCustomError.statusCode + = ApplicationGatewayCustomErrorStatusCode.fromString(reader.getString()); + } else if ("customErrorPageUrl".equals(fieldName)) { + deserializedApplicationGatewayCustomError.customErrorPageUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayCustomError; + }); + } +} 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..c638187e4fbad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayCustomErrorStatusCode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status code of the application gateway custom error. + */ +public final class ApplicationGatewayCustomErrorStatusCode + extends ExpandableStringEnum { + /** + * Static value HttpStatus400 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS400 = fromString("HttpStatus400"); + + /** + * Static value HttpStatus403 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS403 = fromString("HttpStatus403"); + + /** + * Static value HttpStatus404 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS404 = fromString("HttpStatus404"); + + /** + * Static value HttpStatus405 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS405 = fromString("HttpStatus405"); + + /** + * Static value HttpStatus408 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS408 = fromString("HttpStatus408"); + + /** + * Static value HttpStatus500 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS500 = fromString("HttpStatus500"); + + /** + * Static value HttpStatus502 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS502 = fromString("HttpStatus502"); + + /** + * Static value HttpStatus503 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS503 = fromString("HttpStatus503"); + + /** + * Static value HttpStatus504 for ApplicationGatewayCustomErrorStatusCode. + */ + public static final ApplicationGatewayCustomErrorStatusCode HTTP_STATUS504 = fromString("HttpStatus504"); + + /** + * Creates a new instance of ApplicationGatewayCustomErrorStatusCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayCustomErrorStatusCode() { + } + + /** + * Creates or finds a ApplicationGatewayCustomErrorStatusCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayCustomErrorStatusCode. + */ + public static ApplicationGatewayCustomErrorStatusCode fromString(String name) { + return fromString(name, ApplicationGatewayCustomErrorStatusCode.class); + } + + /** + * Gets known ApplicationGatewayCustomErrorStatusCode values. + * + * @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..53af95b47a502 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallDisabledRuleGroup.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Allows to disable rules within a rule group or an entire rule group. + */ +@Fluent +public final class ApplicationGatewayFirewallDisabledRuleGroup + implements JsonSerializable { + /* + * The name of the rule group that will be disabled. + */ + private String ruleGroupName; + + /* + * The list of rules that will be disabled. If null, all rules of the rule group will be disabled. + */ + private List rules; + + /** + * Creates an instance of ApplicationGatewayFirewallDisabledRuleGroup class. + */ + public ApplicationGatewayFirewallDisabledRuleGroup() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property ruleGroupName in model ApplicationGatewayFirewallDisabledRuleGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallDisabledRuleGroup.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleGroupName", this.ruleGroupName); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeInt(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFirewallDisabledRuleGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFirewallDisabledRuleGroup if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayFirewallDisabledRuleGroup. + */ + public static ApplicationGatewayFirewallDisabledRuleGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFirewallDisabledRuleGroup deserializedApplicationGatewayFirewallDisabledRuleGroup + = new ApplicationGatewayFirewallDisabledRuleGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleGroupName".equals(fieldName)) { + deserializedApplicationGatewayFirewallDisabledRuleGroup.ruleGroupName = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> reader1.getInt()); + deserializedApplicationGatewayFirewallDisabledRuleGroup.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFirewallDisabledRuleGroup; + }); + } +} 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..05b05eb4915d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallExclusion.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Allow to exclude some variable satisfy the condition for the WAF check. + */ +@Fluent +public final class ApplicationGatewayFirewallExclusion + implements JsonSerializable { + /* + * The variable to be excluded. + */ + private String matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this + * exclusion applies to. + */ + private String selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which elements in the collection this exclusion + * applies to. + */ + private String selector; + + /** + * Creates an instance of ApplicationGatewayFirewallExclusion class. + */ + public ApplicationGatewayFirewallExclusion() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property matchVariable in model ApplicationGatewayFirewallExclusion")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallExclusion.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("matchVariable", this.matchVariable); + jsonWriter.writeStringField("selectorMatchOperator", this.selectorMatchOperator); + jsonWriter.writeStringField("selector", this.selector); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFirewallExclusion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFirewallExclusion if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayFirewallExclusion. + */ + public static ApplicationGatewayFirewallExclusion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFirewallExclusion deserializedApplicationGatewayFirewallExclusion + = new ApplicationGatewayFirewallExclusion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchVariable".equals(fieldName)) { + deserializedApplicationGatewayFirewallExclusion.matchVariable = reader.getString(); + } else if ("selectorMatchOperator".equals(fieldName)) { + deserializedApplicationGatewayFirewallExclusion.selectorMatchOperator = reader.getString(); + } else if ("selector".equals(fieldName)) { + deserializedApplicationGatewayFirewallExclusion.selector = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFirewallExclusion; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallManifestRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallManifestRuleSet.java new file mode 100644 index 0000000000000..7a23187c25d76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallManifestRuleSet.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the web application firewall rule set. + */ +@Fluent +public final class ApplicationGatewayFirewallManifestRuleSet + implements JsonSerializable { + /* + * The type of the web application firewall rule set. + */ + private String ruleSetType; + + /* + * The version of the web application firewall rule set type. + */ + private String ruleSetVersion; + + /* + * The rule set status + */ + private ApplicationGatewayRuleSetStatusOptions status; + + /* + * Tier of an application gateway that support the rule set. + */ + private List tiers; + + /* + * The rule groups of the web application firewall rule set. + */ + private List ruleGroups; + + /** + * Creates an instance of ApplicationGatewayFirewallManifestRuleSet class. + */ + public ApplicationGatewayFirewallManifestRuleSet() { + } + + /** + * 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 ApplicationGatewayFirewallManifestRuleSet object itself. + */ + public ApplicationGatewayFirewallManifestRuleSet 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 ApplicationGatewayFirewallManifestRuleSet object itself. + */ + public ApplicationGatewayFirewallManifestRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the status property: The rule set status. + * + * @return the status value. + */ + public ApplicationGatewayRuleSetStatusOptions status() { + return this.status; + } + + /** + * Set the status property: The rule set status. + * + * @param status the status value to set. + * @return the ApplicationGatewayFirewallManifestRuleSet object itself. + */ + public ApplicationGatewayFirewallManifestRuleSet withStatus(ApplicationGatewayRuleSetStatusOptions status) { + this.status = status; + return this; + } + + /** + * Get the tiers property: Tier of an application gateway that support the rule set. + * + * @return the tiers value. + */ + public List tiers() { + return this.tiers; + } + + /** + * Set the tiers property: Tier of an application gateway that support the rule set. + * + * @param tiers the tiers value to set. + * @return the ApplicationGatewayFirewallManifestRuleSet object itself. + */ + public ApplicationGatewayFirewallManifestRuleSet withTiers(List tiers) { + this.tiers = tiers; + 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 ApplicationGatewayFirewallManifestRuleSet object itself. + */ + public ApplicationGatewayFirewallManifestRuleSet + withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleSetType in model ApplicationGatewayFirewallManifestRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleSetVersion in model ApplicationGatewayFirewallManifestRuleSet")); + } + if (ruleGroups() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleGroups in model ApplicationGatewayFirewallManifestRuleSet")); + } else { + ruleGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallManifestRuleSet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleSetType", this.ruleSetType); + jsonWriter.writeStringField("ruleSetVersion", this.ruleSetVersion); + jsonWriter.writeArrayField("ruleGroups", this.ruleGroups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("tiers", this.tiers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFirewallManifestRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFirewallManifestRuleSet if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayFirewallManifestRuleSet. + */ + public static ApplicationGatewayFirewallManifestRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFirewallManifestRuleSet deserializedApplicationGatewayFirewallManifestRuleSet + = new ApplicationGatewayFirewallManifestRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetType".equals(fieldName)) { + deserializedApplicationGatewayFirewallManifestRuleSet.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedApplicationGatewayFirewallManifestRuleSet.ruleSetVersion = reader.getString(); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ApplicationGatewayFirewallRuleGroup.fromJson(reader1)); + deserializedApplicationGatewayFirewallManifestRuleSet.ruleGroups = ruleGroups; + } else if ("status".equals(fieldName)) { + deserializedApplicationGatewayFirewallManifestRuleSet.status + = ApplicationGatewayRuleSetStatusOptions.fromString(reader.getString()); + } else if ("tiers".equals(fieldName)) { + List tiers + = reader.readArray(reader1 -> ApplicationGatewayTierTypes.fromString(reader1.getString())); + deserializedApplicationGatewayFirewallManifestRuleSet.tiers = tiers; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFirewallManifestRuleSet; + }); + } +} 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..2e2f724201ea8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Web application firewall mode. + */ +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 a new instance of ApplicationGatewayFirewallMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayFirewallMode() { + } + + /** + * Creates or finds a ApplicationGatewayFirewallMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayFirewallMode. + */ + public static ApplicationGatewayFirewallMode fromString(String name) { + return fromString(name, ApplicationGatewayFirewallMode.class); + } + + /** + * Gets known ApplicationGatewayFirewallMode values. + * + * @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/ApplicationGatewayFirewallRateLimitDuration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRateLimitDuration.java new file mode 100644 index 0000000000000..6d08dcf69294d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRateLimitDuration.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 java.util.Collection; + +/** + * Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule. + */ +public final class ApplicationGatewayFirewallRateLimitDuration + extends ExpandableStringEnum { + /** + * Static value OneMin for ApplicationGatewayFirewallRateLimitDuration. + */ + public static final ApplicationGatewayFirewallRateLimitDuration ONE_MIN = fromString("OneMin"); + + /** + * Static value FiveMins for ApplicationGatewayFirewallRateLimitDuration. + */ + public static final ApplicationGatewayFirewallRateLimitDuration FIVE_MINS = fromString("FiveMins"); + + /** + * Creates a new instance of ApplicationGatewayFirewallRateLimitDuration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayFirewallRateLimitDuration() { + } + + /** + * Creates or finds a ApplicationGatewayFirewallRateLimitDuration from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayFirewallRateLimitDuration. + */ + public static ApplicationGatewayFirewallRateLimitDuration fromString(String name) { + return fromString(name, ApplicationGatewayFirewallRateLimitDuration.class); + } + + /** + * Gets known ApplicationGatewayFirewallRateLimitDuration values. + * + * @return known ApplicationGatewayFirewallRateLimitDuration values. + */ + public static Collection values() { + return values(ApplicationGatewayFirewallRateLimitDuration.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..b1488278af5f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRule.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A web application firewall rule. + */ +@Fluent +public final class ApplicationGatewayFirewallRule implements JsonSerializable { + /* + * The identifier of the web application firewall rule. + */ + private int ruleId; + + /* + * The string representation of the web application firewall rule identifier. + */ + private String ruleIdString; + + /* + * The string representation of the web application firewall rule state. + */ + private ApplicationGatewayWafRuleStateTypes state; + + /* + * The string representation of the web application firewall rule action. + */ + private ApplicationGatewayWafRuleActionTypes action; + + /* + * The string representation of the web application firewall rule sensitivity. + */ + private ApplicationGatewayWafRuleSensitivityTypes sensitivity; + + /* + * The description of the web application firewall rule. + */ + private String description; + + /** + * Creates an instance of ApplicationGatewayFirewallRule class. + */ + public ApplicationGatewayFirewallRule() { + } + + /** + * 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 ruleIdString property: The string representation of the web application firewall rule identifier. + * + * @return the ruleIdString value. + */ + public String ruleIdString() { + return this.ruleIdString; + } + + /** + * Set the ruleIdString property: The string representation of the web application firewall rule identifier. + * + * @param ruleIdString the ruleIdString value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withRuleIdString(String ruleIdString) { + this.ruleIdString = ruleIdString; + return this; + } + + /** + * Get the state property: The string representation of the web application firewall rule state. + * + * @return the state value. + */ + public ApplicationGatewayWafRuleStateTypes state() { + return this.state; + } + + /** + * Set the state property: The string representation of the web application firewall rule state. + * + * @param state the state value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withState(ApplicationGatewayWafRuleStateTypes state) { + this.state = state; + return this; + } + + /** + * Get the action property: The string representation of the web application firewall rule action. + * + * @return the action value. + */ + public ApplicationGatewayWafRuleActionTypes action() { + return this.action; + } + + /** + * Set the action property: The string representation of the web application firewall rule action. + * + * @param action the action value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withAction(ApplicationGatewayWafRuleActionTypes action) { + this.action = action; + return this; + } + + /** + * Get the sensitivity property: The string representation of the web application firewall rule sensitivity. + * + * @return the sensitivity value. + */ + public ApplicationGatewayWafRuleSensitivityTypes sensitivity() { + return this.sensitivity; + } + + /** + * Set the sensitivity property: The string representation of the web application firewall rule sensitivity. + * + * @param sensitivity the sensitivity value to set. + * @return the ApplicationGatewayFirewallRule object itself. + */ + public ApplicationGatewayFirewallRule withSensitivity(ApplicationGatewayWafRuleSensitivityTypes sensitivity) { + this.sensitivity = sensitivity; + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("ruleId", this.ruleId); + jsonWriter.writeStringField("ruleIdString", this.ruleIdString); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("sensitivity", this.sensitivity == null ? null : this.sensitivity.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFirewallRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFirewallRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayFirewallRule. + */ + public static ApplicationGatewayFirewallRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFirewallRule deserializedApplicationGatewayFirewallRule + = new ApplicationGatewayFirewallRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleId".equals(fieldName)) { + deserializedApplicationGatewayFirewallRule.ruleId = reader.getInt(); + } else if ("ruleIdString".equals(fieldName)) { + deserializedApplicationGatewayFirewallRule.ruleIdString = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedApplicationGatewayFirewallRule.state + = ApplicationGatewayWafRuleStateTypes.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedApplicationGatewayFirewallRule.action + = ApplicationGatewayWafRuleActionTypes.fromString(reader.getString()); + } else if ("sensitivity".equals(fieldName)) { + deserializedApplicationGatewayFirewallRule.sensitivity + = ApplicationGatewayWafRuleSensitivityTypes.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedApplicationGatewayFirewallRule.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFirewallRule; + }); + } +} 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..ceaa5864f6c28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleGroup.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A web application firewall rule group. + */ +@Fluent +public final class ApplicationGatewayFirewallRuleGroup + implements JsonSerializable { + /* + * The name of the web application firewall rule group. + */ + private String ruleGroupName; + + /* + * The description of the web application firewall rule group. + */ + private String description; + + /* + * The rules of the web application firewall rule group. + */ + private List rules; + + /** + * Creates an instance of ApplicationGatewayFirewallRuleGroup class. + */ + public ApplicationGatewayFirewallRuleGroup() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property ruleGroupName in model ApplicationGatewayFirewallRuleGroup")); + } + if (rules() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property rules in model ApplicationGatewayFirewallRuleGroup")); + } else { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationGatewayFirewallRuleGroup.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleGroupName", this.ruleGroupName); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFirewallRuleGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFirewallRuleGroup if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayFirewallRuleGroup. + */ + public static ApplicationGatewayFirewallRuleGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFirewallRuleGroup deserializedApplicationGatewayFirewallRuleGroup + = new ApplicationGatewayFirewallRuleGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleGroupName".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleGroup.ruleGroupName = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ApplicationGatewayFirewallRule.fromJson(reader1)); + deserializedApplicationGatewayFirewallRuleGroup.rules = rules; + } else if ("description".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleGroup.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFirewallRuleGroup; + }); + } +} 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..f221bb48203e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallRuleSet.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFirewallRuleSetPropertiesFormat; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A web application firewall rule set. + */ +@Fluent +public final class ApplicationGatewayFirewallRuleSet extends Resource { + /* + * Properties of the application gateway firewall rule set. + */ + private ApplicationGatewayFirewallRuleSetPropertiesFormat innerProperties; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of ApplicationGatewayFirewallRuleSet class. + */ + public ApplicationGatewayFirewallRuleSet() { + } + + /** + * Get the innerProperties property: Properties of the application gateway firewall rule set. + * + * @return the innerProperties value. + */ + private ApplicationGatewayFirewallRuleSetPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayFirewallRuleSet withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayFirewallRuleSet withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the web application firewall rule set. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ruleSetType property: The type of the web application firewall rule set. + * + * @return the ruleSetType value. + */ + public String ruleSetType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); + } + this.innerProperties().withRuleSetType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); + } + this.innerProperties().withRuleSetVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); + } + this.innerProperties().withRuleGroups(ruleGroups); + return this; + } + + /** + * Get the tiers property: Tier of an application gateway that support the rule set. + * + * @return the tiers value. + */ + public List tiers() { + return this.innerProperties() == null ? null : this.innerProperties().tiers(); + } + + /** + * Set the tiers property: Tier of an application gateway that support the rule set. + * + * @param tiers the tiers value to set. + * @return the ApplicationGatewayFirewallRuleSet object itself. + */ + public ApplicationGatewayFirewallRuleSet withTiers(List tiers) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFirewallRuleSetPropertiesFormat(); + } + this.innerProperties().withTiers(tiers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFirewallRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFirewallRuleSet if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayFirewallRuleSet. + */ + public static ApplicationGatewayFirewallRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFirewallRuleSet deserializedApplicationGatewayFirewallRuleSet + = new ApplicationGatewayFirewallRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSet.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSet.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSet.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedApplicationGatewayFirewallRuleSet.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSet.innerProperties + = ApplicationGatewayFirewallRuleSetPropertiesFormat.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedApplicationGatewayFirewallRuleSet.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFirewallRuleSet; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallUserSessionVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallUserSessionVariable.java new file mode 100644 index 0000000000000..eca5effd05f1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFirewallUserSessionVariable.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * User Session clause variable. + */ +public final class ApplicationGatewayFirewallUserSessionVariable + extends ExpandableStringEnum { + /** + * Static value ClientAddr for ApplicationGatewayFirewallUserSessionVariable. + */ + public static final ApplicationGatewayFirewallUserSessionVariable CLIENT_ADDR = fromString("ClientAddr"); + + /** + * Static value GeoLocation for ApplicationGatewayFirewallUserSessionVariable. + */ + public static final ApplicationGatewayFirewallUserSessionVariable GEO_LOCATION = fromString("GeoLocation"); + + /** + * Static value None for ApplicationGatewayFirewallUserSessionVariable. + */ + public static final ApplicationGatewayFirewallUserSessionVariable NONE = fromString("None"); + + /** + * Creates a new instance of ApplicationGatewayFirewallUserSessionVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayFirewallUserSessionVariable() { + } + + /** + * Creates or finds a ApplicationGatewayFirewallUserSessionVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayFirewallUserSessionVariable. + */ + public static ApplicationGatewayFirewallUserSessionVariable fromString(String name) { + return fromString(name, ApplicationGatewayFirewallUserSessionVariable.class); + } + + /** + * Gets known ApplicationGatewayFirewallUserSessionVariable values. + * + * @return known ApplicationGatewayFirewallUserSessionVariable values. + */ + public static Collection values() { + return values(ApplicationGatewayFirewallUserSessionVariable.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayForContainersReferenceDefinition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayForContainersReferenceDefinition.java new file mode 100644 index 0000000000000..4e48884c045af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayForContainersReferenceDefinition.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines an application gateway for containers reference. + */ +@Fluent +public final class ApplicationGatewayForContainersReferenceDefinition + implements JsonSerializable { + /* + * Resource Id of the application gateway for containers. + */ + private String id; + + /** + * Creates an instance of ApplicationGatewayForContainersReferenceDefinition class. + */ + public ApplicationGatewayForContainersReferenceDefinition() { + } + + /** + * Get the id property: Resource Id of the application gateway for containers. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Id of the application gateway for containers. + * + * @param id the id value to set. + * @return the ApplicationGatewayForContainersReferenceDefinition object itself. + */ + public ApplicationGatewayForContainersReferenceDefinition 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.atError() + .log(new IllegalArgumentException( + "Missing required property id in model ApplicationGatewayForContainersReferenceDefinition")); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(ApplicationGatewayForContainersReferenceDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayForContainersReferenceDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayForContainersReferenceDefinition if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayForContainersReferenceDefinition. + */ + public static ApplicationGatewayForContainersReferenceDefinition fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayForContainersReferenceDefinition deserializedApplicationGatewayForContainersReferenceDefinition + = new ApplicationGatewayForContainersReferenceDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayForContainersReferenceDefinition.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayForContainersReferenceDefinition; + }); + } +} 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..d96cff5b57fdf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendIpConfiguration.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFrontendIpConfigurationPropertiesFormat; +import java.io.IOException; + +/** + * Frontend IP configuration of an application gateway. + */ +@Fluent +public final class ApplicationGatewayFrontendIpConfiguration extends SubResource { + /* + * Properties of the application gateway frontend IP configuration. + */ + private ApplicationGatewayFrontendIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the frontend IP configuration that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayFrontendIpConfiguration class. + */ + public ApplicationGatewayFrontendIpConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the application gateway frontend IP configuration. + * + * @return the innerProperties value. + */ + private ApplicationGatewayFrontendIpConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayFrontendIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateIpAddress property: PrivateIPAddress of the network interface IP Configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + /** + * Get the subnet property: Reference to the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the publicIpAddress property: Reference to the PublicIP resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateLinkConfiguration property: Reference to the application gateway private link configuration. + * + * @return the privateLinkConfiguration value. + */ + public SubResource privateLinkConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFrontendIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPrivateLinkConfiguration(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFrontendIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFrontendIpConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayFrontendIpConfiguration. + */ + public static ApplicationGatewayFrontendIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFrontendIpConfiguration deserializedApplicationGatewayFrontendIpConfiguration + = new ApplicationGatewayFrontendIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfiguration.innerProperties + = ApplicationGatewayFrontendIpConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfiguration.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayFrontendIpConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFrontendIpConfiguration; + }); + } +} 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..e4c760a064755 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayFrontendPort.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayFrontendPortPropertiesFormat; +import java.io.IOException; + +/** + * Frontend port of an application gateway. + */ +@Fluent +public final class ApplicationGatewayFrontendPort extends SubResource { + /* + * Properties of the application gateway frontend port. + */ + private ApplicationGatewayFrontendPortPropertiesFormat innerProperties; + + /* + * Name of the frontend port that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayFrontendPort class. + */ + public ApplicationGatewayFrontendPort() { + } + + /** + * Get the innerProperties property: Properties of the application gateway frontend port. + * + * @return the innerProperties value. + */ + private ApplicationGatewayFrontendPortPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayFrontendPort withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the port property: Frontend port. + * + * @return the port value. + */ + public Integer port() { + return this.innerProperties() == null ? null : this.innerProperties().port(); + } + + /** + * Set the port property: Frontend port. + * + * @param port the port value to set. + * @return the ApplicationGatewayFrontendPort object itself. + */ + public ApplicationGatewayFrontendPort withPort(Integer port) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayFrontendPortPropertiesFormat(); + } + this.innerProperties().withPort(port); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the frontend port resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayFrontendPort from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayFrontendPort if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayFrontendPort. + */ + public static ApplicationGatewayFrontendPort fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayFrontendPort deserializedApplicationGatewayFrontendPort + = new ApplicationGatewayFrontendPort(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayFrontendPort.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayFrontendPort.innerProperties + = ApplicationGatewayFrontendPortPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayFrontendPort.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayFrontendPort.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayFrontendPort.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayFrontendPort; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayGlobalConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayGlobalConfiguration.java new file mode 100644 index 0000000000000..7838fe0dc2674 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayGlobalConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Application Gateway global configuration. + */ +@Fluent +public final class ApplicationGatewayGlobalConfiguration + implements JsonSerializable { + /* + * Enable request buffering. + */ + private Boolean enableRequestBuffering; + + /* + * Enable response buffering. + */ + private Boolean enableResponseBuffering; + + /** + * Creates an instance of ApplicationGatewayGlobalConfiguration class. + */ + public ApplicationGatewayGlobalConfiguration() { + } + + /** + * Get the enableRequestBuffering property: Enable request buffering. + * + * @return the enableRequestBuffering value. + */ + public Boolean enableRequestBuffering() { + return this.enableRequestBuffering; + } + + /** + * Set the enableRequestBuffering property: Enable request buffering. + * + * @param enableRequestBuffering the enableRequestBuffering value to set. + * @return the ApplicationGatewayGlobalConfiguration object itself. + */ + public ApplicationGatewayGlobalConfiguration withEnableRequestBuffering(Boolean enableRequestBuffering) { + this.enableRequestBuffering = enableRequestBuffering; + return this; + } + + /** + * Get the enableResponseBuffering property: Enable response buffering. + * + * @return the enableResponseBuffering value. + */ + public Boolean enableResponseBuffering() { + return this.enableResponseBuffering; + } + + /** + * Set the enableResponseBuffering property: Enable response buffering. + * + * @param enableResponseBuffering the enableResponseBuffering value to set. + * @return the ApplicationGatewayGlobalConfiguration object itself. + */ + public ApplicationGatewayGlobalConfiguration withEnableResponseBuffering(Boolean enableResponseBuffering) { + this.enableResponseBuffering = enableResponseBuffering; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableRequestBuffering", this.enableRequestBuffering); + jsonWriter.writeBooleanField("enableResponseBuffering", this.enableResponseBuffering); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayGlobalConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayGlobalConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayGlobalConfiguration. + */ + public static ApplicationGatewayGlobalConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayGlobalConfiguration deserializedApplicationGatewayGlobalConfiguration + = new ApplicationGatewayGlobalConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableRequestBuffering".equals(fieldName)) { + deserializedApplicationGatewayGlobalConfiguration.enableRequestBuffering + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableResponseBuffering".equals(fieldName)) { + deserializedApplicationGatewayGlobalConfiguration.enableResponseBuffering + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayGlobalConfiguration; + }); + } +} 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..cc01bedf744b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHeaderConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Header configuration of the Actions set in Application Gateway. + */ +@Fluent +public final class ApplicationGatewayHeaderConfiguration + implements JsonSerializable { + /* + * Header name of the header configuration. + */ + private String headerName; + + /* + * An optional field under "Rewrite Action". It lets you capture and modify the value(s) of a specific header when + * multiple headers with the same name exist. Currently supported for Set-Cookie Response header only. For more + * details, visit https://aka.ms/appgwheadercrud + */ + private HeaderValueMatcher headerValueMatcher; + + /* + * Header value of the header configuration. + */ + private String headerValue; + + /** + * Creates an instance of ApplicationGatewayHeaderConfiguration class. + */ + public ApplicationGatewayHeaderConfiguration() { + } + + /** + * 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 headerValueMatcher property: An optional field under "Rewrite Action". It lets you capture and modify the + * value(s) of a specific header when multiple headers with the same name exist. Currently supported for Set-Cookie + * Response header only. For more details, visit https://aka.ms/appgwheadercrud. + * + * @return the headerValueMatcher value. + */ + public HeaderValueMatcher headerValueMatcher() { + return this.headerValueMatcher; + } + + /** + * Set the headerValueMatcher property: An optional field under "Rewrite Action". It lets you capture and modify the + * value(s) of a specific header when multiple headers with the same name exist. Currently supported for Set-Cookie + * Response header only. For more details, visit https://aka.ms/appgwheadercrud. + * + * @param headerValueMatcher the headerValueMatcher value to set. + * @return the ApplicationGatewayHeaderConfiguration object itself. + */ + public ApplicationGatewayHeaderConfiguration withHeaderValueMatcher(HeaderValueMatcher headerValueMatcher) { + this.headerValueMatcher = headerValueMatcher; + 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() { + if (headerValueMatcher() != null) { + headerValueMatcher().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("headerName", this.headerName); + jsonWriter.writeJsonField("headerValueMatcher", this.headerValueMatcher); + jsonWriter.writeStringField("headerValue", this.headerValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayHeaderConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayHeaderConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayHeaderConfiguration. + */ + public static ApplicationGatewayHeaderConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayHeaderConfiguration deserializedApplicationGatewayHeaderConfiguration + = new ApplicationGatewayHeaderConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("headerName".equals(fieldName)) { + deserializedApplicationGatewayHeaderConfiguration.headerName = reader.getString(); + } else if ("headerValueMatcher".equals(fieldName)) { + deserializedApplicationGatewayHeaderConfiguration.headerValueMatcher + = HeaderValueMatcher.fromJson(reader); + } else if ("headerValue".equals(fieldName)) { + deserializedApplicationGatewayHeaderConfiguration.headerValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayHeaderConfiguration; + }); + } +} 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..cac80618fbe4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayHttpListener.java @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayHttpListenerPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Http listener of an application gateway. + */ +@Fluent +public final class ApplicationGatewayHttpListener extends SubResource { + /* + * Properties of the application gateway HTTP listener. + */ + private ApplicationGatewayHttpListenerPropertiesFormat innerProperties; + + /* + * Name of the HTTP listener that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayHttpListener class. + */ + public ApplicationGatewayHttpListener() { + } + + /** + * Get the innerProperties property: Properties of the application gateway HTTP listener. + * + * @return the innerProperties value. + */ + private ApplicationGatewayHttpListenerPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayHttpListener withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withFrontendIpConfiguration(frontendIpConfiguration); + return this; + } + + /** + * Get the frontendPort property: Frontend port resource of an application gateway. + * + * @return the frontendPort value. + */ + public SubResource frontendPort() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withFrontendPort(frontendPort); + return this; + } + + /** + * Get the protocol property: Protocol of the HTTP listener. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the hostname property: Host name of HTTP listener. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withHostname(hostname); + return this; + } + + /** + * Get the sslCertificate property: SSL certificate resource of an application gateway. + * + * @return the sslCertificate value. + */ + public SubResource sslCertificate() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withSslCertificate(sslCertificate); + return this; + } + + /** + * Get the sslProfile property: SSL profile resource of the application gateway. + * + * @return the sslProfile value. + */ + public SubResource sslProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withSslProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withRequireServerNameIndication(requireServerNameIndication); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the HTTP listener resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the customErrorConfigurations property: Custom error configurations of the HTTP listener. + * + * @return the customErrorConfigurations value. + */ + public List customErrorConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withCustomErrorConfigurations(customErrorConfigurations); + return this; + } + + /** + * Get the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withFirewallPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayHttpListenerPropertiesFormat(); + } + this.innerProperties().withHostNames(hostNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayHttpListener from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayHttpListener if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayHttpListener. + */ + public static ApplicationGatewayHttpListener fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayHttpListener deserializedApplicationGatewayHttpListener + = new ApplicationGatewayHttpListener(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayHttpListener.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayHttpListener.innerProperties + = ApplicationGatewayHttpListenerPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayHttpListener.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayHttpListener.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayHttpListener.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayHttpListener; + }); + } +} 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..2c0ab293a8811 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayIpConfiguration.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayIpConfigurationPropertiesFormat; +import java.io.IOException; + +/** + * IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. + */ +@Fluent +public final class ApplicationGatewayIpConfiguration extends SubResource { + /* + * Properties of the application gateway IP configuration. + */ + private ApplicationGatewayIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the IP configuration that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayIpConfiguration class. + */ + public ApplicationGatewayIpConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the application gateway IP configuration. + * + * @return the innerProperties value. + */ + private ApplicationGatewayIpConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayIpConfigurationPropertiesFormat(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayIpConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayIpConfiguration. + */ + public static ApplicationGatewayIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayIpConfiguration deserializedApplicationGatewayIpConfiguration + = new ApplicationGatewayIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayIpConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayIpConfiguration.innerProperties + = ApplicationGatewayIpConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayIpConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayIpConfiguration.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayIpConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayIpConfiguration; + }); + } +} 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..cb4a7c20cbfdb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListApplicationGateways API service call. + */ +@Fluent +public final class ApplicationGatewayListResult implements JsonSerializable { + /* + * List of an application gateways in a resource group. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ApplicationGatewayListResult class. + */ + public ApplicationGatewayListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayListResult. + */ + public static ApplicationGatewayListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayListResult deserializedApplicationGatewayListResult = new ApplicationGatewayListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApplicationGatewayInner.fromJson(reader1)); + deserializedApplicationGatewayListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationGatewayListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListener.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListener.java new file mode 100644 index 0000000000000..b2ea478df6b19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayListener.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayListenerPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Listener of an application gateway. + */ +@Fluent +public final class ApplicationGatewayListener extends SubResource { + /* + * Properties of the application gateway listener. + */ + private ApplicationGatewayListenerPropertiesFormat innerProperties; + + /* + * Name of the listener that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayListener class. + */ + public ApplicationGatewayListener() { + } + + /** + * Get the innerProperties property: Properties of the application gateway listener. + * + * @return the innerProperties value. + */ + private ApplicationGatewayListenerPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the name property: Name of the 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 listener that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayListener object itself. + */ + public ApplicationGatewayListener 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayListener withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().frontendIpConfiguration(); + } + + /** + * Set the frontendIpConfiguration property: Frontend IP configuration resource of an application gateway. + * + * @param frontendIpConfiguration the frontendIpConfiguration value to set. + * @return the ApplicationGatewayListener object itself. + */ + public ApplicationGatewayListener withFrontendIpConfiguration(SubResource frontendIpConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayListenerPropertiesFormat(); + } + this.innerProperties().withFrontendIpConfiguration(frontendIpConfiguration); + return this; + } + + /** + * Get the frontendPort property: Frontend port resource of an application gateway. + * + * @return the frontendPort value. + */ + public SubResource frontendPort() { + return this.innerProperties() == null ? null : this.innerProperties().frontendPort(); + } + + /** + * Set the frontendPort property: Frontend port resource of an application gateway. + * + * @param frontendPort the frontendPort value to set. + * @return the ApplicationGatewayListener object itself. + */ + public ApplicationGatewayListener withFrontendPort(SubResource frontendPort) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayListenerPropertiesFormat(); + } + this.innerProperties().withFrontendPort(frontendPort); + return this; + } + + /** + * Get the protocol property: Protocol of the listener. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Set the protocol property: Protocol of the listener. + * + * @param protocol the protocol value to set. + * @return the ApplicationGatewayListener object itself. + */ + public ApplicationGatewayListener withProtocol(ApplicationGatewayProtocol protocol) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayListenerPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the sslCertificate property: SSL certificate resource of an application gateway. + * + * @return the sslCertificate value. + */ + public SubResource sslCertificate() { + return this.innerProperties() == null ? null : this.innerProperties().sslCertificate(); + } + + /** + * Set the sslCertificate property: SSL certificate resource of an application gateway. + * + * @param sslCertificate the sslCertificate value to set. + * @return the ApplicationGatewayListener object itself. + */ + public ApplicationGatewayListener withSslCertificate(SubResource sslCertificate) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayListenerPropertiesFormat(); + } + this.innerProperties().withSslCertificate(sslCertificate); + return this; + } + + /** + * Get the sslProfile property: SSL profile resource of the application gateway. + * + * @return the sslProfile value. + */ + public SubResource sslProfile() { + return this.innerProperties() == null ? null : this.innerProperties().sslProfile(); + } + + /** + * Set the sslProfile property: SSL profile resource of the application gateway. + * + * @param sslProfile the sslProfile value to set. + * @return the ApplicationGatewayListener object itself. + */ + public ApplicationGatewayListener withSslProfile(SubResource sslProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayListenerPropertiesFormat(); + } + this.innerProperties().withSslProfile(sslProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the listener resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the hostNames property: List of Server Name Indications(SNI) for TLS Multi-site Listener that allows special + * wildcard characters as well. + * + * @return the hostNames value. + */ + public List hostNames() { + return this.innerProperties() == null ? null : this.innerProperties().hostNames(); + } + + /** + * Set the hostNames property: List of Server Name Indications(SNI) for TLS Multi-site Listener that allows special + * wildcard characters as well. + * + * @param hostNames the hostNames value to set. + * @return the ApplicationGatewayListener object itself. + */ + public ApplicationGatewayListener withHostNames(List hostNames) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayListenerPropertiesFormat(); + } + this.innerProperties().withHostNames(hostNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayListener from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayListener if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayListener. + */ + public static ApplicationGatewayListener fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayListener deserializedApplicationGatewayListener = new ApplicationGatewayListener(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayListener.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayListener.innerProperties + = ApplicationGatewayListenerPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayListener.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayListener.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayListener.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayListener; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionAlgorithm.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionAlgorithm.java new file mode 100644 index 0000000000000..57f94e9e44dd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionAlgorithm.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Load Distribution Algorithm enums. + */ +public final class ApplicationGatewayLoadDistributionAlgorithm + extends ExpandableStringEnum { + /** + * Static value RoundRobin for ApplicationGatewayLoadDistributionAlgorithm. + */ + public static final ApplicationGatewayLoadDistributionAlgorithm ROUND_ROBIN = fromString("RoundRobin"); + + /** + * Static value LeastConnections for ApplicationGatewayLoadDistributionAlgorithm. + */ + public static final ApplicationGatewayLoadDistributionAlgorithm LEAST_CONNECTIONS = fromString("LeastConnections"); + + /** + * Static value IpHash for ApplicationGatewayLoadDistributionAlgorithm. + */ + public static final ApplicationGatewayLoadDistributionAlgorithm IP_HASH = fromString("IpHash"); + + /** + * Creates a new instance of ApplicationGatewayLoadDistributionAlgorithm value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayLoadDistributionAlgorithm() { + } + + /** + * Creates or finds a ApplicationGatewayLoadDistributionAlgorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayLoadDistributionAlgorithm. + */ + public static ApplicationGatewayLoadDistributionAlgorithm fromString(String name) { + return fromString(name, ApplicationGatewayLoadDistributionAlgorithm.class); + } + + /** + * Gets known ApplicationGatewayLoadDistributionAlgorithm values. + * + * @return known ApplicationGatewayLoadDistributionAlgorithm values. + */ + public static Collection values() { + return values(ApplicationGatewayLoadDistributionAlgorithm.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionPolicy.java new file mode 100644 index 0000000000000..258e8897652ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionPolicy.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayLoadDistributionPolicyPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Load Distribution Policy of an application gateway. + */ +@Fluent +public final class ApplicationGatewayLoadDistributionPolicy extends SubResource { + /* + * Properties of the application gateway load distribution policy. + */ + private ApplicationGatewayLoadDistributionPolicyPropertiesFormat innerProperties; + + /* + * Name of the load distribution policy that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayLoadDistributionPolicy class. + */ + public ApplicationGatewayLoadDistributionPolicy() { + } + + /** + * Get the innerProperties property: Properties of the application gateway load distribution policy. + * + * @return the innerProperties value. + */ + private ApplicationGatewayLoadDistributionPolicyPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the name property: Name of the load distribution policy that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the load distribution policy that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayLoadDistributionPolicy object itself. + */ + public ApplicationGatewayLoadDistributionPolicy 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayLoadDistributionPolicy withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the loadDistributionTargets property: Load Distribution Targets resource of an application gateway. + * + * @return the loadDistributionTargets value. + */ + public List loadDistributionTargets() { + return this.innerProperties() == null ? null : this.innerProperties().loadDistributionTargets(); + } + + /** + * Set the loadDistributionTargets property: Load Distribution Targets resource of an application gateway. + * + * @param loadDistributionTargets the loadDistributionTargets value to set. + * @return the ApplicationGatewayLoadDistributionPolicy object itself. + */ + public ApplicationGatewayLoadDistributionPolicy + withLoadDistributionTargets(List loadDistributionTargets) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayLoadDistributionPolicyPropertiesFormat(); + } + this.innerProperties().withLoadDistributionTargets(loadDistributionTargets); + return this; + } + + /** + * Get the loadDistributionAlgorithm property: Load Distribution Targets resource of an application gateway. + * + * @return the loadDistributionAlgorithm value. + */ + public ApplicationGatewayLoadDistributionAlgorithm loadDistributionAlgorithm() { + return this.innerProperties() == null ? null : this.innerProperties().loadDistributionAlgorithm(); + } + + /** + * Set the loadDistributionAlgorithm property: Load Distribution Targets resource of an application gateway. + * + * @param loadDistributionAlgorithm the loadDistributionAlgorithm value to set. + * @return the ApplicationGatewayLoadDistributionPolicy object itself. + */ + public ApplicationGatewayLoadDistributionPolicy + withLoadDistributionAlgorithm(ApplicationGatewayLoadDistributionAlgorithm loadDistributionAlgorithm) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayLoadDistributionPolicyPropertiesFormat(); + } + this.innerProperties().withLoadDistributionAlgorithm(loadDistributionAlgorithm); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the Load Distribution Policy resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayLoadDistributionPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayLoadDistributionPolicy if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayLoadDistributionPolicy. + */ + public static ApplicationGatewayLoadDistributionPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayLoadDistributionPolicy deserializedApplicationGatewayLoadDistributionPolicy + = new ApplicationGatewayLoadDistributionPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionPolicy.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionPolicy.innerProperties + = ApplicationGatewayLoadDistributionPolicyPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionPolicy.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionPolicy.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionPolicy.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayLoadDistributionPolicy; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionTarget.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionTarget.java new file mode 100644 index 0000000000000..0829971207131 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayLoadDistributionTarget.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayLoadDistributionTargetPropertiesFormat; +import java.io.IOException; + +/** + * Load Distribution Target of an application gateway. + */ +@Fluent +public final class ApplicationGatewayLoadDistributionTarget extends SubResource { + /* + * Properties of the application gateway load distribution target. + */ + private ApplicationGatewayLoadDistributionTargetPropertiesFormat innerProperties; + + /* + * Name of the load distribution policy that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayLoadDistributionTarget class. + */ + public ApplicationGatewayLoadDistributionTarget() { + } + + /** + * Get the innerProperties property: Properties of the application gateway load distribution target. + * + * @return the innerProperties value. + */ + private ApplicationGatewayLoadDistributionTargetPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the name property: Name of the load distribution policy that is unique within an Application Gateway. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the load distribution policy that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayLoadDistributionTarget object itself. + */ + public ApplicationGatewayLoadDistributionTarget 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayLoadDistributionTarget withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the weightPerServer property: Weight per server. Range between 1 and 100. + * + * @return the weightPerServer value. + */ + public Integer weightPerServer() { + return this.innerProperties() == null ? null : this.innerProperties().weightPerServer(); + } + + /** + * Set the weightPerServer property: Weight per server. Range between 1 and 100. + * + * @param weightPerServer the weightPerServer value to set. + * @return the ApplicationGatewayLoadDistributionTarget object itself. + */ + public ApplicationGatewayLoadDistributionTarget withWeightPerServer(Integer weightPerServer) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayLoadDistributionTargetPropertiesFormat(); + } + this.innerProperties().withWeightPerServer(weightPerServer); + return this; + } + + /** + * Get the backendAddressPool property: Backend address pool resource of the application gateway. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.innerProperties() == null ? null : this.innerProperties().backendAddressPool(); + } + + /** + * Set the backendAddressPool property: Backend address pool resource of the application gateway. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayLoadDistributionTarget object itself. + */ + public ApplicationGatewayLoadDistributionTarget withBackendAddressPool(SubResource backendAddressPool) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayLoadDistributionTargetPropertiesFormat(); + } + this.innerProperties().withBackendAddressPool(backendAddressPool); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayLoadDistributionTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayLoadDistributionTarget if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayLoadDistributionTarget. + */ + public static ApplicationGatewayLoadDistributionTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayLoadDistributionTarget deserializedApplicationGatewayLoadDistributionTarget + = new ApplicationGatewayLoadDistributionTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionTarget.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionTarget.innerProperties + = ApplicationGatewayLoadDistributionTargetPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionTarget.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionTarget.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayLoadDistributionTarget.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayLoadDistributionTarget; + }); + } +} 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..d3e32aa2315ea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOnDemandProbe.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details of on demand test probe request. + */ +@Fluent +public final class ApplicationGatewayOnDemandProbe implements JsonSerializable { + /* + * The protocol used for the probe. + */ + private ApplicationGatewayProtocol protocol; + + /* + * Host name to send the probe to. + */ + private String host; + + /* + * Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. + */ + 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. + */ + private Integer timeout; + + /* + * Whether the host header should be picked from the backend http settings. Default value is false. + */ + private Boolean pickHostnameFromBackendHttpSettings; + + /* + * Criterion for classifying a healthy probe response. + */ + private ApplicationGatewayProbeHealthResponseMatch match; + + /* + * Reference to backend pool of application gateway to which probe request will be sent. + */ + private SubResource backendAddressPool; + + /* + * Reference to backend http setting of application gateway to be used for test probe. + */ + private SubResource backendHttpSettings; + + /** + * Creates an instance of ApplicationGatewayOnDemandProbe class. + */ + public ApplicationGatewayOnDemandProbe() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeNumberField("timeout", this.timeout); + jsonWriter.writeBooleanField("pickHostNameFromBackendHttpSettings", this.pickHostnameFromBackendHttpSettings); + jsonWriter.writeJsonField("match", this.match); + jsonWriter.writeJsonField("backendAddressPool", this.backendAddressPool); + jsonWriter.writeJsonField("backendHttpSettings", this.backendHttpSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayOnDemandProbe from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayOnDemandProbe if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayOnDemandProbe. + */ + public static ApplicationGatewayOnDemandProbe fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayOnDemandProbe deserializedApplicationGatewayOnDemandProbe + = new ApplicationGatewayOnDemandProbe(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.protocol + = ApplicationGatewayProtocol.fromString(reader.getString()); + } else if ("host".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.host = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.path = reader.getString(); + } else if ("timeout".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.timeout = reader.getNullable(JsonReader::getInt); + } else if ("pickHostNameFromBackendHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.pickHostnameFromBackendHttpSettings + = reader.getNullable(JsonReader::getBoolean); + } else if ("match".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.match + = ApplicationGatewayProbeHealthResponseMatch.fromJson(reader); + } else if ("backendAddressPool".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.backendAddressPool = SubResource.fromJson(reader); + } else if ("backendHttpSettings".equals(fieldName)) { + deserializedApplicationGatewayOnDemandProbe.backendHttpSettings = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayOnDemandProbe; + }); + } +} 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..cc4d7a2690fa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayOperationalState.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 java.util.Collection; + +/** + * Operational state of the application gateway resource. + */ +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 a new instance of ApplicationGatewayOperationalState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayOperationalState() { + } + + /** + * Creates or finds a ApplicationGatewayOperationalState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayOperationalState. + */ + public static ApplicationGatewayOperationalState fromString(String name) { + return fromString(name, ApplicationGatewayOperationalState.class); + } + + /** + * Gets known ApplicationGatewayOperationalState values. + * + * @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..fe4d998fedb5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPathRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPathRulePropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Path rule of URL path map of an application gateway. + */ +@Fluent +public final class ApplicationGatewayPathRule extends SubResource { + /* + * Properties of the application gateway path rule. + */ + private ApplicationGatewayPathRulePropertiesFormat innerProperties; + + /* + * Name of the path rule that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayPathRule class. + */ + public ApplicationGatewayPathRule() { + } + + /** + * Get the innerProperties property: Properties of the application gateway path rule. + * + * @return the innerProperties value. + */ + private ApplicationGatewayPathRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayPathRule withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the paths property: Path rules of URL path map. + * + * @return the paths value. + */ + public List paths() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); + } + this.innerProperties().withPaths(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); + } + this.innerProperties().withBackendAddressPool(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); + } + this.innerProperties().withBackendHttpSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); + } + this.innerProperties().withRedirectConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); + } + this.innerProperties().withRewriteRuleSet(rewriteRuleSet); + return this; + } + + /** + * Get the loadDistributionPolicy property: Load Distribution Policy resource of URL path map path rule. + * + * @return the loadDistributionPolicy value. + */ + public SubResource loadDistributionPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().loadDistributionPolicy(); + } + + /** + * Set the loadDistributionPolicy property: Load Distribution Policy resource of URL path map path rule. + * + * @param loadDistributionPolicy the loadDistributionPolicy value to set. + * @return the ApplicationGatewayPathRule object itself. + */ + public ApplicationGatewayPathRule withLoadDistributionPolicy(SubResource loadDistributionPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); + } + this.innerProperties().withLoadDistributionPolicy(loadDistributionPolicy); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the path rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the firewallPolicy property: Reference to the FirewallPolicy resource. + * + * @return the firewallPolicy value. + */ + public SubResource firewallPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPathRulePropertiesFormat(); + } + this.innerProperties().withFirewallPolicy(firewallPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPathRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPathRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPathRule. + */ + public static ApplicationGatewayPathRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPathRule deserializedApplicationGatewayPathRule = new ApplicationGatewayPathRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayPathRule.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayPathRule.innerProperties + = ApplicationGatewayPathRulePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayPathRule.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayPathRule.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayPathRule.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPathRule; + }); + } +} 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..0243dfe00b49a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnection.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.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..a6f672fa2db3c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections + * for an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * List of private endpoint connections on an application gateway. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ApplicationGatewayPrivateEndpointConnectionListResult class. + */ + public ApplicationGatewayPrivateEndpointConnectionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateEndpointConnectionListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateEndpointConnectionListResult. + */ + public static ApplicationGatewayPrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateEndpointConnectionListResult deserializedApplicationGatewayPrivateEndpointConnectionListResult + = new ApplicationGatewayPrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> ApplicationGatewayPrivateEndpointConnectionInner.fromJson(reader1)); + deserializedApplicationGatewayPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationGatewayPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateEndpointConnectionListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..bcf9cf68db4ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnectionProperties.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.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionPropertiesInner; + +/** + * An immutable client-side representation of ApplicationGatewayPrivateEndpointConnectionProperties. + */ +public interface ApplicationGatewayPrivateEndpointConnectionProperties { + /** + * 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.ApplicationGatewayPrivateEndpointConnectionPropertiesInner + * object. + * + * @return the inner object. + */ + ApplicationGatewayPrivateEndpointConnectionPropertiesInner innerModel(); +} 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..20f3c23579919 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateEndpointConnections.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, + String applicationGatewayName, String connectionName, 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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..a9145ec3dfb47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkConfiguration.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkConfigurationProperties; +import java.io.IOException; +import java.util.List; + +/** + * Private Link Configuration on an application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkConfiguration extends SubResource { + /* + * Properties of the application gateway private link configuration. + */ + private ApplicationGatewayPrivateLinkConfigurationProperties innerProperties; + + /* + * Name of the private link configuration that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayPrivateLinkConfiguration class. + */ + public ApplicationGatewayPrivateLinkConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the application gateway private link configuration. + * + * @return the innerProperties value. + */ + private ApplicationGatewayPrivateLinkConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayPrivateLinkConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the ipConfigurations property: An array of application gateway private link ip configurations. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPrivateLinkConfigurationProperties(); + } + this.innerProperties().withIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateLinkConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateLinkConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateLinkConfiguration. + */ + public static ApplicationGatewayPrivateLinkConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateLinkConfiguration deserializedApplicationGatewayPrivateLinkConfiguration + = new ApplicationGatewayPrivateLinkConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkConfiguration.innerProperties + = ApplicationGatewayPrivateLinkConfigurationProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkConfiguration.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateLinkConfiguration; + }); + } +} 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..024dbe272f4cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkIpConfiguration.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkIpConfigurationProperties; +import java.io.IOException; + +/** + * The application gateway private link ip configuration. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkIpConfiguration extends SubResource { + /* + * Properties of an application gateway private link ip configuration. + */ + private ApplicationGatewayPrivateLinkIpConfigurationProperties innerProperties; + + /* + * The name of application gateway private link ip configuration. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The resource type. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayPrivateLinkIpConfiguration class. + */ + public ApplicationGatewayPrivateLinkIpConfiguration() { + } + + /** + * Get the innerProperties property: Properties of an application gateway private link ip configuration. + * + * @return the innerProperties value. + */ + private ApplicationGatewayPrivateLinkIpConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayPrivateLinkIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateIpAddress property: The private IP address of the IP configuration. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPrivateLinkIpConfigurationProperties(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPrivateLinkIpConfigurationProperties(); + } + this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + /** + * Get the subnet property: Reference to the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPrivateLinkIpConfigurationProperties(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the primary property: Whether the ip configuration is primary or not. + * + * @return the primary value. + */ + public Boolean primary() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayPrivateLinkIpConfigurationProperties(); + } + this.innerProperties().withPrimary(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateLinkIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateLinkIpConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateLinkIpConfiguration. + */ + public static ApplicationGatewayPrivateLinkIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateLinkIpConfiguration deserializedApplicationGatewayPrivateLinkIpConfiguration + = new ApplicationGatewayPrivateLinkIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfiguration.innerProperties + = ApplicationGatewayPrivateLinkIpConfigurationProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfiguration.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkIpConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateLinkIpConfiguration; + }); + } +} 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..599b58c4f6cef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResource.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.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..1b654a27ed2fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResourceListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListApplicationGatewayPrivateLinkResources API service call. Gets all private link resources for an + * application gateway. + */ +@Fluent +public final class ApplicationGatewayPrivateLinkResourceListResult + implements JsonSerializable { + /* + * List of private link resources of an application gateway. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ApplicationGatewayPrivateLinkResourceListResult class. + */ + public ApplicationGatewayPrivateLinkResourceListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayPrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayPrivateLinkResourceListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayPrivateLinkResourceListResult. + */ + public static ApplicationGatewayPrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayPrivateLinkResourceListResult deserializedApplicationGatewayPrivateLinkResourceListResult + = new ApplicationGatewayPrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApplicationGatewayPrivateLinkResourceInner.fromJson(reader1)); + deserializedApplicationGatewayPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationGatewayPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayPrivateLinkResourceListResult; + }); + } +} 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..43eb3871b84d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayPrivateLinkResources.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.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..b0eade4f12ed9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbe.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayProbePropertiesFormat; +import java.io.IOException; + +/** + * Probe of the application gateway. + */ +@Fluent +public final class ApplicationGatewayProbe extends SubResource { + /* + * Properties of the application gateway probe. + */ + private ApplicationGatewayProbePropertiesFormat innerProperties; + + /* + * Name of the probe that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayProbe class. + */ + public ApplicationGatewayProbe() { + } + + /** + * Get the innerProperties property: Properties of the application gateway probe. + * + * @return the innerProperties value. + */ + private ApplicationGatewayProbePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayProbe withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the protocol property: The protocol used for the probe. + * + * @return the protocol value. + */ + public ApplicationGatewayProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the host property: Host name to send the probe to. + * + * @return the host value. + */ + public String host() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withHost(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withPath(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withInterval(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withTimeout(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withUnhealthyThreshold(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withPickHostnameFromBackendHttpSettings(pickHostnameFromBackendHttpSettings); + return this; + } + + /** + * Get the pickHostnameFromBackendSettings property: Whether the server name indication should be picked from the + * backend settings for Tls protocol. Default value is false. + * + * @return the pickHostnameFromBackendSettings value. + */ + public Boolean pickHostnameFromBackendSettings() { + return this.innerProperties() == null ? null : this.innerProperties().pickHostnameFromBackendSettings(); + } + + /** + * Set the pickHostnameFromBackendSettings property: Whether the server name indication should be picked from the + * backend settings for Tls protocol. Default value is false. + * + * @param pickHostnameFromBackendSettings the pickHostnameFromBackendSettings value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPickHostnameFromBackendSettings(Boolean pickHostnameFromBackendSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withPickHostnameFromBackendSettings(pickHostnameFromBackendSettings); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withMinServers(minServers); + return this; + } + + /** + * Get the match property: Criterion for classifying a healthy probe response. + * + * @return the match value. + */ + public ApplicationGatewayProbeHealthResponseMatch match() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withMatch(match); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the probe resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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 Basic, + * Standard_v2 and WAF_v2 only. + * + * @return the port value. + */ + public Integer port() { + return this.innerProperties() == null ? null : this.innerProperties().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 Basic, + * Standard_v2 and WAF_v2 only. + * + * @param port the port value to set. + * @return the ApplicationGatewayProbe object itself. + */ + public ApplicationGatewayProbe withPort(Integer port) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayProbePropertiesFormat(); + } + this.innerProperties().withPort(port); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayProbe from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayProbe if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayProbe. + */ + public static ApplicationGatewayProbe fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayProbe deserializedApplicationGatewayProbe = new ApplicationGatewayProbe(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayProbe.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayProbe.innerProperties + = ApplicationGatewayProbePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayProbe.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayProbe.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayProbe.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayProbe; + }); + } +} 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..eca26ad7aacf2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProbeHealthResponseMatch.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Application gateway probe health response match. + */ +@Fluent +public final class ApplicationGatewayProbeHealthResponseMatch + implements JsonSerializable { + /* + * Body that must be contained in the health response. Default value is empty. + */ + private String body; + + /* + * Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. + */ + private List statusCodes; + + /** + * Creates an instance of ApplicationGatewayProbeHealthResponseMatch class. + */ + public ApplicationGatewayProbeHealthResponseMatch() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("body", this.body); + jsonWriter.writeArrayField("statusCodes", this.statusCodes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayProbeHealthResponseMatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayProbeHealthResponseMatch if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayProbeHealthResponseMatch. + */ + public static ApplicationGatewayProbeHealthResponseMatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayProbeHealthResponseMatch deserializedApplicationGatewayProbeHealthResponseMatch + = new ApplicationGatewayProbeHealthResponseMatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("body".equals(fieldName)) { + deserializedApplicationGatewayProbeHealthResponseMatch.body = reader.getString(); + } else if ("statusCodes".equals(fieldName)) { + List statusCodes = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationGatewayProbeHealthResponseMatch.statusCodes = statusCodes; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayProbeHealthResponseMatch; + }); + } +} 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..80baace23ef15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayProtocol.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 java.util.Collection; + +/** + * Application Gateway protocol. + */ +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"); + + /** + * Static value Tcp for ApplicationGatewayProtocol. + */ + public static final ApplicationGatewayProtocol TCP = fromString("Tcp"); + + /** + * Static value Tls for ApplicationGatewayProtocol. + */ + public static final ApplicationGatewayProtocol TLS = fromString("Tls"); + + /** + * Creates a new instance of ApplicationGatewayProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayProtocol() { + } + + /** + * Creates or finds a ApplicationGatewayProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayProtocol. + */ + public static ApplicationGatewayProtocol fromString(String name) { + return fromString(name, ApplicationGatewayProtocol.class); + } + + /** + * Gets known ApplicationGatewayProtocol values. + * + * @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..b56bcc3ba32a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectConfiguration.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRedirectConfigurationPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Redirect configuration of an application gateway. + */ +@Fluent +public final class ApplicationGatewayRedirectConfiguration extends SubResource { + /* + * Properties of the application gateway redirect configuration. + */ + private ApplicationGatewayRedirectConfigurationPropertiesFormat innerProperties; + + /* + * Name of the redirect configuration that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayRedirectConfiguration class. + */ + public ApplicationGatewayRedirectConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the application gateway redirect configuration. + * + * @return the innerProperties value. + */ + private ApplicationGatewayRedirectConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayRedirectConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the redirectType property: HTTP redirection type. + * + * @return the redirectType value. + */ + public ApplicationGatewayRedirectType redirectType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withRedirectType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withTargetListener(targetListener); + return this; + } + + /** + * Get the targetUrl property: Url to redirect the request to. + * + * @return the targetUrl value. + */ + public String targetUrl() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withTargetUrl(targetUrl); + return this; + } + + /** + * Get the includePath property: Include path in the redirected url. + * + * @return the includePath value. + */ + public Boolean includePath() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withIncludePath(includePath); + return this; + } + + /** + * Get the includeQueryString property: Include query string in the redirected url. + * + * @return the includeQueryString value. + */ + public Boolean includeQueryString() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withIncludeQueryString(includeQueryString); + return this; + } + + /** + * Get the requestRoutingRules property: Request routing specifying redirect configuration. + * + * @return the requestRoutingRules value. + */ + public List requestRoutingRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withRequestRoutingRules(requestRoutingRules); + return this; + } + + /** + * Get the urlPathMaps property: Url path maps specifying default redirect configuration. + * + * @return the urlPathMaps value. + */ + public List urlPathMaps() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withUrlPathMaps(urlPathMaps); + return this; + } + + /** + * Get the pathRules property: Path rules specifying redirect configuration. + * + * @return the pathRules value. + */ + public List pathRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRedirectConfigurationPropertiesFormat(); + } + this.innerProperties().withPathRules(pathRules); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRedirectConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRedirectConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRedirectConfiguration. + */ + public static ApplicationGatewayRedirectConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRedirectConfiguration deserializedApplicationGatewayRedirectConfiguration + = new ApplicationGatewayRedirectConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfiguration.innerProperties + = ApplicationGatewayRedirectConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfiguration.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayRedirectConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRedirectConfiguration; + }); + } +} 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..3a954638da68d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRedirectType.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 java.util.Collection; + +/** + * Redirect type enum. + */ +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 a new instance of ApplicationGatewayRedirectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayRedirectType() { + } + + /** + * Creates or finds a ApplicationGatewayRedirectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayRedirectType. + */ + public static ApplicationGatewayRedirectType fromString(String name) { + return fromString(name, ApplicationGatewayRedirectType.class); + } + + /** + * Gets known ApplicationGatewayRedirectType values. + * + * @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..314d747aae3e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRule.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRequestRoutingRulePropertiesFormat; +import java.io.IOException; + +/** + * Request routing rule of an application gateway. + */ +@Fluent +public final class ApplicationGatewayRequestRoutingRule extends SubResource { + /* + * Properties of the application gateway request routing rule. + */ + private ApplicationGatewayRequestRoutingRulePropertiesFormat innerProperties; + + /* + * Name of the request routing rule that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayRequestRoutingRule class. + */ + public ApplicationGatewayRequestRoutingRule() { + } + + /** + * Get the innerProperties property: Properties of the application gateway request routing rule. + * + * @return the innerProperties value. + */ + private ApplicationGatewayRequestRoutingRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayRequestRoutingRule withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the ruleType property: Rule type. + * + * @return the ruleType value. + */ + public ApplicationGatewayRequestRoutingRuleType ruleType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleType(); + } + + /** + * Set the ruleType property: Rule type. + * + * @param ruleType the ruleType value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withRuleType(ruleType); + return this; + } + + /** + * Get the priority property: Priority of the request routing rule. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the backendAddressPool property: Backend address pool resource of the application gateway. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withBackendAddressPool(backendAddressPool); + return this; + } + + /** + * Get the backendHttpSettings property: Backend http settings resource of the application gateway. + * + * @return the backendHttpSettings value. + */ + public SubResource backendHttpSettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withBackendHttpSettings(backendHttpSettings); + return this; + } + + /** + * Get the httpListener property: Http listener resource of the application gateway. + * + * @return the httpListener value. + */ + public SubResource httpListener() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withHttpListener(httpListener); + return this; + } + + /** + * Get the urlPathMap property: URL path map resource of the application gateway. + * + * @return the urlPathMap value. + */ + public SubResource urlPathMap() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withUrlPathMap(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withRewriteRuleSet(rewriteRuleSet); + return this; + } + + /** + * Get the redirectConfiguration property: Redirect configuration resource of the application gateway. + * + * @return the redirectConfiguration value. + */ + public SubResource redirectConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withRedirectConfiguration(redirectConfiguration); + return this; + } + + /** + * Get the loadDistributionPolicy property: Load Distribution Policy resource of the application gateway. + * + * @return the loadDistributionPolicy value. + */ + public SubResource loadDistributionPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().loadDistributionPolicy(); + } + + /** + * Set the loadDistributionPolicy property: Load Distribution Policy resource of the application gateway. + * + * @param loadDistributionPolicy the loadDistributionPolicy value to set. + * @return the ApplicationGatewayRequestRoutingRule object itself. + */ + public ApplicationGatewayRequestRoutingRule withLoadDistributionPolicy(SubResource loadDistributionPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRequestRoutingRulePropertiesFormat(); + } + this.innerProperties().withLoadDistributionPolicy(loadDistributionPolicy); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the request routing rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRequestRoutingRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRequestRoutingRule if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRequestRoutingRule. + */ + public static ApplicationGatewayRequestRoutingRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRequestRoutingRule deserializedApplicationGatewayRequestRoutingRule + = new ApplicationGatewayRequestRoutingRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRule.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRule.innerProperties + = ApplicationGatewayRequestRoutingRulePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRule.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRule.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayRequestRoutingRule.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRequestRoutingRule; + }); + } +} 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..b8c4dc3165288 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRequestRoutingRuleType.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 java.util.Collection; + +/** + * Rule type. + */ +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 a new instance of ApplicationGatewayRequestRoutingRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayRequestRoutingRuleType() { + } + + /** + * Creates or finds a ApplicationGatewayRequestRoutingRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayRequestRoutingRuleType. + */ + public static ApplicationGatewayRequestRoutingRuleType fromString(String name) { + return fromString(name, ApplicationGatewayRequestRoutingRuleType.class); + } + + /** + * Gets known ApplicationGatewayRequestRoutingRuleType values. + * + * @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..7ceca65cc6a1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Rewrite rule of an application gateway. + */ +@Fluent +public final class ApplicationGatewayRewriteRule implements JsonSerializable { + /* + * Name of the rewrite rule that is unique within an Application Gateway. + */ + private String name; + + /* + * Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a + * RewriteRuleSet. + */ + private Integer ruleSequence; + + /* + * Conditions based on which the action set execution will be evaluated. + */ + private List conditions; + + /* + * Set of actions to be done as part of the rewrite Rule. + */ + private ApplicationGatewayRewriteRuleActionSet actionSet; + + /** + * Creates an instance of ApplicationGatewayRewriteRule class. + */ + public ApplicationGatewayRewriteRule() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("ruleSequence", this.ruleSequence); + jsonWriter.writeArrayField("conditions", this.conditions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("actionSet", this.actionSet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRewriteRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRewriteRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRewriteRule. + */ + public static ApplicationGatewayRewriteRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRewriteRule deserializedApplicationGatewayRewriteRule + = new ApplicationGatewayRewriteRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApplicationGatewayRewriteRule.name = reader.getString(); + } else if ("ruleSequence".equals(fieldName)) { + deserializedApplicationGatewayRewriteRule.ruleSequence = reader.getNullable(JsonReader::getInt); + } else if ("conditions".equals(fieldName)) { + List conditions + = reader.readArray(reader1 -> ApplicationGatewayRewriteRuleCondition.fromJson(reader1)); + deserializedApplicationGatewayRewriteRule.conditions = conditions; + } else if ("actionSet".equals(fieldName)) { + deserializedApplicationGatewayRewriteRule.actionSet + = ApplicationGatewayRewriteRuleActionSet.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRewriteRule; + }); + } +} 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..a518dfa84e962 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleActionSet.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Set of actions in the Rewrite Rule in Application Gateway. + */ +@Fluent +public final class ApplicationGatewayRewriteRuleActionSet + implements JsonSerializable { + /* + * Request Header Actions in the Action Set. + */ + private List requestHeaderConfigurations; + + /* + * Response Header Actions in the Action Set. + */ + private List responseHeaderConfigurations; + + /* + * Url Configuration Action in the Action Set. + */ + private ApplicationGatewayUrlConfiguration urlConfiguration; + + /** + * Creates an instance of ApplicationGatewayRewriteRuleActionSet class. + */ + public ApplicationGatewayRewriteRuleActionSet() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requestHeaderConfigurations", this.requestHeaderConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("responseHeaderConfigurations", this.responseHeaderConfigurations, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("urlConfiguration", this.urlConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRewriteRuleActionSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRewriteRuleActionSet if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRewriteRuleActionSet. + */ + public static ApplicationGatewayRewriteRuleActionSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRewriteRuleActionSet deserializedApplicationGatewayRewriteRuleActionSet + = new ApplicationGatewayRewriteRuleActionSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("requestHeaderConfigurations".equals(fieldName)) { + List requestHeaderConfigurations + = reader.readArray(reader1 -> ApplicationGatewayHeaderConfiguration.fromJson(reader1)); + deserializedApplicationGatewayRewriteRuleActionSet.requestHeaderConfigurations + = requestHeaderConfigurations; + } else if ("responseHeaderConfigurations".equals(fieldName)) { + List responseHeaderConfigurations + = reader.readArray(reader1 -> ApplicationGatewayHeaderConfiguration.fromJson(reader1)); + deserializedApplicationGatewayRewriteRuleActionSet.responseHeaderConfigurations + = responseHeaderConfigurations; + } else if ("urlConfiguration".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleActionSet.urlConfiguration + = ApplicationGatewayUrlConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRewriteRuleActionSet; + }); + } +} 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..d9b580c4e44c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleCondition.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Set of conditions in the Rewrite Rule in Application Gateway. + */ +@Fluent +public final class ApplicationGatewayRewriteRuleCondition + implements JsonSerializable { + /* + * The condition parameter of the RewriteRuleCondition. + */ + private String variable; + + /* + * The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. + */ + private String pattern; + + /* + * Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. + */ + private Boolean ignoreCase; + + /* + * Setting this value as truth will force to check the negation of the condition given by the user. + */ + private Boolean negate; + + /** + * Creates an instance of ApplicationGatewayRewriteRuleCondition class. + */ + public ApplicationGatewayRewriteRuleCondition() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("variable", this.variable); + jsonWriter.writeStringField("pattern", this.pattern); + jsonWriter.writeBooleanField("ignoreCase", this.ignoreCase); + jsonWriter.writeBooleanField("negate", this.negate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRewriteRuleCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRewriteRuleCondition if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRewriteRuleCondition. + */ + public static ApplicationGatewayRewriteRuleCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRewriteRuleCondition deserializedApplicationGatewayRewriteRuleCondition + = new ApplicationGatewayRewriteRuleCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("variable".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleCondition.variable = reader.getString(); + } else if ("pattern".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleCondition.pattern = reader.getString(); + } else if ("ignoreCase".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleCondition.ignoreCase + = reader.getNullable(JsonReader::getBoolean); + } else if ("negate".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleCondition.negate + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRewriteRuleCondition; + }); + } +} 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..f2be87db9e6ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRewriteRuleSet.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRewriteRuleSetPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Rewrite rule set of an application gateway. + */ +@Fluent +public final class ApplicationGatewayRewriteRuleSet extends SubResource { + /* + * Properties of the application gateway rewrite rule set. + */ + private ApplicationGatewayRewriteRuleSetPropertiesFormat innerProperties; + + /* + * Name of the rewrite rule set that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of ApplicationGatewayRewriteRuleSet class. + */ + public ApplicationGatewayRewriteRuleSet() { + } + + /** + * Get the innerProperties property: Properties of the application gateway rewrite rule set. + * + * @return the innerProperties value. + */ + private ApplicationGatewayRewriteRuleSetPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayRewriteRuleSet withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the rewriteRules property: Rewrite rules in the rewrite rule set. + * + * @return the rewriteRules value. + */ + public List rewriteRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRewriteRuleSetPropertiesFormat(); + } + this.innerProperties().withRewriteRules(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRewriteRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRewriteRuleSet if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRewriteRuleSet. + */ + public static ApplicationGatewayRewriteRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRewriteRuleSet deserializedApplicationGatewayRewriteRuleSet + = new ApplicationGatewayRewriteRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleSet.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleSet.innerProperties + = ApplicationGatewayRewriteRuleSetPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleSet.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayRewriteRuleSet.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRewriteRuleSet; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRoutingRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRoutingRule.java new file mode 100644 index 0000000000000..9df583fffa23f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRoutingRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayRoutingRulePropertiesFormat; +import java.io.IOException; + +/** + * Routing rule of an application gateway. + */ +@Fluent +public final class ApplicationGatewayRoutingRule extends SubResource { + /* + * Properties of the application gateway routing rule. + */ + private ApplicationGatewayRoutingRulePropertiesFormat innerProperties; + + /* + * Name of the routing rule that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayRoutingRule class. + */ + public ApplicationGatewayRoutingRule() { + } + + /** + * Get the innerProperties property: Properties of the application gateway routing rule. + * + * @return the innerProperties value. + */ + private ApplicationGatewayRoutingRulePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the name property: Name of the 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 routing rule that is unique within an Application Gateway. + * + * @param name the name value to set. + * @return the ApplicationGatewayRoutingRule object itself. + */ + public ApplicationGatewayRoutingRule 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayRoutingRule withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the ruleType property: Rule type. + * + * @return the ruleType value. + */ + public ApplicationGatewayRequestRoutingRuleType ruleType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleType(); + } + + /** + * Set the ruleType property: Rule type. + * + * @param ruleType the ruleType value to set. + * @return the ApplicationGatewayRoutingRule object itself. + */ + public ApplicationGatewayRoutingRule withRuleType(ApplicationGatewayRequestRoutingRuleType ruleType) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRoutingRulePropertiesFormat(); + } + this.innerProperties().withRuleType(ruleType); + return this; + } + + /** + * Get the priority property: Priority of the routing rule. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority of the routing rule. + * + * @param priority the priority value to set. + * @return the ApplicationGatewayRoutingRule object itself. + */ + public ApplicationGatewayRoutingRule withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRoutingRulePropertiesFormat(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the backendAddressPool property: Backend address pool resource of the application gateway. + * + * @return the backendAddressPool value. + */ + public SubResource backendAddressPool() { + return this.innerProperties() == null ? null : this.innerProperties().backendAddressPool(); + } + + /** + * Set the backendAddressPool property: Backend address pool resource of the application gateway. + * + * @param backendAddressPool the backendAddressPool value to set. + * @return the ApplicationGatewayRoutingRule object itself. + */ + public ApplicationGatewayRoutingRule withBackendAddressPool(SubResource backendAddressPool) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRoutingRulePropertiesFormat(); + } + this.innerProperties().withBackendAddressPool(backendAddressPool); + return this; + } + + /** + * Get the backendSettings property: Backend settings resource of the application gateway. + * + * @return the backendSettings value. + */ + public SubResource backendSettings() { + return this.innerProperties() == null ? null : this.innerProperties().backendSettings(); + } + + /** + * Set the backendSettings property: Backend settings resource of the application gateway. + * + * @param backendSettings the backendSettings value to set. + * @return the ApplicationGatewayRoutingRule object itself. + */ + public ApplicationGatewayRoutingRule withBackendSettings(SubResource backendSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRoutingRulePropertiesFormat(); + } + this.innerProperties().withBackendSettings(backendSettings); + return this; + } + + /** + * Get the listener property: Listener resource of the application gateway. + * + * @return the listener value. + */ + public SubResource listener() { + return this.innerProperties() == null ? null : this.innerProperties().listener(); + } + + /** + * Set the listener property: Listener resource of the application gateway. + * + * @param listener the listener value to set. + * @return the ApplicationGatewayRoutingRule object itself. + */ + public ApplicationGatewayRoutingRule withListener(SubResource listener) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayRoutingRulePropertiesFormat(); + } + this.innerProperties().withListener(listener); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the request routing rule resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayRoutingRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayRoutingRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayRoutingRule. + */ + public static ApplicationGatewayRoutingRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayRoutingRule deserializedApplicationGatewayRoutingRule + = new ApplicationGatewayRoutingRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayRoutingRule.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayRoutingRule.innerProperties + = ApplicationGatewayRoutingRulePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayRoutingRule.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayRoutingRule.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayRoutingRule.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayRoutingRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRuleSetStatusOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRuleSetStatusOptions.java new file mode 100644 index 0000000000000..6d3e9b186de12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayRuleSetStatusOptions.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The rule set status. + */ +public final class ApplicationGatewayRuleSetStatusOptions + extends ExpandableStringEnum { + /** + * Static value Preview for ApplicationGatewayRuleSetStatusOptions. + */ + public static final ApplicationGatewayRuleSetStatusOptions PREVIEW = fromString("Preview"); + + /** + * Static value GA for ApplicationGatewayRuleSetStatusOptions. + */ + public static final ApplicationGatewayRuleSetStatusOptions GA = fromString("GA"); + + /** + * Static value Supported for ApplicationGatewayRuleSetStatusOptions. + */ + public static final ApplicationGatewayRuleSetStatusOptions SUPPORTED = fromString("Supported"); + + /** + * Static value Deprecated for ApplicationGatewayRuleSetStatusOptions. + */ + public static final ApplicationGatewayRuleSetStatusOptions DEPRECATED = fromString("Deprecated"); + + /** + * Creates a new instance of ApplicationGatewayRuleSetStatusOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayRuleSetStatusOptions() { + } + + /** + * Creates or finds a ApplicationGatewayRuleSetStatusOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayRuleSetStatusOptions. + */ + public static ApplicationGatewayRuleSetStatusOptions fromString(String name) { + return fromString(name, ApplicationGatewayRuleSetStatusOptions.class); + } + + /** + * Gets known ApplicationGatewayRuleSetStatusOptions values. + * + * @return known ApplicationGatewayRuleSetStatusOptions values. + */ + public static Collection values() { + return values(ApplicationGatewayRuleSetStatusOptions.class); + } +} 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..1a7037f2b4ed3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySku.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU of an application gateway. + */ +@Fluent +public final class ApplicationGatewaySku implements JsonSerializable { + /* + * Name of an application gateway SKU. + */ + private ApplicationGatewaySkuName name; + + /* + * Tier of an application gateway. + */ + private ApplicationGatewayTier tier; + + /* + * Capacity (instance count) of an application gateway. + */ + private Integer capacity; + + /* + * Family of an application gateway SKU. + */ + private ApplicationGatewaySkuFamily family; + + /** + * Creates an instance of ApplicationGatewaySku class. + */ + public ApplicationGatewaySku() { + } + + /** + * 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; + } + + /** + * Get the family property: Family of an application gateway SKU. + * + * @return the family value. + */ + public ApplicationGatewaySkuFamily family() { + return this.family; + } + + /** + * Set the family property: Family of an application gateway SKU. + * + * @param family the family value to set. + * @return the ApplicationGatewaySku object itself. + */ + public ApplicationGatewaySku withFamily(ApplicationGatewaySkuFamily family) { + this.family = family; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeNumberField("capacity", this.capacity); + jsonWriter.writeStringField("family", this.family == null ? null : this.family.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySku if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySku. + */ + public static ApplicationGatewaySku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySku deserializedApplicationGatewaySku = new ApplicationGatewaySku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApplicationGatewaySku.name = ApplicationGatewaySkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedApplicationGatewaySku.tier = ApplicationGatewayTier.fromString(reader.getString()); + } else if ("capacity".equals(fieldName)) { + deserializedApplicationGatewaySku.capacity = reader.getNullable(JsonReader::getInt); + } else if ("family".equals(fieldName)) { + deserializedApplicationGatewaySku.family + = ApplicationGatewaySkuFamily.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySku; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuFamily.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuFamily.java new file mode 100644 index 0000000000000..0ece3c1f00254 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuFamily.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Family of an application gateway SKU. + */ +public final class ApplicationGatewaySkuFamily extends ExpandableStringEnum { + /** + * Static value Generation_1 for ApplicationGatewaySkuFamily. + */ + public static final ApplicationGatewaySkuFamily GENERATION_1 = fromString("Generation_1"); + + /** + * Static value Generation_2 for ApplicationGatewaySkuFamily. + */ + public static final ApplicationGatewaySkuFamily GENERATION_2 = fromString("Generation_2"); + + /** + * Creates a new instance of ApplicationGatewaySkuFamily value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewaySkuFamily() { + } + + /** + * Creates or finds a ApplicationGatewaySkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySkuFamily. + */ + public static ApplicationGatewaySkuFamily fromString(String name) { + return fromString(name, ApplicationGatewaySkuFamily.class); + } + + /** + * Gets known ApplicationGatewaySkuFamily values. + * + * @return known ApplicationGatewaySkuFamily values. + */ + public static Collection values() { + return values(ApplicationGatewaySkuFamily.class); + } +} 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..aa1cde6df9799 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySkuName.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of an application gateway SKU. + */ +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"); + + /** + * Static value Basic for ApplicationGatewaySkuName. + */ + public static final ApplicationGatewaySkuName BASIC = fromString("Basic"); + + /** + * Creates a new instance of ApplicationGatewaySkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewaySkuName() { + } + + /** + * Creates or finds a ApplicationGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySkuName. + */ + public static ApplicationGatewaySkuName fromString(String name) { + return fromString(name, ApplicationGatewaySkuName.class); + } + + /** + * Gets known ApplicationGatewaySkuName values. + * + * @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..b7195502b5c4e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCertificate.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslCertificatePropertiesFormat; +import java.io.IOException; + +/** + * SSL certificates of an application gateway. + */ +@Fluent +public final class ApplicationGatewaySslCertificate extends SubResource { + /* + * Properties of the application gateway SSL certificate. + */ + private ApplicationGatewaySslCertificatePropertiesFormat innerProperties; + + /* + * Name of the SSL certificate that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewaySslCertificate class. + */ + public ApplicationGatewaySslCertificate() { + } + + /** + * Get the innerProperties property: Properties of the application gateway SSL certificate. + * + * @return the innerProperties value. + */ + private ApplicationGatewaySslCertificatePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewaySslCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the data property: Base-64 encoded pfx certificate. Only applicable in PUT Request. + * + * @return the data value. + */ + public String data() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); + } + this.innerProperties().withData(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); + } + this.innerProperties().withPassword(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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslCertificatePropertiesFormat(); + } + this.innerProperties().withKeyVaultSecretId(keyVaultSecretId); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the SSL certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySslCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySslCertificate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySslCertificate. + */ + public static ApplicationGatewaySslCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySslCertificate deserializedApplicationGatewaySslCertificate + = new ApplicationGatewaySslCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewaySslCertificate.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewaySslCertificate.innerProperties + = ApplicationGatewaySslCertificatePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewaySslCertificate.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewaySslCertificate.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewaySslCertificate.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySslCertificate; + }); + } +} 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..ae7c53a24c636 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslCipherSuite.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Ssl cipher suites enums. + */ +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 a new instance of ApplicationGatewaySslCipherSuite value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewaySslCipherSuite() { + } + + /** + * Creates or finds a ApplicationGatewaySslCipherSuite from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslCipherSuite. + */ + public static ApplicationGatewaySslCipherSuite fromString(String name) { + return fromString(name, ApplicationGatewaySslCipherSuite.class); + } + + /** + * Gets known ApplicationGatewaySslCipherSuite values. + * + * @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..c28454465a820 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicy.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Application Gateway Ssl policy. + */ +@Fluent +public final class ApplicationGatewaySslPolicy implements JsonSerializable { + /* + * Ssl protocols to be disabled on application gateway. + */ + private List disabledSslProtocols; + + /* + * Type of Ssl Policy. + */ + private ApplicationGatewaySslPolicyType policyType; + + /* + * Name of Ssl predefined policy. + */ + private ApplicationGatewaySslPolicyName policyName; + + /* + * Ssl cipher suites to be enabled in the specified order to application gateway. + */ + private List cipherSuites; + + /* + * Minimum version of Ssl protocol to be supported on application gateway. + */ + private ApplicationGatewaySslProtocol minProtocolVersion; + + /** + * Creates an instance of ApplicationGatewaySslPolicy class. + */ + public ApplicationGatewaySslPolicy() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("disabledSslProtocols", this.disabledSslProtocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); + jsonWriter.writeStringField("policyName", this.policyName == null ? null : this.policyName.toString()); + jsonWriter.writeArrayField("cipherSuites", this.cipherSuites, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("minProtocolVersion", + this.minProtocolVersion == null ? null : this.minProtocolVersion.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySslPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySslPolicy if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySslPolicy. + */ + public static ApplicationGatewaySslPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySslPolicy deserializedApplicationGatewaySslPolicy = new ApplicationGatewaySslPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disabledSslProtocols".equals(fieldName)) { + List disabledSslProtocols + = reader.readArray(reader1 -> ApplicationGatewaySslProtocol.fromString(reader1.getString())); + deserializedApplicationGatewaySslPolicy.disabledSslProtocols = disabledSslProtocols; + } else if ("policyType".equals(fieldName)) { + deserializedApplicationGatewaySslPolicy.policyType + = ApplicationGatewaySslPolicyType.fromString(reader.getString()); + } else if ("policyName".equals(fieldName)) { + deserializedApplicationGatewaySslPolicy.policyName + = ApplicationGatewaySslPolicyName.fromString(reader.getString()); + } else if ("cipherSuites".equals(fieldName)) { + List cipherSuites + = reader.readArray(reader1 -> ApplicationGatewaySslCipherSuite.fromString(reader1.getString())); + deserializedApplicationGatewaySslPolicy.cipherSuites = cipherSuites; + } else if ("minProtocolVersion".equals(fieldName)) { + deserializedApplicationGatewaySslPolicy.minProtocolVersion + = ApplicationGatewaySslProtocol.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySslPolicy; + }); + } +} 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..78ac26d1981be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyName.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Ssl predefined policy name enums. + */ +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"); + + /** + * Static value AppGwSslPolicy20220101 for ApplicationGatewaySslPolicyName. + */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20220101 + = fromString("AppGwSslPolicy20220101"); + + /** + * Static value AppGwSslPolicy20220101S for ApplicationGatewaySslPolicyName. + */ + public static final ApplicationGatewaySslPolicyName APP_GW_SSL_POLICY20220101S + = fromString("AppGwSslPolicy20220101S"); + + /** + * Creates a new instance of ApplicationGatewaySslPolicyName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewaySslPolicyName() { + } + + /** + * Creates or finds a ApplicationGatewaySslPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslPolicyName. + */ + public static ApplicationGatewaySslPolicyName fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyName.class); + } + + /** + * Gets known ApplicationGatewaySslPolicyName values. + * + * @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..8c45cb4dc6515 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPolicyType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of Ssl Policy. + */ +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"); + + /** + * Static value CustomV2 for ApplicationGatewaySslPolicyType. + */ + public static final ApplicationGatewaySslPolicyType CUSTOM_V2 = fromString("CustomV2"); + + /** + * Creates a new instance of ApplicationGatewaySslPolicyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewaySslPolicyType() { + } + + /** + * Creates or finds a ApplicationGatewaySslPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslPolicyType. + */ + public static ApplicationGatewaySslPolicyType fromString(String name) { + return fromString(name, ApplicationGatewaySslPolicyType.class); + } + + /** + * Gets known ApplicationGatewaySslPolicyType values. + * + * @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..7bcf3eb4cb079 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslPredefinedPolicy.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.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..7591aeb5ad8b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProfile.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewaySslProfilePropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * SSL profile of an application gateway. + */ +@Fluent +public final class ApplicationGatewaySslProfile extends SubResource { + /* + * Properties of the application gateway SSL profile. + */ + private ApplicationGatewaySslProfilePropertiesFormat innerProperties; + + /* + * Name of the SSL profile that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewaySslProfile class. + */ + public ApplicationGatewaySslProfile() { + } + + /** + * Get the innerProperties property: Properties of the application gateway SSL profile. + * + * @return the innerProperties value. + */ + private ApplicationGatewaySslProfilePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewaySslProfile withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the trustedClientCertificates property: Array of references to application gateway trusted client + * certificates. + * + * @return the trustedClientCertificates value. + */ + public List trustedClientCertificates() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslProfilePropertiesFormat(); + } + this.innerProperties().withTrustedClientCertificates(trustedClientCertificates); + return this; + } + + /** + * Get the sslPolicy property: SSL policy of the application gateway resource. + * + * @return the sslPolicy value. + */ + public ApplicationGatewaySslPolicy sslPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslProfilePropertiesFormat(); + } + this.innerProperties().withSslPolicy(sslPolicy); + return this; + } + + /** + * Get the clientAuthConfiguration property: Client authentication configuration of the application gateway + * resource. + * + * @return the clientAuthConfiguration value. + */ + public ApplicationGatewayClientAuthConfiguration clientAuthConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewaySslProfilePropertiesFormat(); + } + this.innerProperties().withClientAuthConfiguration(clientAuthConfiguration); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the HTTP listener resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewaySslProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewaySslProfile if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewaySslProfile. + */ + public static ApplicationGatewaySslProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewaySslProfile deserializedApplicationGatewaySslProfile = new ApplicationGatewaySslProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewaySslProfile.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewaySslProfile.innerProperties + = ApplicationGatewaySslProfilePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewaySslProfile.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewaySslProfile.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewaySslProfile.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewaySslProfile; + }); + } +} 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..457a5911881e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewaySslProtocol.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 java.util.Collection; + +/** + * Ssl protocol enums. + */ +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"); + + /** + * Static value TLSv1_3 for ApplicationGatewaySslProtocol. + */ + public static final ApplicationGatewaySslProtocol TLSV1_3 = fromString("TLSv1_3"); + + /** + * Creates a new instance of ApplicationGatewaySslProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewaySslProtocol() { + } + + /** + * Creates or finds a ApplicationGatewaySslProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewaySslProtocol. + */ + public static ApplicationGatewaySslProtocol fromString(String name) { + return fromString(name, ApplicationGatewaySslProtocol.class); + } + + /** + * Gets known ApplicationGatewaySslProtocol values. + * + * @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..5ae67cd5e19a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTier.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tier of an application gateway. + */ +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"); + + /** + * Static value Basic for ApplicationGatewayTier. + */ + public static final ApplicationGatewayTier BASIC = fromString("Basic"); + + /** + * Creates a new instance of ApplicationGatewayTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayTier() { + } + + /** + * Creates or finds a ApplicationGatewayTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayTier. + */ + public static ApplicationGatewayTier fromString(String name) { + return fromString(name, ApplicationGatewayTier.class); + } + + /** + * Gets known ApplicationGatewayTier values. + * + * @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/ApplicationGatewayTierTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTierTypes.java new file mode 100644 index 0000000000000..99f6a59804ce2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTierTypes.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 java.util.Collection; + +/** + * Defines values for ApplicationGatewayTierTypes. + */ +public final class ApplicationGatewayTierTypes extends ExpandableStringEnum { + /** + * Static value Standard for ApplicationGatewayTierTypes. + */ + public static final ApplicationGatewayTierTypes STANDARD = fromString("Standard"); + + /** + * Static value WAF for ApplicationGatewayTierTypes. + */ + public static final ApplicationGatewayTierTypes WAF = fromString("WAF"); + + /** + * Static value Standard_v2 for ApplicationGatewayTierTypes. + */ + public static final ApplicationGatewayTierTypes STANDARD_V2 = fromString("Standard_v2"); + + /** + * Static value WAF_v2 for ApplicationGatewayTierTypes. + */ + public static final ApplicationGatewayTierTypes WAF_V2 = fromString("WAF_v2"); + + /** + * Creates a new instance of ApplicationGatewayTierTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayTierTypes() { + } + + /** + * Creates or finds a ApplicationGatewayTierTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayTierTypes. + */ + public static ApplicationGatewayTierTypes fromString(String name) { + return fromString(name, ApplicationGatewayTierTypes.class); + } + + /** + * Gets known ApplicationGatewayTierTypes values. + * + * @return known ApplicationGatewayTierTypes values. + */ + public static Collection values() { + return values(ApplicationGatewayTierTypes.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..948e425776a92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedClientCertificate.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayTrustedClientCertificatePropertiesFormat; +import java.io.IOException; + +/** + * Trusted client certificates of an application gateway. + */ +@Fluent +public final class ApplicationGatewayTrustedClientCertificate extends SubResource { + /* + * Properties of the application gateway trusted client certificate. + */ + private ApplicationGatewayTrustedClientCertificatePropertiesFormat innerProperties; + + /* + * Name of the trusted client certificate that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayTrustedClientCertificate class. + */ + public ApplicationGatewayTrustedClientCertificate() { + } + + /** + * Get the innerProperties property: Properties of the application gateway trusted client certificate. + * + * @return the innerProperties value. + */ + private ApplicationGatewayTrustedClientCertificatePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayTrustedClientCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the data property: Certificate public data. + * + * @return the data value. + */ + public String data() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayTrustedClientCertificatePropertiesFormat(); + } + this.innerProperties().withData(data); + return this; + } + + /** + * Get the validatedCertData property: Validated certificate data. + * + * @return the validatedCertData value. + */ + public String validatedCertData() { + return this.innerProperties() == null ? null : this.innerProperties().validatedCertData(); + } + + /** + * Get the clientCertIssuerDN property: Distinguished name of client certificate issuer. + * + * @return the clientCertIssuerDN value. + */ + public String clientCertIssuerDN() { + return this.innerProperties() == null ? null : this.innerProperties().clientCertIssuerDN(); + } + + /** + * Get the provisioningState property: The provisioning state of the trusted client certificate resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayTrustedClientCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayTrustedClientCertificate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayTrustedClientCertificate. + */ + public static ApplicationGatewayTrustedClientCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayTrustedClientCertificate deserializedApplicationGatewayTrustedClientCertificate + = new ApplicationGatewayTrustedClientCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificate.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificate.innerProperties + = ApplicationGatewayTrustedClientCertificatePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificate.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificate.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayTrustedClientCertificate.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayTrustedClientCertificate; + }); + } +} 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..2f1805b3460c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayTrustedRootCertificate.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayTrustedRootCertificatePropertiesFormat; +import java.io.IOException; + +/** + * Trusted Root certificates of an application gateway. + */ +@Fluent +public final class ApplicationGatewayTrustedRootCertificate extends SubResource { + /* + * Properties of the application gateway trusted root certificate. + */ + private ApplicationGatewayTrustedRootCertificatePropertiesFormat innerProperties; + + /* + * Name of the trusted root certificate that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayTrustedRootCertificate class. + */ + public ApplicationGatewayTrustedRootCertificate() { + } + + /** + * Get the innerProperties property: Properties of the application gateway trusted root certificate. + * + * @return the innerProperties value. + */ + private ApplicationGatewayTrustedRootCertificatePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayTrustedRootCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the data property: Certificate public data. + * + * @return the data value. + */ + public String data() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayTrustedRootCertificatePropertiesFormat(); + } + this.innerProperties().withData(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayTrustedRootCertificatePropertiesFormat(); + } + this.innerProperties().withKeyVaultSecretId(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayTrustedRootCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayTrustedRootCertificate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayTrustedRootCertificate. + */ + public static ApplicationGatewayTrustedRootCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayTrustedRootCertificate deserializedApplicationGatewayTrustedRootCertificate + = new ApplicationGatewayTrustedRootCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificate.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificate.innerProperties + = ApplicationGatewayTrustedRootCertificatePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificate.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificate.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayTrustedRootCertificate.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayTrustedRootCertificate; + }); + } +} 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..80d856dac87f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Url configuration of the Actions set in Application Gateway. + */ +@Fluent +public final class ApplicationGatewayUrlConfiguration implements JsonSerializable { + /* + * Url path which user has provided for url rewrite. Null means no path will be updated. Default value is null. + */ + private String modifiedPath; + + /* + * Query string which user has provided for url rewrite. Null means no query string will be updated. Default value + * is null. + */ + 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. + */ + private Boolean reroute; + + /** + * Creates an instance of ApplicationGatewayUrlConfiguration class. + */ + public ApplicationGatewayUrlConfiguration() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("modifiedPath", this.modifiedPath); + jsonWriter.writeStringField("modifiedQueryString", this.modifiedQueryString); + jsonWriter.writeBooleanField("reroute", this.reroute); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayUrlConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayUrlConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayUrlConfiguration. + */ + public static ApplicationGatewayUrlConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayUrlConfiguration deserializedApplicationGatewayUrlConfiguration + = new ApplicationGatewayUrlConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("modifiedPath".equals(fieldName)) { + deserializedApplicationGatewayUrlConfiguration.modifiedPath = reader.getString(); + } else if ("modifiedQueryString".equals(fieldName)) { + deserializedApplicationGatewayUrlConfiguration.modifiedQueryString = reader.getString(); + } else if ("reroute".equals(fieldName)) { + deserializedApplicationGatewayUrlConfiguration.reroute = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayUrlConfiguration; + }); + } +} 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..d028ed767441c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayUrlPathMap.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayUrlPathMapPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. + */ +@Fluent +public final class ApplicationGatewayUrlPathMap extends SubResource { + /* + * Properties of the application gateway URL path map. + */ + private ApplicationGatewayUrlPathMapPropertiesFormat innerProperties; + + /* + * Name of the URL path map that is unique within an Application Gateway. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of ApplicationGatewayUrlPathMap class. + */ + public ApplicationGatewayUrlPathMap() { + } + + /** + * Get the innerProperties property: Properties of the application gateway URL path map. + * + * @return the innerProperties value. + */ + private ApplicationGatewayUrlPathMapPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ApplicationGatewayUrlPathMap withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the defaultBackendAddressPool property: Default backend address pool resource of URL path map. + * + * @return the defaultBackendAddressPool value. + */ + public SubResource defaultBackendAddressPool() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); + } + this.innerProperties().withDefaultBackendAddressPool(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); + } + this.innerProperties().withDefaultBackendHttpSettings(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); + } + this.innerProperties().withDefaultRewriteRuleSet(defaultRewriteRuleSet); + return this; + } + + /** + * Get the defaultRedirectConfiguration property: Default redirect configuration resource of URL path map. + * + * @return the defaultRedirectConfiguration value. + */ + public SubResource defaultRedirectConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); + } + this.innerProperties().withDefaultRedirectConfiguration(defaultRedirectConfiguration); + return this; + } + + /** + * Get the defaultLoadDistributionPolicy property: Default Load Distribution Policy resource of URL path map. + * + * @return the defaultLoadDistributionPolicy value. + */ + public SubResource defaultLoadDistributionPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().defaultLoadDistributionPolicy(); + } + + /** + * Set the defaultLoadDistributionPolicy property: Default Load Distribution Policy resource of URL path map. + * + * @param defaultLoadDistributionPolicy the defaultLoadDistributionPolicy value to set. + * @return the ApplicationGatewayUrlPathMap object itself. + */ + public ApplicationGatewayUrlPathMap withDefaultLoadDistributionPolicy(SubResource defaultLoadDistributionPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); + } + this.innerProperties().withDefaultLoadDistributionPolicy(defaultLoadDistributionPolicy); + return this; + } + + /** + * Get the pathRules property: Path rule of URL path map resource. + * + * @return the pathRules value. + */ + public List pathRules() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ApplicationGatewayUrlPathMapPropertiesFormat(); + } + this.innerProperties().withPathRules(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayUrlPathMap from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayUrlPathMap if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayUrlPathMap. + */ + public static ApplicationGatewayUrlPathMap fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayUrlPathMap deserializedApplicationGatewayUrlPathMap = new ApplicationGatewayUrlPathMap(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMap.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMap.innerProperties + = ApplicationGatewayUrlPathMapPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMap.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMap.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedApplicationGatewayUrlPathMap.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayUrlPathMap; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResult.java new file mode 100644 index 0000000000000..05fb399a5f7cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResult.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.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner; +import java.util.List; + +/** + * An immutable client-side representation of ApplicationGatewayWafDynamicManifestResult. + */ +public interface ApplicationGatewayWafDynamicManifestResult { + /** + * 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 availableRuleSets property: The available rulesets. + * + * @return the availableRuleSets value. + */ + List availableRuleSets(); + + /** + * Gets the ruleSetType property: The type of the web application firewall rule set. + * + * @return the ruleSetType value. + */ + String ruleSetType(); + + /** + * Gets the ruleSetVersion property: The version of the web application firewall rule set type. + * + * @return the ruleSetVersion value. + */ + String ruleSetVersion(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner object. + * + * @return the inner object. + */ + ApplicationGatewayWafDynamicManifestResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResultList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResultList.java new file mode 100644 index 0000000000000..b82ae33188e9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestResultList.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayWafDynamicManifestResultInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ApplicationGatewayWafDynamicManifests API service call. + */ +@Fluent +public final class ApplicationGatewayWafDynamicManifestResultList + implements JsonSerializable { + /* + * The list of application gateway waf manifest. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ApplicationGatewayWafDynamicManifestResultList class. + */ + public ApplicationGatewayWafDynamicManifestResultList() { + } + + /** + * Get the value property: The list of application gateway waf manifest. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of application gateway waf manifest. + * + * @param value the value value to set. + * @return the ApplicationGatewayWafDynamicManifestResultList object itself. + */ + public ApplicationGatewayWafDynamicManifestResultList + 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 ApplicationGatewayWafDynamicManifestResultList object itself. + */ + public ApplicationGatewayWafDynamicManifestResultList 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayWafDynamicManifestResultList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayWafDynamicManifestResultList if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationGatewayWafDynamicManifestResultList. + */ + public static ApplicationGatewayWafDynamicManifestResultList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayWafDynamicManifestResultList deserializedApplicationGatewayWafDynamicManifestResultList + = new ApplicationGatewayWafDynamicManifestResultList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> ApplicationGatewayWafDynamicManifestResultInner.fromJson(reader1)); + deserializedApplicationGatewayWafDynamicManifestResultList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationGatewayWafDynamicManifestResultList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayWafDynamicManifestResultList; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifests.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifests.java new file mode 100644 index 0000000000000..6b0404888ac17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifests.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 ApplicationGatewayWafDynamicManifests. + */ +public interface ApplicationGatewayWafDynamicManifests { + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedIterable}. + */ + PagedIterable get(String location); + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest as paginated response with {@link PagedIterable}. + */ + PagedIterable get(String location, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestsDefaults.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestsDefaults.java new file mode 100644 index 0000000000000..8f6298045ee73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafDynamicManifestsDefaults.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.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ApplicationGatewayWafDynamicManifestsDefaults. + */ +public interface ApplicationGatewayWafDynamicManifestsDefaults { + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest along with {@link Response}. + */ + Response getWithResponse(String location, Context context); + + /** + * Gets the regional application gateway waf manifest. + * + * @param location The region where the nrp are located at. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the regional application gateway waf manifest. + */ + ApplicationGatewayWafDynamicManifestResult get(String location); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleActionTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleActionTypes.java new file mode 100644 index 0000000000000..d7b4e3999ce8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleActionTypes.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The string representation of the web application firewall rule action. + */ +public final class ApplicationGatewayWafRuleActionTypes + extends ExpandableStringEnum { + /** + * Static value None for ApplicationGatewayWafRuleActionTypes. + */ + public static final ApplicationGatewayWafRuleActionTypes NONE = fromString("None"); + + /** + * Static value AnomalyScoring for ApplicationGatewayWafRuleActionTypes. + */ + public static final ApplicationGatewayWafRuleActionTypes ANOMALY_SCORING = fromString("AnomalyScoring"); + + /** + * Static value Allow for ApplicationGatewayWafRuleActionTypes. + */ + public static final ApplicationGatewayWafRuleActionTypes ALLOW = fromString("Allow"); + + /** + * Static value Block for ApplicationGatewayWafRuleActionTypes. + */ + public static final ApplicationGatewayWafRuleActionTypes BLOCK = fromString("Block"); + + /** + * Static value Log for ApplicationGatewayWafRuleActionTypes. + */ + public static final ApplicationGatewayWafRuleActionTypes LOG = fromString("Log"); + + /** + * Creates a new instance of ApplicationGatewayWafRuleActionTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayWafRuleActionTypes() { + } + + /** + * Creates or finds a ApplicationGatewayWafRuleActionTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayWafRuleActionTypes. + */ + public static ApplicationGatewayWafRuleActionTypes fromString(String name) { + return fromString(name, ApplicationGatewayWafRuleActionTypes.class); + } + + /** + * Gets known ApplicationGatewayWafRuleActionTypes values. + * + * @return known ApplicationGatewayWafRuleActionTypes values. + */ + public static Collection values() { + return values(ApplicationGatewayWafRuleActionTypes.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleSensitivityTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleSensitivityTypes.java new file mode 100644 index 0000000000000..5c27fc4be59ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleSensitivityTypes.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The string representation of the web application firewall rule sensitivity. + */ +public final class ApplicationGatewayWafRuleSensitivityTypes + extends ExpandableStringEnum { + /** + * Static value None for ApplicationGatewayWafRuleSensitivityTypes. + */ + public static final ApplicationGatewayWafRuleSensitivityTypes NONE = fromString("None"); + + /** + * Static value Low for ApplicationGatewayWafRuleSensitivityTypes. + */ + public static final ApplicationGatewayWafRuleSensitivityTypes LOW = fromString("Low"); + + /** + * Static value Medium for ApplicationGatewayWafRuleSensitivityTypes. + */ + public static final ApplicationGatewayWafRuleSensitivityTypes MEDIUM = fromString("Medium"); + + /** + * Static value High for ApplicationGatewayWafRuleSensitivityTypes. + */ + public static final ApplicationGatewayWafRuleSensitivityTypes HIGH = fromString("High"); + + /** + * Creates a new instance of ApplicationGatewayWafRuleSensitivityTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayWafRuleSensitivityTypes() { + } + + /** + * Creates or finds a ApplicationGatewayWafRuleSensitivityTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayWafRuleSensitivityTypes. + */ + public static ApplicationGatewayWafRuleSensitivityTypes fromString(String name) { + return fromString(name, ApplicationGatewayWafRuleSensitivityTypes.class); + } + + /** + * Gets known ApplicationGatewayWafRuleSensitivityTypes values. + * + * @return known ApplicationGatewayWafRuleSensitivityTypes values. + */ + public static Collection values() { + return values(ApplicationGatewayWafRuleSensitivityTypes.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleStateTypes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleStateTypes.java new file mode 100644 index 0000000000000..0e1dcd930fb2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWafRuleStateTypes.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 java.util.Collection; + +/** + * The string representation of the web application firewall rule state. + */ +public final class ApplicationGatewayWafRuleStateTypes + extends ExpandableStringEnum { + /** + * Static value Enabled for ApplicationGatewayWafRuleStateTypes. + */ + public static final ApplicationGatewayWafRuleStateTypes ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ApplicationGatewayWafRuleStateTypes. + */ + public static final ApplicationGatewayWafRuleStateTypes DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ApplicationGatewayWafRuleStateTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationGatewayWafRuleStateTypes() { + } + + /** + * Creates or finds a ApplicationGatewayWafRuleStateTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationGatewayWafRuleStateTypes. + */ + public static ApplicationGatewayWafRuleStateTypes fromString(String name) { + return fromString(name, ApplicationGatewayWafRuleStateTypes.class); + } + + /** + * Gets known ApplicationGatewayWafRuleStateTypes values. + * + * @return known ApplicationGatewayWafRuleStateTypes values. + */ + public static Collection values() { + return values(ApplicationGatewayWafRuleStateTypes.class); + } +} 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..66ea352866a5c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGatewayWebApplicationFirewallConfiguration.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Application gateway web application firewall configuration. + */ +@Fluent +public final class ApplicationGatewayWebApplicationFirewallConfiguration + implements JsonSerializable { + /* + * Whether the web application firewall is enabled or not. + */ + private boolean enabled; + + /* + * Web application firewall mode. + */ + private ApplicationGatewayFirewallMode firewallMode; + + /* + * The type of the web application firewall rule set. Possible values are: 'OWASP'. + */ + private String ruleSetType; + + /* + * The version of the rule set type. + */ + private String ruleSetVersion; + + /* + * The disabled rule groups. + */ + private List disabledRuleGroups; + + /* + * Whether allow WAF to check request Body. + */ + private Boolean requestBodyCheck; + + /* + * Maximum request body size for WAF. + */ + private Integer maxRequestBodySize; + + /* + * Maximum request body size in Kb for WAF. + */ + private Integer maxRequestBodySizeInKb; + + /* + * Maximum file upload size in Mb for WAF. + */ + private Integer fileUploadLimitInMb; + + /* + * The exclusion list. + */ + private List exclusions; + + /** + * Creates an instance of ApplicationGatewayWebApplicationFirewallConfiguration class. + */ + public ApplicationGatewayWebApplicationFirewallConfiguration() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property firewallMode in model ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleSetType in model ApplicationGatewayWebApplicationFirewallConfiguration")); + } + if (ruleSetVersion() == null) { + throw LOGGER.atError() + .log(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()); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(ApplicationGatewayWebApplicationFirewallConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("firewallMode", this.firewallMode == null ? null : this.firewallMode.toString()); + jsonWriter.writeStringField("ruleSetType", this.ruleSetType); + jsonWriter.writeStringField("ruleSetVersion", this.ruleSetVersion); + jsonWriter.writeArrayField("disabledRuleGroups", this.disabledRuleGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("requestBodyCheck", this.requestBodyCheck); + jsonWriter.writeNumberField("maxRequestBodySize", this.maxRequestBodySize); + jsonWriter.writeNumberField("maxRequestBodySizeInKb", this.maxRequestBodySizeInKb); + jsonWriter.writeNumberField("fileUploadLimitInMb", this.fileUploadLimitInMb); + jsonWriter.writeArrayField("exclusions", this.exclusions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationGatewayWebApplicationFirewallConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationGatewayWebApplicationFirewallConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplicationGatewayWebApplicationFirewallConfiguration. + */ + public static ApplicationGatewayWebApplicationFirewallConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ApplicationGatewayWebApplicationFirewallConfiguration deserializedApplicationGatewayWebApplicationFirewallConfiguration + = new ApplicationGatewayWebApplicationFirewallConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.enabled = reader.getBoolean(); + } else if ("firewallMode".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.firewallMode + = ApplicationGatewayFirewallMode.fromString(reader.getString()); + } else if ("ruleSetType".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.ruleSetVersion + = reader.getString(); + } else if ("disabledRuleGroups".equals(fieldName)) { + List disabledRuleGroups + = reader.readArray(reader1 -> ApplicationGatewayFirewallDisabledRuleGroup.fromJson(reader1)); + deserializedApplicationGatewayWebApplicationFirewallConfiguration.disabledRuleGroups + = disabledRuleGroups; + } else if ("requestBodyCheck".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.requestBodyCheck + = reader.getNullable(JsonReader::getBoolean); + } else if ("maxRequestBodySize".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.maxRequestBodySize + = reader.getNullable(JsonReader::getInt); + } else if ("maxRequestBodySizeInKb".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.maxRequestBodySizeInKb + = reader.getNullable(JsonReader::getInt); + } else if ("fileUploadLimitInMb".equals(fieldName)) { + deserializedApplicationGatewayWebApplicationFirewallConfiguration.fileUploadLimitInMb + = reader.getNullable(JsonReader::getInt); + } else if ("exclusions".equals(fieldName)) { + List exclusions + = reader.readArray(reader1 -> ApplicationGatewayFirewallExclusion.fromJson(reader1)); + deserializedApplicationGatewayWebApplicationFirewallConfiguration.exclusions = exclusions; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationGatewayWebApplicationFirewallConfiguration; + }); + } +} 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..b17089240b70f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationGateways.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * + * @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 along with {@link Response}. + */ + Response> listAvailableServerVariablesWithResponse(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 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 along with {@link Response}. + */ + Response> listAvailableRequestHeadersWithResponse(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 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 along with {@link Response}. + */ + Response> listAvailableResponseHeadersWithResponse(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 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 along with {@link Response}. + */ + Response listAvailableWafRuleSetsWithResponse(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 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 along with {@link Response}. + */ + Response listAvailableSslOptionsWithResponse(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 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listAvailableSslPredefinedPolicies(Context context); + + /** + * 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 along with {@link Response}. + */ + Response getSslPredefinedPolicyWithResponse(String predefinedPolicyName, + 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 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..349cbc82b5897 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationRule.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Rule of type application. + */ +@Fluent +public final class ApplicationRule extends FirewallPolicyRule { + /* + * Rule Type. + */ + private FirewallPolicyRuleType ruleType = FirewallPolicyRuleType.APPLICATION_RULE; + + /* + * List of source IP addresses for this rule. + */ + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + private List destinationAddresses; + + /* + * Array of Application Protocols. + */ + private List protocols; + + /* + * List of FQDNs for this rule. + */ + private List targetFqdns; + + /* + * List of Urls for this rule condition. + */ + private List targetUrls; + + /* + * List of FQDN Tags for this rule. + */ + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + private List sourceIpGroups; + + /* + * Terminate TLS connections for this rule. + */ + private Boolean terminateTls; + + /* + * List of destination azure web categories. + */ + private List webCategories; + + /* + * List of HTTP/S headers to insert. + */ + private List httpHeadersToInsert; + + /** + * Creates an instance of ApplicationRule class. + */ + public ApplicationRule() { + } + + /** + * Get the ruleType property: Rule Type. + * + * @return the ruleType value. + */ + @Override + public FirewallPolicyRuleType ruleType() { + return this.ruleType; + } + + /** + * 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; + } + + /** + * Get the httpHeadersToInsert property: List of HTTP/S headers to insert. + * + * @return the httpHeadersToInsert value. + */ + public List httpHeadersToInsert() { + return this.httpHeadersToInsert; + } + + /** + * Set the httpHeadersToInsert property: List of HTTP/S headers to insert. + * + * @param httpHeadersToInsert the httpHeadersToInsert value to set. + * @return the ApplicationRule object itself. + */ + public ApplicationRule withHttpHeadersToInsert(List httpHeadersToInsert) { + this.httpHeadersToInsert = httpHeadersToInsert; + 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() { + if (protocols() != null) { + protocols().forEach(e -> e.validate()); + } + if (httpHeadersToInsert() != null) { + httpHeadersToInsert().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationAddresses", this.destinationAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("protocols", this.protocols, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("targetFqdns", this.targetFqdns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("targetUrls", this.targetUrls, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("fqdnTags", this.fqdnTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sourceIpGroups", this.sourceIpGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("terminateTLS", this.terminateTls); + jsonWriter.writeArrayField("webCategories", this.webCategories, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("httpHeadersToInsert", this.httpHeadersToInsert, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationRule. + */ + public static ApplicationRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationRule deserializedApplicationRule = new ApplicationRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedApplicationRule.withName(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedApplicationRule.withDescription(reader.getString()); + } else if ("ruleType".equals(fieldName)) { + deserializedApplicationRule.ruleType = FirewallPolicyRuleType.fromString(reader.getString()); + } else if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationRule.sourceAddresses = sourceAddresses; + } else if ("destinationAddresses".equals(fieldName)) { + List destinationAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationRule.destinationAddresses = destinationAddresses; + } else if ("protocols".equals(fieldName)) { + List protocols + = reader.readArray(reader1 -> FirewallPolicyRuleApplicationProtocol.fromJson(reader1)); + deserializedApplicationRule.protocols = protocols; + } else if ("targetFqdns".equals(fieldName)) { + List targetFqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationRule.targetFqdns = targetFqdns; + } else if ("targetUrls".equals(fieldName)) { + List targetUrls = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationRule.targetUrls = targetUrls; + } else if ("fqdnTags".equals(fieldName)) { + List fqdnTags = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationRule.fqdnTags = fqdnTags; + } else if ("sourceIpGroups".equals(fieldName)) { + List sourceIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationRule.sourceIpGroups = sourceIpGroups; + } else if ("terminateTLS".equals(fieldName)) { + deserializedApplicationRule.terminateTls = reader.getNullable(JsonReader::getBoolean); + } else if ("webCategories".equals(fieldName)) { + List webCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationRule.webCategories = webCategories; + } else if ("httpHeadersToInsert".equals(fieldName)) { + List httpHeadersToInsert + = reader.readArray(reader1 -> FirewallPolicyHttpHeaderToInsert.fromJson(reader1)); + deserializedApplicationRule.httpHeadersToInsert = httpHeadersToInsert; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationRule; + }); + } +} 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..84287fa115cd7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroup.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..836db39ad927b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroupListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of application security groups. + */ +@Fluent +public final class ApplicationSecurityGroupListResult implements JsonSerializable { + /* + * A list of application security groups. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ApplicationSecurityGroupListResult class. + */ + public ApplicationSecurityGroupListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationSecurityGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationSecurityGroupListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationSecurityGroupListResult. + */ + public static ApplicationSecurityGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationSecurityGroupListResult deserializedApplicationSecurityGroupListResult + = new ApplicationSecurityGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ApplicationSecurityGroupInner.fromJson(reader1)); + deserializedApplicationSecurityGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedApplicationSecurityGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationSecurityGroupListResult; + }); + } +} 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..93ae0ed5967e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ApplicationSecurityGroups.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..9691a2fb6d2ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AssociationType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The association type of the child resource to the parent resource. + */ +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 a new instance of AssociationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssociationType() { + } + + /** + * Creates or finds a AssociationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssociationType. + */ + public static AssociationType fromString(String name) { + return fromString(name, AssociationType.class); + } + + /** + * Gets known AssociationType values. + * + * @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..42852f43b4f84 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthenticationMethod.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VPN client authentication method. + */ +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 a new instance of AuthenticationMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthenticationMethod() { + } + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMethod. + */ + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** + * Gets known AuthenticationMethod values. + * + * @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..aa5a4d9d39cca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitAuthorizationInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. + */ +@Fluent +public final class AuthorizationListResult implements JsonSerializable { + /* + * The authorizations in an ExpressRoute Circuit. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AuthorizationListResult class. + */ + public AuthorizationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AuthorizationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AuthorizationListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AuthorizationListResult. + */ + public static AuthorizationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AuthorizationListResult deserializedAuthorizationListResult = new AuthorizationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCircuitAuthorizationInner.fromJson(reader1)); + deserializedAuthorizationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAuthorizationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAuthorizationListResult; + }); + } +} 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..f0ad2e0f01018 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AuthorizationUseStatus.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The authorization use status. + */ +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 a new instance of AuthorizationUseStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthorizationUseStatus() { + } + + /** + * Creates or finds a AuthorizationUseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthorizationUseStatus. + */ + public static AuthorizationUseStatus fromString(String name) { + return fromString(name, AuthorizationUseStatus.class); + } + + /** + * Gets known AuthorizationUseStatus values. + * + * @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..bed1ee1181dcd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkService.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.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..aebe07c3eec7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoApprovedPrivateLinkServicesResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AutoApprovedPrivateLinkServiceInner; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * An array of auto approved private link service. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AutoApprovedPrivateLinkServicesResult class. + */ + public AutoApprovedPrivateLinkServicesResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoApprovedPrivateLinkServicesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoApprovedPrivateLinkServicesResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AutoApprovedPrivateLinkServicesResult. + */ + public static AutoApprovedPrivateLinkServicesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoApprovedPrivateLinkServicesResult deserializedAutoApprovedPrivateLinkServicesResult + = new AutoApprovedPrivateLinkServicesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AutoApprovedPrivateLinkServiceInner.fromJson(reader1)); + deserializedAutoApprovedPrivateLinkServicesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAutoApprovedPrivateLinkServicesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoApprovedPrivateLinkServicesResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoLearnPrivateRangesMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoLearnPrivateRangesMode.java new file mode 100644 index 0000000000000..acb29f3b1766f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AutoLearnPrivateRangesMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The operation mode for automatically learning private ranges to not be SNAT. + */ +public final class AutoLearnPrivateRangesMode extends ExpandableStringEnum { + /** + * Static value Enabled for AutoLearnPrivateRangesMode. + */ + public static final AutoLearnPrivateRangesMode ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for AutoLearnPrivateRangesMode. + */ + public static final AutoLearnPrivateRangesMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AutoLearnPrivateRangesMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoLearnPrivateRangesMode() { + } + + /** + * Creates or finds a AutoLearnPrivateRangesMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoLearnPrivateRangesMode. + */ + public static AutoLearnPrivateRangesMode fromString(String name) { + return fromString(name, AutoLearnPrivateRangesMode.class); + } + + /** + * Gets known AutoLearnPrivateRangesMode values. + * + * @return known AutoLearnPrivateRangesMode values. + */ + public static Collection values() { + return values(AutoLearnPrivateRangesMode.class); + } +} 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..dc8d65c911945 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Availability.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Availability of the metric. + */ +@Fluent +public final class Availability implements JsonSerializable { + /* + * The time grain of the availability. + */ + private String timeGrain; + + /* + * The retention of the availability. + */ + private String retention; + + /* + * Duration of the availability blob. + */ + private String blobDuration; + + /** + * Creates an instance of Availability class. + */ + public Availability() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeGrain", this.timeGrain); + jsonWriter.writeStringField("retention", this.retention); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Availability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Availability if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Availability. + */ + public static Availability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Availability deserializedAvailability = new Availability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeGrain".equals(fieldName)) { + deserializedAvailability.timeGrain = reader.getString(); + } else if ("retention".equals(fieldName)) { + deserializedAvailability.retention = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedAvailability.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailability; + }); + } +} 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..909811a92b245 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegation.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.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..3ee596c1b6dbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegations.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.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..5296a5e67ecfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableDelegationsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableDelegationInner; +import java.io.IOException; +import java.util.List; + +/** + * An array of available delegations. + */ +@Fluent +public final class AvailableDelegationsResult implements JsonSerializable { + /* + * An array of available delegations. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AvailableDelegationsResult class. + */ + public AvailableDelegationsResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableDelegationsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableDelegationsResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableDelegationsResult. + */ + public static AvailableDelegationsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableDelegationsResult deserializedAvailableDelegationsResult = new AvailableDelegationsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvailableDelegationInner.fromJson(reader1)); + deserializedAvailableDelegationsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvailableDelegationsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableDelegationsResult; + }); + } +} 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..40debfc098300 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableEndpointServices.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.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..3c9da852ed059 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointType.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.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..158a4a771ee1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypes.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..d65c9cb523604 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailablePrivateEndpointTypesResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AvailablePrivateEndpointTypeInner; +import java.io.IOException; +import java.util.List; + +/** + * An array of available PrivateEndpoint types. + */ +@Fluent +public final class AvailablePrivateEndpointTypesResult + implements JsonSerializable { + /* + * An array of available privateEndpoint type. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AvailablePrivateEndpointTypesResult class. + */ + public AvailablePrivateEndpointTypesResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailablePrivateEndpointTypesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailablePrivateEndpointTypesResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailablePrivateEndpointTypesResult. + */ + public static AvailablePrivateEndpointTypesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailablePrivateEndpointTypesResult deserializedAvailablePrivateEndpointTypesResult + = new AvailablePrivateEndpointTypesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvailablePrivateEndpointTypeInner.fromJson(reader1)); + deserializedAvailablePrivateEndpointTypesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvailablePrivateEndpointTypesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailablePrivateEndpointTypesResult; + }); + } +} 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..37e1525e311ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersList.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.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..638450874f032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCity.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * City or town details. + */ +@Fluent +public final class AvailableProvidersListCity implements JsonSerializable { + /* + * The city or town name. + */ + private String cityName; + + /* + * A list of Internet service providers. + */ + private List providers; + + /** + * Creates an instance of AvailableProvidersListCity class. + */ + public AvailableProvidersListCity() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cityName", this.cityName); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableProvidersListCity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableProvidersListCity if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableProvidersListCity. + */ + public static AvailableProvidersListCity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableProvidersListCity deserializedAvailableProvidersListCity = new AvailableProvidersListCity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cityName".equals(fieldName)) { + deserializedAvailableProvidersListCity.cityName = reader.getString(); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedAvailableProvidersListCity.providers = providers; + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableProvidersListCity; + }); + } +} 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..dfdaddb34cfa7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListCountry.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Country details. + */ +@Fluent +public final class AvailableProvidersListCountry implements JsonSerializable { + /* + * The country name. + */ + private String countryName; + + /* + * A list of Internet service providers. + */ + private List providers; + + /* + * List of available states in the country. + */ + private List states; + + /** + * Creates an instance of AvailableProvidersListCountry class. + */ + public AvailableProvidersListCountry() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("countryName", this.countryName); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("states", this.states, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableProvidersListCountry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableProvidersListCountry if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableProvidersListCountry. + */ + public static AvailableProvidersListCountry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableProvidersListCountry deserializedAvailableProvidersListCountry + = new AvailableProvidersListCountry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("countryName".equals(fieldName)) { + deserializedAvailableProvidersListCountry.countryName = reader.getString(); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedAvailableProvidersListCountry.providers = providers; + } else if ("states".equals(fieldName)) { + List states + = reader.readArray(reader1 -> AvailableProvidersListState.fromJson(reader1)); + deserializedAvailableProvidersListCountry.states = states; + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableProvidersListCountry; + }); + } +} 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..69e379861de11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListParameters.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Constraints that determine the list of available Internet service providers. + */ +@Fluent +public final class AvailableProvidersListParameters implements JsonSerializable { + /* + * A list of Azure regions. + */ + private List azureLocations; + + /* + * The country for available providers list. + */ + private String country; + + /* + * The state for available providers list. + */ + private String state; + + /* + * The city or town for available providers list. + */ + private String city; + + /** + * Creates an instance of AvailableProvidersListParameters class. + */ + public AvailableProvidersListParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("azureLocations", this.azureLocations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("country", this.country); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("city", this.city); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableProvidersListParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableProvidersListParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableProvidersListParameters. + */ + public static AvailableProvidersListParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableProvidersListParameters deserializedAvailableProvidersListParameters + = new AvailableProvidersListParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureLocations".equals(fieldName)) { + List azureLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedAvailableProvidersListParameters.azureLocations = azureLocations; + } else if ("country".equals(fieldName)) { + deserializedAvailableProvidersListParameters.country = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedAvailableProvidersListParameters.state = reader.getString(); + } else if ("city".equals(fieldName)) { + deserializedAvailableProvidersListParameters.city = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableProvidersListParameters; + }); + } +} 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..25bd1a9355d59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableProvidersListState.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * State details. + */ +@Fluent +public final class AvailableProvidersListState implements JsonSerializable { + /* + * The state name. + */ + private String stateName; + + /* + * A list of Internet service providers. + */ + private List providers; + + /* + * List of available cities or towns in the state. + */ + private List cities; + + /** + * Creates an instance of AvailableProvidersListState class. + */ + public AvailableProvidersListState() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("stateName", this.stateName); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("cities", this.cities, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableProvidersListState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableProvidersListState if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableProvidersListState. + */ + public static AvailableProvidersListState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableProvidersListState deserializedAvailableProvidersListState = new AvailableProvidersListState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("stateName".equals(fieldName)) { + deserializedAvailableProvidersListState.stateName = reader.getString(); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedAvailableProvidersListState.providers = providers; + } else if ("cities".equals(fieldName)) { + List cities + = reader.readArray(reader1 -> AvailableProvidersListCity.fromJson(reader1)); + deserializedAvailableProvidersListState.cities = cities; + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableProvidersListState; + }); + } +} 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..91b776b6069fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableResourceGroupDelegations.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.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..969ad60470055 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAlias.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.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..69e96d622e856 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliases.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.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..e86f9a1554a90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AvailableServiceAliasesResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AvailableServiceAliasInner; +import java.io.IOException; +import java.util.List; + +/** + * An array of available service aliases. + */ +@Fluent +public final class AvailableServiceAliasesResult implements JsonSerializable { + /* + * An array of available service aliases. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AvailableServiceAliasesResult class. + */ + public AvailableServiceAliasesResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AvailableServiceAliasesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AvailableServiceAliasesResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AvailableServiceAliasesResult. + */ + public static AvailableServiceAliasesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AvailableServiceAliasesResult deserializedAvailableServiceAliasesResult + = new AvailableServiceAliasesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AvailableServiceAliasInner.fromJson(reader1)); + deserializedAvailableServiceAliasesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAvailableServiceAliasesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailableServiceAliasesResult; + }); + } +} 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..ca0ec6189a0a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewall.java @@ -0,0 +1,563 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 autoscaleConfiguration property: Properties to provide a custom autoscale configuration to this azure + * firewall. + * + * @return the autoscaleConfiguration value. + */ + AzureFirewallAutoscaleConfiguration autoscaleConfiguration(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithAutoscaleConfiguration { + /** + * 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); + } + + /** + * The stage of the AzureFirewall definition allowing to specify autoscaleConfiguration. + */ + interface WithAutoscaleConfiguration { + /** + * Specifies the autoscaleConfiguration property: Properties to provide a custom autoscale configuration to + * this azure firewall.. + * + * @param autoscaleConfiguration Properties to provide a custom autoscale configuration to this azure + * firewall. + * @return the next definition stage. + */ + WithCreate withAutoscaleConfiguration(AzureFirewallAutoscaleConfiguration autoscaleConfiguration); + } + } + + /** + * 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); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @throws com.azure.core.management.exception.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 SNAT IP Prefixes learnt by firewall to not SNAT. + */ + IpPrefixesList listLearnedPrefixes(); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SNAT IP Prefixes learnt by firewall to not SNAT. + */ + IpPrefixesList listLearnedPrefixes(Context context); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(FirewallPacketCaptureParameters parameters); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(FirewallPacketCaptureParameters parameters, 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..b2e5a75e1d176 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of an application rule. + */ +@Fluent +public final class AzureFirewallApplicationRule implements JsonSerializable { + /* + * Name of the application rule. + */ + private String name; + + /* + * Description of the rule. + */ + private String description; + + /* + * List of source IP addresses for this rule. + */ + private List sourceAddresses; + + /* + * Array of ApplicationRuleProtocols. + */ + private List protocols; + + /* + * List of FQDNs for this rule. + */ + private List targetFqdns; + + /* + * List of FQDN Tags for this rule. + */ + private List fqdnTags; + + /* + * List of source IpGroups for this rule. + */ + private List sourceIpGroups; + + /** + * Creates an instance of AzureFirewallApplicationRule class. + */ + public AzureFirewallApplicationRule() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("protocols", this.protocols, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("targetFqdns", this.targetFqdns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("fqdnTags", this.fqdnTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sourceIpGroups", this.sourceIpGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallApplicationRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallApplicationRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallApplicationRule. + */ + public static AzureFirewallApplicationRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallApplicationRule deserializedAzureFirewallApplicationRule = new AzureFirewallApplicationRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureFirewallApplicationRule.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAzureFirewallApplicationRule.description = reader.getString(); + } else if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallApplicationRule.sourceAddresses = sourceAddresses; + } else if ("protocols".equals(fieldName)) { + List protocols + = reader.readArray(reader1 -> AzureFirewallApplicationRuleProtocol.fromJson(reader1)); + deserializedAzureFirewallApplicationRule.protocols = protocols; + } else if ("targetFqdns".equals(fieldName)) { + List targetFqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallApplicationRule.targetFqdns = targetFqdns; + } else if ("fqdnTags".equals(fieldName)) { + List fqdnTags = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallApplicationRule.fqdnTags = fqdnTags; + } else if ("sourceIpGroups".equals(fieldName)) { + List sourceIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallApplicationRule.sourceIpGroups = sourceIpGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallApplicationRule; + }); + } +} 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..a45587fa7ef20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleCollection.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallApplicationRuleCollectionPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Application rule collection resource. + */ +@Fluent +public final class AzureFirewallApplicationRuleCollection extends SubResource { + /* + * Properties of the azure firewall application rule collection. + */ + private AzureFirewallApplicationRuleCollectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of AzureFirewallApplicationRuleCollection class. + */ + public AzureFirewallApplicationRuleCollection() { + } + + /** + * Get the innerProperties property: Properties of the azure firewall application rule collection. + * + * @return the innerProperties value. + */ + private AzureFirewallApplicationRuleCollectionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallApplicationRuleCollection withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the priority property: Priority of the application rule collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the action property: The action type of a rule collection. + * + * @return the action value. + */ + public AzureFirewallRCAction action() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); + } + this.innerProperties().withAction(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallApplicationRuleCollectionPropertiesFormat(); + } + this.innerProperties().withRules(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallApplicationRuleCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallApplicationRuleCollection if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallApplicationRuleCollection. + */ + public static AzureFirewallApplicationRuleCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallApplicationRuleCollection deserializedAzureFirewallApplicationRuleCollection + = new AzureFirewallApplicationRuleCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleCollection.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleCollection.innerProperties + = AzureFirewallApplicationRuleCollectionPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleCollection.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleCollection.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallApplicationRuleCollection; + }); + } +} 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..80bc610046da6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocol.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the application rule protocol. + */ +@Fluent +public final class AzureFirewallApplicationRuleProtocol + implements JsonSerializable { + /* + * Protocol type. + */ + private AzureFirewallApplicationRuleProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. This field is optional. + */ + private Integer port; + + /** + * Creates an instance of AzureFirewallApplicationRuleProtocol class. + */ + public AzureFirewallApplicationRuleProtocol() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocolType", this.protocolType == null ? null : this.protocolType.toString()); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallApplicationRuleProtocol from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallApplicationRuleProtocol if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallApplicationRuleProtocol. + */ + public static AzureFirewallApplicationRuleProtocol fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallApplicationRuleProtocol deserializedAzureFirewallApplicationRuleProtocol + = new AzureFirewallApplicationRuleProtocol(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocolType".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleProtocol.protocolType + = AzureFirewallApplicationRuleProtocolType.fromString(reader.getString()); + } else if ("port".equals(fieldName)) { + deserializedAzureFirewallApplicationRuleProtocol.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallApplicationRuleProtocol; + }); + } +} 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..3e9b7273f15f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallApplicationRuleProtocolType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol type of a Application Rule resource. + */ +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 a new instance of AzureFirewallApplicationRuleProtocolType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallApplicationRuleProtocolType() { + } + + /** + * Creates or finds a AzureFirewallApplicationRuleProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallApplicationRuleProtocolType. + */ + public static AzureFirewallApplicationRuleProtocolType fromString(String name) { + return fromString(name, AzureFirewallApplicationRuleProtocolType.class); + } + + /** + * Gets known AzureFirewallApplicationRuleProtocolType values. + * + * @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/AzureFirewallAutoscaleConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallAutoscaleConfiguration.java new file mode 100644 index 0000000000000..96e385eadc8ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallAutoscaleConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Firewall Autoscale Configuration parameters. + */ +@Fluent +public final class AzureFirewallAutoscaleConfiguration + implements JsonSerializable { + /* + * The minimum number of capacity units for this azure firewall. Use null to reset the value to the service default. + */ + private Integer minCapacity; + + /* + * The maximum number of capacity units for this azure firewall. Use null to reset the value to the service default. + */ + private Integer maxCapacity; + + /** + * Creates an instance of AzureFirewallAutoscaleConfiguration class. + */ + public AzureFirewallAutoscaleConfiguration() { + } + + /** + * Get the minCapacity property: The minimum number of capacity units for this azure firewall. Use null to reset the + * value to the service default. + * + * @return the minCapacity value. + */ + public Integer minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: The minimum number of capacity units for this azure firewall. Use null to reset the + * value to the service default. + * + * @param minCapacity the minCapacity value to set. + * @return the AzureFirewallAutoscaleConfiguration object itself. + */ + public AzureFirewallAutoscaleConfiguration withMinCapacity(Integer minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Get the maxCapacity property: The maximum number of capacity units for this azure firewall. Use null to reset the + * value to the service default. + * + * @return the maxCapacity value. + */ + public Integer maxCapacity() { + return this.maxCapacity; + } + + /** + * Set the maxCapacity property: The maximum number of capacity units for this azure firewall. Use null to reset the + * value to the service default. + * + * @param maxCapacity the maxCapacity value to set. + * @return the AzureFirewallAutoscaleConfiguration object itself. + */ + public AzureFirewallAutoscaleConfiguration withMaxCapacity(Integer maxCapacity) { + this.maxCapacity = maxCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minCapacity", this.minCapacity); + jsonWriter.writeNumberField("maxCapacity", this.maxCapacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallAutoscaleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallAutoscaleConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallAutoscaleConfiguration. + */ + public static AzureFirewallAutoscaleConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallAutoscaleConfiguration deserializedAzureFirewallAutoscaleConfiguration + = new AzureFirewallAutoscaleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minCapacity".equals(fieldName)) { + deserializedAzureFirewallAutoscaleConfiguration.minCapacity + = reader.getNullable(JsonReader::getInt); + } else if ("maxCapacity".equals(fieldName)) { + deserializedAzureFirewallAutoscaleConfiguration.maxCapacity + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallAutoscaleConfiguration; + }); + } +} 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..60dbd6580fd04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTag.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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..3f390a71f10ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTagListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallFqdnTagInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListAzureFirewallFqdnTags API service call. + */ +@Fluent +public final class AzureFirewallFqdnTagListResult implements JsonSerializable { + /* + * List of Azure Firewall FQDN Tags in a resource group. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AzureFirewallFqdnTagListResult class. + */ + public AzureFirewallFqdnTagListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallFqdnTagListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallFqdnTagListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallFqdnTagListResult. + */ + public static AzureFirewallFqdnTagListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallFqdnTagListResult deserializedAzureFirewallFqdnTagListResult + = new AzureFirewallFqdnTagListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AzureFirewallFqdnTagInner.fromJson(reader1)); + deserializedAzureFirewallFqdnTagListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAzureFirewallFqdnTagListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallFqdnTagListResult; + }); + } +} 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..cca0cd5d25c36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallFqdnTags.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..082b339ec5d1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallIpConfigurationPropertiesFormat; +import java.io.IOException; + +/** + * IP configuration of an Azure Firewall. + */ +@Fluent +public final class AzureFirewallIpConfiguration extends SubResource { + /* + * Properties of the azure firewall IP configuration. + */ + private AzureFirewallIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of AzureFirewallIpConfiguration class. + */ + public AzureFirewallIpConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the azure firewall IP configuration. + * + * @return the innerProperties value. + */ + private AzureFirewallIpConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallIpConfigurationPropertiesFormat(); + } + this.innerProperties().withSubnet(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPublicIpAddress(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallIpConfiguration if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallIpConfiguration. + */ + public static AzureFirewallIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallIpConfiguration deserializedAzureFirewallIpConfiguration = new AzureFirewallIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureFirewallIpConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAzureFirewallIpConfiguration.innerProperties + = AzureFirewallIpConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAzureFirewallIpConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAzureFirewallIpConfiguration.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureFirewallIpConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallIpConfiguration; + }); + } +} 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..6d7b66deea23b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallIpGroups.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IpGroups associated with azure firewall. + */ +@Immutable +public final class AzureFirewallIpGroups implements JsonSerializable { + /* + * Resource ID. + */ + private String id; + + /* + * The iteration number. + */ + private String changeNumber; + + /** + * Creates an instance of AzureFirewallIpGroups class. + */ + public AzureFirewallIpGroups() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallIpGroups from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallIpGroups if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallIpGroups. + */ + public static AzureFirewallIpGroups fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallIpGroups deserializedAzureFirewallIpGroups = new AzureFirewallIpGroups(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureFirewallIpGroups.id = reader.getString(); + } else if ("changeNumber".equals(fieldName)) { + deserializedAzureFirewallIpGroups.changeNumber = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallIpGroups; + }); + } +} 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..4a8c8d44f08a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListAzureFirewalls API service call. + */ +@Fluent +public final class AzureFirewallListResult implements JsonSerializable { + /* + * List of Azure Firewalls in a resource group. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AzureFirewallListResult class. + */ + public AzureFirewallListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallListResult. + */ + public static AzureFirewallListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallListResult deserializedAzureFirewallListResult = new AzureFirewallListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AzureFirewallInner.fromJson(reader1)); + deserializedAzureFirewallListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAzureFirewallListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallListResult; + }); + } +} 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..8353b9694bf35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCAction.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.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * AzureFirewall NAT Rule Collection Action. + */ +@Fluent +public final class AzureFirewallNatRCAction implements JsonSerializable { + /* + * The type of action. + */ + private AzureFirewallNatRCActionType type; + + /** + * Creates an instance of AzureFirewallNatRCAction class. + */ + public AzureFirewallNatRCAction() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallNatRCAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallNatRCAction if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallNatRCAction. + */ + public static AzureFirewallNatRCAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallNatRCAction deserializedAzureFirewallNatRCAction = new AzureFirewallNatRCAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureFirewallNatRCAction.type + = AzureFirewallNatRCActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallNatRCAction; + }); + } +} 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..ed32bf5e47395 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRCActionType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The action type of a NAT rule collection. + */ +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 a new instance of AzureFirewallNatRCActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallNatRCActionType() { + } + + /** + * Creates or finds a AzureFirewallNatRCActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallNatRCActionType. + */ + public static AzureFirewallNatRCActionType fromString(String name) { + return fromString(name, AzureFirewallNatRCActionType.class); + } + + /** + * Gets known AzureFirewallNatRCActionType values. + * + * @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..d524e19c2fea3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRule.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a NAT rule. + */ +@Fluent +public final class AzureFirewallNatRule implements JsonSerializable { + /* + * Name of the NAT rule. + */ + private String name; + + /* + * Description of the rule. + */ + private String description; + + /* + * List of source IP addresses for this rule. + */ + private List sourceAddresses; + + /* + * List of destination IP addresses for this rule. Supports IP ranges, prefixes, and service tags. + */ + private List destinationAddresses; + + /* + * List of destination ports. + */ + private List destinationPorts; + + /* + * Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. + */ + private List protocols; + + /* + * The translated address for this NAT rule. + */ + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + private String translatedPort; + + /* + * The translated FQDN for this NAT rule. + */ + private String translatedFqdn; + + /* + * List of source IpGroups for this rule. + */ + private List sourceIpGroups; + + /** + * Creates an instance of AzureFirewallNatRule class. + */ + public AzureFirewallNatRule() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationAddresses", this.destinationAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("protocols", this.protocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("translatedAddress", this.translatedAddress); + jsonWriter.writeStringField("translatedPort", this.translatedPort); + jsonWriter.writeStringField("translatedFqdn", this.translatedFqdn); + jsonWriter.writeArrayField("sourceIpGroups", this.sourceIpGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallNatRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallNatRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallNatRule. + */ + public static AzureFirewallNatRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallNatRule deserializedAzureFirewallNatRule = new AzureFirewallNatRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureFirewallNatRule.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAzureFirewallNatRule.description = reader.getString(); + } else if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNatRule.sourceAddresses = sourceAddresses; + } else if ("destinationAddresses".equals(fieldName)) { + List destinationAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNatRule.destinationAddresses = destinationAddresses; + } else if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNatRule.destinationPorts = destinationPorts; + } else if ("protocols".equals(fieldName)) { + List protocols + = reader.readArray(reader1 -> AzureFirewallNetworkRuleProtocol.fromString(reader1.getString())); + deserializedAzureFirewallNatRule.protocols = protocols; + } else if ("translatedAddress".equals(fieldName)) { + deserializedAzureFirewallNatRule.translatedAddress = reader.getString(); + } else if ("translatedPort".equals(fieldName)) { + deserializedAzureFirewallNatRule.translatedPort = reader.getString(); + } else if ("translatedFqdn".equals(fieldName)) { + deserializedAzureFirewallNatRule.translatedFqdn = reader.getString(); + } else if ("sourceIpGroups".equals(fieldName)) { + List sourceIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNatRule.sourceIpGroups = sourceIpGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallNatRule; + }); + } +} 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..caca4f5de6c16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNatRuleCollection.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallNatRuleCollectionProperties; +import java.io.IOException; +import java.util.List; + +/** + * NAT rule collection resource. + */ +@Fluent +public final class AzureFirewallNatRuleCollection extends SubResource { + /* + * Properties of the azure firewall NAT rule collection. + */ + private AzureFirewallNatRuleCollectionProperties innerProperties; + + /* + * The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of AzureFirewallNatRuleCollection class. + */ + public AzureFirewallNatRuleCollection() { + } + + /** + * Get the innerProperties property: Properties of the azure firewall NAT rule collection. + * + * @return the innerProperties value. + */ + private AzureFirewallNatRuleCollectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallNatRuleCollection withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the priority property: Priority of the NAT rule collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallNatRuleCollectionProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the action property: The action type of a NAT rule collection. + * + * @return the action value. + */ + public AzureFirewallNatRCAction action() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallNatRuleCollectionProperties(); + } + this.innerProperties().withAction(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallNatRuleCollectionProperties(); + } + this.innerProperties().withRules(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallNatRuleCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallNatRuleCollection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallNatRuleCollection. + */ + public static AzureFirewallNatRuleCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallNatRuleCollection deserializedAzureFirewallNatRuleCollection + = new AzureFirewallNatRuleCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureFirewallNatRuleCollection.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAzureFirewallNatRuleCollection.innerProperties + = AzureFirewallNatRuleCollectionProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAzureFirewallNatRuleCollection.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAzureFirewallNatRuleCollection.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallNatRuleCollection; + }); + } +} 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..148d85f27b6f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRule.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the network rule. + */ +@Fluent +public final class AzureFirewallNetworkRule implements JsonSerializable { + /* + * Name of the network rule. + */ + private String name; + + /* + * Description of the rule. + */ + private String description; + + /* + * Array of AzureFirewallNetworkRuleProtocols. + */ + private List protocols; + + /* + * List of source IP addresses for this rule. + */ + private List sourceAddresses; + + /* + * List of destination IP addresses. + */ + private List destinationAddresses; + + /* + * List of destination ports. + */ + private List destinationPorts; + + /* + * List of destination FQDNs. + */ + private List destinationFqdns; + + /* + * List of source IpGroups for this rule. + */ + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + private List destinationIpGroups; + + /** + * Creates an instance of AzureFirewallNetworkRule class. + */ + public AzureFirewallNetworkRule() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("protocols", this.protocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationAddresses", this.destinationAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationFqdns", this.destinationFqdns, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sourceIpGroups", this.sourceIpGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationIpGroups", this.destinationIpGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallNetworkRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallNetworkRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallNetworkRule. + */ + public static AzureFirewallNetworkRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallNetworkRule deserializedAzureFirewallNetworkRule = new AzureFirewallNetworkRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureFirewallNetworkRule.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAzureFirewallNetworkRule.description = reader.getString(); + } else if ("protocols".equals(fieldName)) { + List protocols + = reader.readArray(reader1 -> AzureFirewallNetworkRuleProtocol.fromString(reader1.getString())); + deserializedAzureFirewallNetworkRule.protocols = protocols; + } else if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNetworkRule.sourceAddresses = sourceAddresses; + } else if ("destinationAddresses".equals(fieldName)) { + List destinationAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNetworkRule.destinationAddresses = destinationAddresses; + } else if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNetworkRule.destinationPorts = destinationPorts; + } else if ("destinationFqdns".equals(fieldName)) { + List destinationFqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNetworkRule.destinationFqdns = destinationFqdns; + } else if ("sourceIpGroups".equals(fieldName)) { + List sourceIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNetworkRule.sourceIpGroups = sourceIpGroups; + } else if ("destinationIpGroups".equals(fieldName)) { + List destinationIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallNetworkRule.destinationIpGroups = destinationIpGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallNetworkRule; + }); + } +} 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..cce3749fb087e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleCollection.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AzureFirewallNetworkRuleCollectionPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Network rule collection resource. + */ +@Fluent +public final class AzureFirewallNetworkRuleCollection extends SubResource { + /* + * Properties of the azure firewall network rule collection. + */ + private AzureFirewallNetworkRuleCollectionPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of AzureFirewallNetworkRuleCollection class. + */ + public AzureFirewallNetworkRuleCollection() { + } + + /** + * Get the innerProperties property: Properties of the azure firewall network rule collection. + * + * @return the innerProperties value. + */ + private AzureFirewallNetworkRuleCollectionPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public AzureFirewallNetworkRuleCollection withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the priority property: Priority of the network rule collection resource. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the action property: The action type of a rule collection. + * + * @return the action value. + */ + public AzureFirewallRCAction action() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); + } + this.innerProperties().withAction(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureFirewallNetworkRuleCollectionPropertiesFormat(); + } + this.innerProperties().withRules(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallNetworkRuleCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallNetworkRuleCollection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallNetworkRuleCollection. + */ + public static AzureFirewallNetworkRuleCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallNetworkRuleCollection deserializedAzureFirewallNetworkRuleCollection + = new AzureFirewallNetworkRuleCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureFirewallNetworkRuleCollection.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedAzureFirewallNetworkRuleCollection.innerProperties + = AzureFirewallNetworkRuleCollectionPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedAzureFirewallNetworkRuleCollection.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAzureFirewallNetworkRuleCollection.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallNetworkRuleCollection; + }); + } +} 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..f304ac60fcb95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallNetworkRuleProtocol.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 java.util.Collection; + +/** + * The protocol of a Network Rule resource. + */ +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 a new instance of AzureFirewallNetworkRuleProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallNetworkRuleProtocol() { + } + + /** + * Creates or finds a AzureFirewallNetworkRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallNetworkRuleProtocol. + */ + public static AzureFirewallNetworkRuleProtocol fromString(String name) { + return fromString(name, AzureFirewallNetworkRuleProtocol.class); + } + + /** + * Gets known AzureFirewallNetworkRuleProtocol values. + * + * @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/AzureFirewallPacketCaptureFlags.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureFlags.java new file mode 100644 index 0000000000000..b75d1dba53a17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureFlags.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the AzureFirewallRCAction. + */ +@Fluent +public final class AzureFirewallPacketCaptureFlags implements JsonSerializable { + /* + * Flags to capture + */ + private AzureFirewallPacketCaptureFlagsType type; + + /** + * Creates an instance of AzureFirewallPacketCaptureFlags class. + */ + public AzureFirewallPacketCaptureFlags() { + } + + /** + * Get the type property: Flags to capture. + * + * @return the type value. + */ + public AzureFirewallPacketCaptureFlagsType type() { + return this.type; + } + + /** + * Set the type property: Flags to capture. + * + * @param type the type value to set. + * @return the AzureFirewallPacketCaptureFlags object itself. + */ + public AzureFirewallPacketCaptureFlags withType(AzureFirewallPacketCaptureFlagsType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallPacketCaptureFlags from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallPacketCaptureFlags if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallPacketCaptureFlags. + */ + public static AzureFirewallPacketCaptureFlags fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallPacketCaptureFlags deserializedAzureFirewallPacketCaptureFlags + = new AzureFirewallPacketCaptureFlags(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureFirewallPacketCaptureFlags.type + = AzureFirewallPacketCaptureFlagsType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallPacketCaptureFlags; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureFlagsType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureFlagsType.java new file mode 100644 index 0000000000000..f589f6e213117 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureFlagsType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The flags type to be captured. + */ +public final class AzureFirewallPacketCaptureFlagsType + extends ExpandableStringEnum { + /** + * Static value fin for AzureFirewallPacketCaptureFlagsType. + */ + public static final AzureFirewallPacketCaptureFlagsType FIN = fromString("fin"); + + /** + * Static value syn for AzureFirewallPacketCaptureFlagsType. + */ + public static final AzureFirewallPacketCaptureFlagsType SYN = fromString("syn"); + + /** + * Static value rst for AzureFirewallPacketCaptureFlagsType. + */ + public static final AzureFirewallPacketCaptureFlagsType RST = fromString("rst"); + + /** + * Static value push for AzureFirewallPacketCaptureFlagsType. + */ + public static final AzureFirewallPacketCaptureFlagsType PUSH = fromString("push"); + + /** + * Static value ack for AzureFirewallPacketCaptureFlagsType. + */ + public static final AzureFirewallPacketCaptureFlagsType ACK = fromString("ack"); + + /** + * Static value urg for AzureFirewallPacketCaptureFlagsType. + */ + public static final AzureFirewallPacketCaptureFlagsType URG = fromString("urg"); + + /** + * Creates a new instance of AzureFirewallPacketCaptureFlagsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallPacketCaptureFlagsType() { + } + + /** + * Creates or finds a AzureFirewallPacketCaptureFlagsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallPacketCaptureFlagsType. + */ + public static AzureFirewallPacketCaptureFlagsType fromString(String name) { + return fromString(name, AzureFirewallPacketCaptureFlagsType.class); + } + + /** + * Gets known AzureFirewallPacketCaptureFlagsType values. + * + * @return known AzureFirewallPacketCaptureFlagsType values. + */ + public static Collection values() { + return values(AzureFirewallPacketCaptureFlagsType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureRule.java new file mode 100644 index 0000000000000..861177a44d935 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPacketCaptureRule.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Group of src/dest ips and ports to be captured. + */ +@Fluent +public final class AzureFirewallPacketCaptureRule implements JsonSerializable { + /* + * List of source IP addresses/subnets to be captured. + */ + private List sources; + + /* + * List of destination IP addresses/subnets to be captured. + */ + private List destinations; + + /* + * List of ports to be captured. + */ + private List destinationPorts; + + /** + * Creates an instance of AzureFirewallPacketCaptureRule class. + */ + public AzureFirewallPacketCaptureRule() { + } + + /** + * Get the sources property: List of source IP addresses/subnets to be captured. + * + * @return the sources value. + */ + public List sources() { + return this.sources; + } + + /** + * Set the sources property: List of source IP addresses/subnets to be captured. + * + * @param sources the sources value to set. + * @return the AzureFirewallPacketCaptureRule object itself. + */ + public AzureFirewallPacketCaptureRule withSources(List sources) { + this.sources = sources; + return this; + } + + /** + * Get the destinations property: List of destination IP addresses/subnets to be captured. + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of destination IP addresses/subnets to be captured. + * + * @param destinations the destinations value to set. + * @return the AzureFirewallPacketCaptureRule object itself. + */ + public AzureFirewallPacketCaptureRule withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the destinationPorts property: List of ports to be captured. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: List of ports to be captured. + * + * @param destinationPorts the destinationPorts value to set. + * @return the AzureFirewallPacketCaptureRule object itself. + */ + public AzureFirewallPacketCaptureRule withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallPacketCaptureRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallPacketCaptureRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallPacketCaptureRule. + */ + public static AzureFirewallPacketCaptureRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallPacketCaptureRule deserializedAzureFirewallPacketCaptureRule + = new AzureFirewallPacketCaptureRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallPacketCaptureRule.sources = sources; + } else if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallPacketCaptureRule.destinations = destinations; + } else if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureFirewallPacketCaptureRule.destinationPorts = destinationPorts; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallPacketCaptureRule; + }); + } +} 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..5ac5f045bbbd9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallPublicIpAddress.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Public IP Address associated with azure firewall. + */ +@Fluent +public final class AzureFirewallPublicIpAddress implements JsonSerializable { + /* + * Public IP Address value. + */ + private String address; + + /** + * Creates an instance of AzureFirewallPublicIpAddress class. + */ + public AzureFirewallPublicIpAddress() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallPublicIpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallPublicIpAddress if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallPublicIpAddress. + */ + public static AzureFirewallPublicIpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallPublicIpAddress deserializedAzureFirewallPublicIpAddress = new AzureFirewallPublicIpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedAzureFirewallPublicIpAddress.address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallPublicIpAddress; + }); + } +} 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..38c25deb169eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCAction.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the AzureFirewallRCAction. + */ +@Fluent +public final class AzureFirewallRCAction implements JsonSerializable { + /* + * The type of action. + */ + private AzureFirewallRCActionType type; + + /** + * Creates an instance of AzureFirewallRCAction class. + */ + public AzureFirewallRCAction() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallRCAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallRCAction if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallRCAction. + */ + public static AzureFirewallRCAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallRCAction deserializedAzureFirewallRCAction = new AzureFirewallRCAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureFirewallRCAction.type = AzureFirewallRCActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallRCAction; + }); + } +} 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..f0ae409d78168 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallRCActionType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The action type of a rule collection. + */ +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 a new instance of AzureFirewallRCActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallRCActionType() { + } + + /** + * Creates or finds a AzureFirewallRCActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallRCActionType. + */ + public static AzureFirewallRCActionType fromString(String name) { + return fromString(name, AzureFirewallRCActionType.class); + } + + /** + * Gets known AzureFirewallRCActionType values. + * + * @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..0e2316b78b92e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSku.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU of an Azure Firewall. + */ +@Fluent +public final class AzureFirewallSku implements JsonSerializable { + /* + * Name of an Azure Firewall SKU. + */ + private AzureFirewallSkuName name; + + /* + * Tier of an Azure Firewall. + */ + private AzureFirewallSkuTier tier; + + /** + * Creates an instance of AzureFirewallSku class. + */ + public AzureFirewallSku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFirewallSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFirewallSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureFirewallSku. + */ + public static AzureFirewallSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFirewallSku deserializedAzureFirewallSku = new AzureFirewallSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAzureFirewallSku.name = AzureFirewallSkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedAzureFirewallSku.tier = AzureFirewallSkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFirewallSku; + }); + } +} 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..42d55ade41444 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuName.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of an Azure Firewall SKU. + */ +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 a new instance of AzureFirewallSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallSkuName() { + } + + /** + * Creates or finds a AzureFirewallSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallSkuName. + */ + public static AzureFirewallSkuName fromString(String name) { + return fromString(name, AzureFirewallSkuName.class); + } + + /** + * Gets known AzureFirewallSkuName values. + * + * @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..752e2fb6a5f29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallSkuTier.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tier of an Azure Firewall. + */ +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"); + + /** + * Static value Basic for AzureFirewallSkuTier. + */ + public static final AzureFirewallSkuTier BASIC = fromString("Basic"); + + /** + * Creates a new instance of AzureFirewallSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallSkuTier() { + } + + /** + * Creates or finds a AzureFirewallSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallSkuTier. + */ + public static AzureFirewallSkuTier fromString(String name) { + return fromString(name, AzureFirewallSkuTier.class); + } + + /** + * Gets known AzureFirewallSkuTier values. + * + * @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..1ffa2e6b37a5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewallThreatIntelMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The operation mode for Threat Intel. + */ +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 a new instance of AzureFirewallThreatIntelMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureFirewallThreatIntelMode() { + } + + /** + * Creates or finds a AzureFirewallThreatIntelMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureFirewallThreatIntelMode. + */ + public static AzureFirewallThreatIntelMode fromString(String name) { + return fromString(name, AzureFirewallThreatIntelMode.class); + } + + /** + * Gets known AzureFirewallThreatIntelMode values. + * + * @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..3687e556f3de2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureFirewalls.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + IpPrefixesList listLearnedPrefixes(String resourceGroupName, String azureFirewallName); + + /** + * Retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. + * + * @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 list of SNAT IP Prefixes learnt by firewall to not SNAT. + */ + IpPrefixesList listLearnedPrefixes(String resourceGroupName, String azureFirewallName, Context context); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(String resourceGroupName, String azureFirewallName, FirewallPacketCaptureParameters parameters); + + /** + * Runs a packet capture on AzureFirewall. + * + * @param resourceGroupName The name of the resource group. + * @param azureFirewallName The name of the Azure Firewall. + * @param parameters Parameters supplied to run packet capture on 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 packetCapture(String resourceGroupName, String azureFirewallName, FirewallPacketCaptureParameters parameters, + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..9e13981c18a9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReport.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.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..35d68ffceec36 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportItem.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Azure reachability report details for a given provider location. + */ +@Fluent +public final class AzureReachabilityReportItem implements JsonSerializable { + /* + * The Internet service provider. + */ + private String provider; + + /* + * The Azure region. + */ + private String azureLocation; + + /* + * List of latency details for each of the time series. + */ + private List latencies; + + /** + * Creates an instance of AzureReachabilityReportItem class. + */ + public AzureReachabilityReportItem() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("azureLocation", this.azureLocation); + jsonWriter.writeArrayField("latencies", this.latencies, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureReachabilityReportItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureReachabilityReportItem if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureReachabilityReportItem. + */ + public static AzureReachabilityReportItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureReachabilityReportItem deserializedAzureReachabilityReportItem = new AzureReachabilityReportItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedAzureReachabilityReportItem.provider = reader.getString(); + } else if ("azureLocation".equals(fieldName)) { + deserializedAzureReachabilityReportItem.azureLocation = reader.getString(); + } else if ("latencies".equals(fieldName)) { + List latencies + = reader.readArray(reader1 -> AzureReachabilityReportLatencyInfo.fromJson(reader1)); + deserializedAzureReachabilityReportItem.latencies = latencies; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureReachabilityReportItem; + }); + } +} 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..9b366df251394 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLatencyInfo.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.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Details on latency for a time series. + */ +@Fluent +public final class AzureReachabilityReportLatencyInfo implements JsonSerializable { + /* + * The time stamp. + */ + private OffsetDateTime timestamp; + + /* + * The relative latency score between 1 and 100, higher values indicating a faster connection. + */ + private Integer score; + + /** + * Creates an instance of AzureReachabilityReportLatencyInfo class. + */ + public AzureReachabilityReportLatencyInfo() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeStamp", + this.timestamp == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timestamp)); + jsonWriter.writeNumberField("score", this.score); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureReachabilityReportLatencyInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureReachabilityReportLatencyInfo if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureReachabilityReportLatencyInfo. + */ + public static AzureReachabilityReportLatencyInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureReachabilityReportLatencyInfo deserializedAzureReachabilityReportLatencyInfo + = new AzureReachabilityReportLatencyInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeStamp".equals(fieldName)) { + deserializedAzureReachabilityReportLatencyInfo.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("score".equals(fieldName)) { + deserializedAzureReachabilityReportLatencyInfo.score = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureReachabilityReportLatencyInfo; + }); + } +} 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..ea0e4f8d0985a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportLocation.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define a geographic location. + */ +@Fluent +public final class AzureReachabilityReportLocation implements JsonSerializable { + /* + * The name of the country. + */ + private String country; + + /* + * The name of the state. + */ + private String state; + + /* + * The name of the city or town. + */ + private String city; + + /** + * Creates an instance of AzureReachabilityReportLocation class. + */ + public AzureReachabilityReportLocation() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property country in model AzureReachabilityReportLocation")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureReachabilityReportLocation.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("country", this.country); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("city", this.city); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureReachabilityReportLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureReachabilityReportLocation if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureReachabilityReportLocation. + */ + public static AzureReachabilityReportLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureReachabilityReportLocation deserializedAzureReachabilityReportLocation + = new AzureReachabilityReportLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("country".equals(fieldName)) { + deserializedAzureReachabilityReportLocation.country = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedAzureReachabilityReportLocation.state = reader.getString(); + } else if ("city".equals(fieldName)) { + deserializedAzureReachabilityReportLocation.city = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureReachabilityReportLocation; + }); + } +} 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..ed96f936b132d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureReachabilityReportParameters.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.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Geographic and time constraints for Azure reachability report. + */ +@Fluent +public final class AzureReachabilityReportParameters implements JsonSerializable { + /* + * Parameters that define a geographic location. + */ + private AzureReachabilityReportLocation providerLocation; + + /* + * List of Internet service providers. + */ + private List providers; + + /* + * Optional Azure regions to scope the query to. + */ + private List azureLocations; + + /* + * The start time for the Azure reachability report. + */ + private OffsetDateTime startTime; + + /* + * The end time for the Azure reachability report. + */ + private OffsetDateTime endTime; + + /** + * Creates an instance of AzureReachabilityReportParameters class. + */ + public AzureReachabilityReportParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property providerLocation in model AzureReachabilityReportParameters")); + } else { + providerLocation().validate(); + } + if (startTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property startTime in model AzureReachabilityReportParameters")); + } + if (endTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endTime in model AzureReachabilityReportParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureReachabilityReportParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("providerLocation", this.providerLocation); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("providers", this.providers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("azureLocations", this.azureLocations, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureReachabilityReportParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureReachabilityReportParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureReachabilityReportParameters. + */ + public static AzureReachabilityReportParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureReachabilityReportParameters deserializedAzureReachabilityReportParameters + = new AzureReachabilityReportParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerLocation".equals(fieldName)) { + deserializedAzureReachabilityReportParameters.providerLocation + = AzureReachabilityReportLocation.fromJson(reader); + } else if ("startTime".equals(fieldName)) { + deserializedAzureReachabilityReportParameters.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedAzureReachabilityReportParameters.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("providers".equals(fieldName)) { + List providers = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureReachabilityReportParameters.providers = providers; + } else if ("azureLocations".equals(fieldName)) { + List azureLocations = reader.readArray(reader1 -> reader1.getString()); + deserializedAzureReachabilityReportParameters.azureLocations = azureLocations; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureReachabilityReportParameters; + }); + } +} 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..3101876685d37 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategory.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.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..9e87956335bc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/AzureWebCategoryListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AzureWebCategoryInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListAzureWebCategories API service call. + */ +@Fluent +public final class AzureWebCategoryListResult implements JsonSerializable { + /* + * List of Azure Web Categories for a given Subscription. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of AzureWebCategoryListResult class. + */ + public AzureWebCategoryListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureWebCategoryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureWebCategoryListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureWebCategoryListResult. + */ + public static AzureWebCategoryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureWebCategoryListResult deserializedAzureWebCategoryListResult = new AzureWebCategoryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AzureWebCategoryInner.fromJson(reader1)); + deserializedAzureWebCategoryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAzureWebCategoryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureWebCategoryListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressInboundNatRulePortMappings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressInboundNatRulePortMappings.java new file mode 100644 index 0000000000000..08a48f6aa20f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressInboundNatRulePortMappings.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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.BackendAddressInboundNatRulePortMappingsInner; +import java.util.List; + +/** + * An immutable client-side representation of BackendAddressInboundNatRulePortMappings. + */ +public interface BackendAddressInboundNatRulePortMappings { + /** + * Gets the inboundNatRulePortMappings property: Collection of inbound NAT rule port mappings. + * + * @return the inboundNatRulePortMappings value. + */ + List inboundNatRulePortMappings(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.BackendAddressInboundNatRulePortMappingsInner object. + * + * @return the inner object. + */ + BackendAddressInboundNatRulePortMappingsInner innerModel(); +} 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..1d781fc9cafdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BackendAddressPool.java @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 inboundNatRules property: An array of references to inbound NAT rules that use this backend address + * pool. + * + * @return the inboundNatRules value. + */ + List inboundNatRules(); + + /** + * Gets the provisioningState property: The provisioning state of the backend address pool resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the drainPeriodInSeconds property: Amount of seconds Load Balancer waits for before sending RESET to client + * and backend address. + * + * @return the drainPeriodInSeconds value. + */ + Integer drainPeriodInSeconds(); + + /** + * Gets the virtualNetwork property: A reference to a virtual network. + * + * @return the virtualNetwork value. + */ + SubResource virtualNetwork(); + + /** + * Gets the syncMode property: Backend address synchronous mode for the backend pool. + * + * @return the syncMode value. + */ + SyncMode syncMode(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, DefinitionStages.WithDrainPeriodInSeconds, + DefinitionStages.WithVirtualNetwork, DefinitionStages.WithSyncMode { + /** + * 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); + } + + /** + * The stage of the BackendAddressPool definition allowing to specify drainPeriodInSeconds. + */ + interface WithDrainPeriodInSeconds { + /** + * Specifies the drainPeriodInSeconds property: Amount of seconds Load Balancer waits for before sending + * RESET to client and backend address.. + * + * @param drainPeriodInSeconds Amount of seconds Load Balancer waits for before sending RESET to client and + * backend address. + * @return the next definition stage. + */ + WithCreate withDrainPeriodInSeconds(Integer drainPeriodInSeconds); + } + + /** + * The stage of the BackendAddressPool definition allowing to specify virtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies the virtualNetwork property: A reference to a virtual network.. + * + * @param virtualNetwork A reference to a virtual network. + * @return the next definition stage. + */ + WithCreate withVirtualNetwork(SubResource virtualNetwork); + } + + /** + * The stage of the BackendAddressPool definition allowing to specify syncMode. + */ + interface WithSyncMode { + /** + * Specifies the syncMode property: Backend address synchronous mode for the backend pool. + * + * @param syncMode Backend address synchronous mode for the backend pool. + * @return the next definition stage. + */ + WithCreate withSyncMode(SyncMode syncMode); + } + } + + /** + * 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, + UpdateStages.WithDrainPeriodInSeconds, UpdateStages.WithVirtualNetwork, UpdateStages.WithSyncMode { + /** + * 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); + } + + /** + * The stage of the BackendAddressPool update allowing to specify drainPeriodInSeconds. + */ + interface WithDrainPeriodInSeconds { + /** + * Specifies the drainPeriodInSeconds property: Amount of seconds Load Balancer waits for before sending + * RESET to client and backend address.. + * + * @param drainPeriodInSeconds Amount of seconds Load Balancer waits for before sending RESET to client and + * backend address. + * @return the next definition stage. + */ + Update withDrainPeriodInSeconds(Integer drainPeriodInSeconds); + } + + /** + * The stage of the BackendAddressPool update allowing to specify virtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies the virtualNetwork property: A reference to a virtual network.. + * + * @param virtualNetwork A reference to a virtual network. + * @return the next definition stage. + */ + Update withVirtualNetwork(SubResource virtualNetwork); + } + + /** + * The stage of the BackendAddressPool update allowing to specify syncMode. + */ + interface WithSyncMode { + /** + * Specifies the syncMode property: Backend address synchronous mode for the backend pool. + * + * @param syncMode Backend address synchronous mode for the backend pool. + * @return the next definition stage. + */ + Update withSyncMode(SyncMode syncMode); + } + } + + /** + * 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/BaseAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BaseAdminRule.java new file mode 100644 index 0000000000000..ffacdcf8751f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BaseAdminRule.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.core.management.SystemData; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; + +/** + * An immutable client-side representation of BaseAdminRule. + */ +public interface BaseAdminRule { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + AdminRuleKind kind(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner object. + * + * @return the inner object. + */ + BaseAdminRuleInner innerModel(); +} 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..3f64a97c48fae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSession.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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..8f7e87b848a34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionActiveSessionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BastionActiveSessionInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for GetActiveSessions. + */ +@Fluent +public final class BastionActiveSessionListResult implements JsonSerializable { + /* + * List of active sessions on the bastion. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of BastionActiveSessionListResult class. + */ + public BastionActiveSessionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionActiveSessionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionActiveSessionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionActiveSessionListResult. + */ + public static BastionActiveSessionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionActiveSessionListResult deserializedBastionActiveSessionListResult + = new BastionActiveSessionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BastionActiveSessionInner.fromJson(reader1)); + deserializedBastionActiveSessionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBastionActiveSessionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionActiveSessionListResult; + }); + } +} 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..c097143b3b661 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionConnectProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol used to connect to the target. + */ +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 a new instance of BastionConnectProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BastionConnectProtocol() { + } + + /** + * Creates or finds a BastionConnectProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding BastionConnectProtocol. + */ + public static BastionConnectProtocol fromString(String name) { + return fromString(name, BastionConnectProtocol.class); + } + + /** + * Gets known BastionConnectProtocol values. + * + * @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..62002f13eacec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHost.java @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 sku property: The sku of this Bastion Host. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 virtualNetwork property: Reference to an existing virtual network required for Developer Bastion Host + * only. + * + * @return the virtualNetwork value. + */ + SubResource virtualNetwork(); + + /** + * Gets the networkAcls property: The networkAcls property. + * + * @return the networkAcls value. + */ + BastionHostPropertiesFormatNetworkAcls networkAcls(); + + /** + * Gets the provisioningState property: The provisioning state of the bastion host resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the scaleUnits property: The scale units for the Bastion Host resource. + * + * @return the scaleUnits value. + */ + Integer scaleUnits(); + + /** + * Gets the disableCopyPaste property: Enable/Disable Copy/Paste feature of the Bastion Host resource. + * + * @return the disableCopyPaste value. + */ + Boolean disableCopyPaste(); + + /** + * Gets the enableFileCopy property: Enable/Disable File Copy feature of the Bastion Host resource. + * + * @return the enableFileCopy value. + */ + Boolean enableFileCopy(); + + /** + * Gets the enableIpConnect property: Enable/Disable IP Connect feature of the Bastion Host resource. + * + * @return the enableIpConnect value. + */ + Boolean enableIpConnect(); + + /** + * Gets the enableShareableLink property: Enable/Disable Shareable Link of the Bastion Host resource. + * + * @return the enableShareableLink value. + */ + Boolean enableShareableLink(); + + /** + * Gets the enableTunneling property: Enable/Disable Tunneling feature of the Bastion Host resource. + * + * @return the enableTunneling value. + */ + Boolean enableTunneling(); + + /** + * Gets the enableKerberos property: Enable/Disable Kerberos feature of the Bastion Host resource. + * + * @return the enableKerberos value. + */ + Boolean enableKerberos(); + + /** + * Gets the enableSessionRecording property: Enable/Disable Session Recording feature of the Bastion Host resource. + * + * @return the enableSessionRecording value. + */ + Boolean enableSessionRecording(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithZones, DefinitionStages.WithSku, + DefinitionStages.WithIpConfigurations, DefinitionStages.WithDnsName, DefinitionStages.WithVirtualNetwork, + DefinitionStages.WithNetworkAcls, DefinitionStages.WithScaleUnits, DefinitionStages.WithDisableCopyPaste, + DefinitionStages.WithEnableFileCopy, DefinitionStages.WithEnableIpConnect, + DefinitionStages.WithEnableShareableLink, DefinitionStages.WithEnableTunneling, + DefinitionStages.WithEnableKerberos, DefinitionStages.WithEnableSessionRecording { + /** + * 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 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 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); + } + + /** + * The stage of the BastionHost definition allowing to specify virtualNetwork. + */ + interface WithVirtualNetwork { + /** + * Specifies the virtualNetwork property: Reference to an existing virtual network required for Developer + * Bastion Host only.. + * + * @param virtualNetwork Reference to an existing virtual network required for Developer Bastion Host only. + * @return the next definition stage. + */ + WithCreate withVirtualNetwork(SubResource virtualNetwork); + } + + /** + * The stage of the BastionHost definition allowing to specify networkAcls. + */ + interface WithNetworkAcls { + /** + * Specifies the networkAcls property: The networkAcls property.. + * + * @param networkAcls The networkAcls property. + * @return the next definition stage. + */ + WithCreate withNetworkAcls(BastionHostPropertiesFormatNetworkAcls networkAcls); + } + + /** + * The stage of the BastionHost definition allowing to specify scaleUnits. + */ + interface WithScaleUnits { + /** + * Specifies the scaleUnits property: The scale units for the Bastion Host resource.. + * + * @param scaleUnits The scale units for the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withScaleUnits(Integer scaleUnits); + } + + /** + * The stage of the BastionHost definition allowing to specify disableCopyPaste. + */ + interface WithDisableCopyPaste { + /** + * Specifies the disableCopyPaste property: Enable/Disable Copy/Paste feature of the Bastion Host resource.. + * + * @param disableCopyPaste Enable/Disable Copy/Paste feature of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withDisableCopyPaste(Boolean disableCopyPaste); + } + + /** + * The stage of the BastionHost definition allowing to specify enableFileCopy. + */ + interface WithEnableFileCopy { + /** + * Specifies the enableFileCopy property: Enable/Disable File Copy feature of the Bastion Host resource.. + * + * @param enableFileCopy Enable/Disable File Copy feature of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withEnableFileCopy(Boolean enableFileCopy); + } + + /** + * The stage of the BastionHost definition allowing to specify enableIpConnect. + */ + interface WithEnableIpConnect { + /** + * Specifies the enableIpConnect property: Enable/Disable IP Connect feature of the Bastion Host resource.. + * + * @param enableIpConnect Enable/Disable IP Connect feature of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withEnableIpConnect(Boolean enableIpConnect); + } + + /** + * The stage of the BastionHost definition allowing to specify enableShareableLink. + */ + interface WithEnableShareableLink { + /** + * Specifies the enableShareableLink property: Enable/Disable Shareable Link of the Bastion Host resource.. + * + * @param enableShareableLink Enable/Disable Shareable Link of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withEnableShareableLink(Boolean enableShareableLink); + } + + /** + * The stage of the BastionHost definition allowing to specify enableTunneling. + */ + interface WithEnableTunneling { + /** + * Specifies the enableTunneling property: Enable/Disable Tunneling feature of the Bastion Host resource.. + * + * @param enableTunneling Enable/Disable Tunneling feature of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withEnableTunneling(Boolean enableTunneling); + } + + /** + * The stage of the BastionHost definition allowing to specify enableKerberos. + */ + interface WithEnableKerberos { + /** + * Specifies the enableKerberos property: Enable/Disable Kerberos feature of the Bastion Host resource.. + * + * @param enableKerberos Enable/Disable Kerberos feature of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withEnableKerberos(Boolean enableKerberos); + } + + /** + * The stage of the BastionHost definition allowing to specify enableSessionRecording. + */ + interface WithEnableSessionRecording { + /** + * Specifies the enableSessionRecording property: Enable/Disable Session Recording feature of the Bastion + * Host resource.. + * + * @param enableSessionRecording Enable/Disable Session Recording feature of the Bastion Host resource. + * @return the next definition stage. + */ + WithCreate withEnableSessionRecording(Boolean enableSessionRecording); + } + } + + /** + * 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 { + /** + * 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); + } + } + + /** + * 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..a4a8518c0c257 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostIpConfiguration.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostIpConfigurationPropertiesFormat; +import java.io.IOException; + +/** + * IP configuration of an Bastion Host. + */ +@Fluent +public final class BastionHostIpConfiguration extends SubResource { + /* + * Represents the ip configuration associated with the resource. + */ + private BastionHostIpConfigurationPropertiesFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Ip configuration type. + */ + private String type; + + /** + * Creates an instance of BastionHostIpConfiguration class. + */ + public BastionHostIpConfiguration() { + } + + /** + * Get the innerProperties property: Represents the ip configuration associated with the resource. + * + * @return the innerProperties value. + */ + private BastionHostIpConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public BastionHostIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the subnet property: Reference of the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostIpConfigurationPropertiesFormat(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the publicIpAddress property: Reference of the PublicIP resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPublicIpAddress(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateIpAllocationMethod property: Private IP allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new BastionHostIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionHostIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionHostIpConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionHostIpConfiguration. + */ + public static BastionHostIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionHostIpConfiguration deserializedBastionHostIpConfiguration = new BastionHostIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBastionHostIpConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedBastionHostIpConfiguration.innerProperties + = BastionHostIpConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedBastionHostIpConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedBastionHostIpConfiguration.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBastionHostIpConfiguration.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionHostIpConfiguration; + }); + } +} 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..ebd98de360e80 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BastionHostInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListBastionHosts API service call. + */ +@Fluent +public final class BastionHostListResult implements JsonSerializable { + /* + * List of Bastion Hosts in a resource group. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of BastionHostListResult class. + */ + public BastionHostListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionHostListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionHostListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionHostListResult. + */ + public static BastionHostListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionHostListResult deserializedBastionHostListResult = new BastionHostListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BastionHostInner.fromJson(reader1)); + deserializedBastionHostListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBastionHostListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionHostListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostPropertiesFormatNetworkAcls.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostPropertiesFormatNetworkAcls.java new file mode 100644 index 0000000000000..6e5da7977f069 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostPropertiesFormatNetworkAcls.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The BastionHostPropertiesFormatNetworkAcls model. + */ +@Fluent +public final class BastionHostPropertiesFormatNetworkAcls + implements JsonSerializable { + /* + * Sets the IP ACL rules for Developer Bastion Host. + */ + private List ipRules; + + /** + * Creates an instance of BastionHostPropertiesFormatNetworkAcls class. + */ + public BastionHostPropertiesFormatNetworkAcls() { + } + + /** + * Get the ipRules property: Sets the IP ACL rules for Developer Bastion Host. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: Sets the IP ACL rules for Developer Bastion Host. + * + * @param ipRules the ipRules value to set. + * @return the BastionHostPropertiesFormatNetworkAcls object itself. + */ + public BastionHostPropertiesFormatNetworkAcls withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionHostPropertiesFormatNetworkAcls from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionHostPropertiesFormatNetworkAcls if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionHostPropertiesFormatNetworkAcls. + */ + public static BastionHostPropertiesFormatNetworkAcls fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionHostPropertiesFormatNetworkAcls deserializedBastionHostPropertiesFormatNetworkAcls + = new BastionHostPropertiesFormatNetworkAcls(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> IpRule.fromJson(reader1)); + deserializedBastionHostPropertiesFormatNetworkAcls.ipRules = ipRules; + } else { + reader.skipChildren(); + } + } + + return deserializedBastionHostPropertiesFormatNetworkAcls; + }); + } +} 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..499521ae3413b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHostSkuName.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 java.util.Collection; + +/** + * The name of the sku of this Bastion Host. + */ +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"); + + /** + * Static value Developer for BastionHostSkuName. + */ + public static final BastionHostSkuName DEVELOPER = fromString("Developer"); + + /** + * Static value Premium for BastionHostSkuName. + */ + public static final BastionHostSkuName PREMIUM = fromString("Premium"); + + /** + * Creates a new instance of BastionHostSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BastionHostSkuName() { + } + + /** + * Creates or finds a BastionHostSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding BastionHostSkuName. + */ + public static BastionHostSkuName fromString(String name) { + return fromString(name, BastionHostSkuName.class); + } + + /** + * Gets known BastionHostSkuName values. + * + * @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..35bb7f4deebf2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionHosts.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..41304c92b10e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionDeleteResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BastionSessionStateInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for DisconnectActiveSessions. + */ +@Fluent +public final class BastionSessionDeleteResult implements JsonSerializable { + /* + * List of sessions with their corresponding state. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of BastionSessionDeleteResult class. + */ + public BastionSessionDeleteResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionSessionDeleteResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionSessionDeleteResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionSessionDeleteResult. + */ + public static BastionSessionDeleteResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionSessionDeleteResult deserializedBastionSessionDeleteResult = new BastionSessionDeleteResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BastionSessionStateInner.fromJson(reader1)); + deserializedBastionSessionDeleteResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBastionSessionDeleteResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionSessionDeleteResult; + }); + } +} 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..801a45c5606c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionSessionState.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.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..ac78c55f4bd49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLink.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.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..311a50bf1e8c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListRequest.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import java.io.IOException; +import java.util.List; + +/** + * Post request for Create/Delete/Get Bastion Shareable Link endpoints. + */ +@Fluent +public final class BastionShareableLinkListRequest implements JsonSerializable { + /* + * List of VM references. + */ + private List vms; + + /** + * Creates an instance of BastionShareableLinkListRequest class. + */ + public BastionShareableLinkListRequest() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vms", this.vms, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionShareableLinkListRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionShareableLinkListRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionShareableLinkListRequest. + */ + public static BastionShareableLinkListRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionShareableLinkListRequest deserializedBastionShareableLinkListRequest + = new BastionShareableLinkListRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vms".equals(fieldName)) { + List vms + = reader.readArray(reader1 -> BastionShareableLinkInner.fromJson(reader1)); + deserializedBastionShareableLinkListRequest.vms = vms; + } else { + reader.skipChildren(); + } + } + + return deserializedBastionShareableLinkListRequest; + }); + } +} 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..2fee86a0d394e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for all the Bastion Shareable Link endpoints. + */ +@Fluent +public final class BastionShareableLinkListResult implements JsonSerializable { + /* + * List of Bastion Shareable Links for the request. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of BastionShareableLinkListResult class. + */ + public BastionShareableLinkListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionShareableLinkListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionShareableLinkListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionShareableLinkListResult. + */ + public static BastionShareableLinkListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionShareableLinkListResult deserializedBastionShareableLinkListResult + = new BastionShareableLinkListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BastionShareableLinkInner.fromJson(reader1)); + deserializedBastionShareableLinkListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBastionShareableLinkListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBastionShareableLinkListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkTokenListRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkTokenListRequest.java new file mode 100644 index 0000000000000..6b57a52821ff1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BastionShareableLinkTokenListRequest.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Post request for Delete Bastion Shareable Link By Token endpoint. + */ +@Fluent +public final class BastionShareableLinkTokenListRequest + implements JsonSerializable { + /* + * List of Bastion Shareable Link Token. + */ + private List tokens; + + /** + * Creates an instance of BastionShareableLinkTokenListRequest class. + */ + public BastionShareableLinkTokenListRequest() { + } + + /** + * Get the tokens property: List of Bastion Shareable Link Token. + * + * @return the tokens value. + */ + public List tokens() { + return this.tokens; + } + + /** + * Set the tokens property: List of Bastion Shareable Link Token. + * + * @param tokens the tokens value to set. + * @return the BastionShareableLinkTokenListRequest object itself. + */ + public BastionShareableLinkTokenListRequest withTokens(List tokens) { + this.tokens = tokens; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tokens", this.tokens, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BastionShareableLinkTokenListRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BastionShareableLinkTokenListRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BastionShareableLinkTokenListRequest. + */ + public static BastionShareableLinkTokenListRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BastionShareableLinkTokenListRequest deserializedBastionShareableLinkTokenListRequest + = new BastionShareableLinkTokenListRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tokens".equals(fieldName)) { + List tokens = reader.readArray(reader1 -> reader1.getString()); + deserializedBastionShareableLinkTokenListRequest.tokens = tokens; + } else { + reader.skipChildren(); + } + } + + return deserializedBastionShareableLinkTokenListRequest; + }); + } +} 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..fc9b9190a875b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpCommunity.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Contains bgp community information offered in Service Community resources. + */ +@Fluent +public final class BgpCommunity implements JsonSerializable { + /* + * The region which the service support. e.g. For O365, region is Global. + */ + private String serviceSupportedRegion; + + /* + * The name of the bgp community. e.g. Skype. + */ + private String communityName; + + /* + * The value of the bgp community. For more information: + * https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. + */ + private String communityValue; + + /* + * The prefixes that the bgp community contains. + */ + private List communityPrefixes; + + /* + * Customer is authorized to use bgp community or not. + */ + private Boolean isAuthorizedToUse; + + /* + * The service group of the bgp community contains. + */ + private String serviceGroup; + + /** + * Creates an instance of BgpCommunity class. + */ + public BgpCommunity() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceSupportedRegion", this.serviceSupportedRegion); + jsonWriter.writeStringField("communityName", this.communityName); + jsonWriter.writeStringField("communityValue", this.communityValue); + jsonWriter.writeArrayField("communityPrefixes", this.communityPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isAuthorizedToUse", this.isAuthorizedToUse); + jsonWriter.writeStringField("serviceGroup", this.serviceGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpCommunity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpCommunity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpCommunity. + */ + public static BgpCommunity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpCommunity deserializedBgpCommunity = new BgpCommunity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSupportedRegion".equals(fieldName)) { + deserializedBgpCommunity.serviceSupportedRegion = reader.getString(); + } else if ("communityName".equals(fieldName)) { + deserializedBgpCommunity.communityName = reader.getString(); + } else if ("communityValue".equals(fieldName)) { + deserializedBgpCommunity.communityValue = reader.getString(); + } else if ("communityPrefixes".equals(fieldName)) { + List communityPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedBgpCommunity.communityPrefixes = communityPrefixes; + } else if ("isAuthorizedToUse".equals(fieldName)) { + deserializedBgpCommunity.isAuthorizedToUse = reader.getNullable(JsonReader::getBoolean); + } else if ("serviceGroup".equals(fieldName)) { + deserializedBgpCommunity.serviceGroup = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBgpCommunity; + }); + } +} 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..ecef47cfe13e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpConnection.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 hubVirtualNetworkConnection property: The reference to the HubVirtualNetworkConnection resource. + * + * @return the hubVirtualNetworkConnection value. + */ + SubResource hubVirtualNetworkConnection(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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, DefinitionStages.WithHubVirtualNetworkConnection { + /** + * 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); + } + + /** + * The stage of the BgpConnection definition allowing to specify hubVirtualNetworkConnection. + */ + interface WithHubVirtualNetworkConnection { + /** + * Specifies the hubVirtualNetworkConnection property: The reference to the HubVirtualNetworkConnection + * resource.. + * + * @param hubVirtualNetworkConnection The reference to the HubVirtualNetworkConnection resource. + * @return the next definition stage. + */ + WithCreate withHubVirtualNetworkConnection(SubResource hubVirtualNetworkConnection); + } + } + + /** + * 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, + UpdateStages.WithHubVirtualNetworkConnection { + /** + * 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); + } + + /** + * The stage of the BgpConnection update allowing to specify hubVirtualNetworkConnection. + */ + interface WithHubVirtualNetworkConnection { + /** + * Specifies the hubVirtualNetworkConnection property: The reference to the HubVirtualNetworkConnection + * resource.. + * + * @param hubVirtualNetworkConnection The reference to the HubVirtualNetworkConnection resource. + * @return the next definition stage. + */ + Update withHubVirtualNetworkConnection(SubResource hubVirtualNetworkConnection); + } + } + + /** + * 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..1bd4d9df54b52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The BGP peer state. + */ +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 a new instance of BgpPeerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BgpPeerState() { + } + + /** + * Creates or finds a BgpPeerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BgpPeerState. + */ + public static BgpPeerState fromString(String name) { + return fromString(name, BgpPeerState.class); + } + + /** + * Gets known BgpPeerState values. + * + * @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..cfc6968c94bcf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatus.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BGP peer status details. + */ +@Immutable +public final class BgpPeerStatus implements JsonSerializable { + /* + * The virtual network gateway's local address. + */ + private String localAddress; + + /* + * The remote BGP peer. + */ + private String neighbor; + + /* + * The autonomous system number of the remote BGP peer. + */ + private Long asn; + + /* + * The BGP peer state. + */ + private BgpPeerState state; + + /* + * For how long the peering has been up. + */ + private String connectedDuration; + + /* + * The number of routes learned from this peer. + */ + private Long routesReceived; + + /* + * The number of BGP messages sent. + */ + private Long messagesSent; + + /* + * The number of BGP messages received. + */ + private Long messagesReceived; + + /** + * Creates an instance of BgpPeerStatus class. + */ + public BgpPeerStatus() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpPeerStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpPeerStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpPeerStatus. + */ + public static BgpPeerStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpPeerStatus deserializedBgpPeerStatus = new BgpPeerStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("localAddress".equals(fieldName)) { + deserializedBgpPeerStatus.localAddress = reader.getString(); + } else if ("neighbor".equals(fieldName)) { + deserializedBgpPeerStatus.neighbor = reader.getString(); + } else if ("asn".equals(fieldName)) { + deserializedBgpPeerStatus.asn = reader.getNullable(JsonReader::getLong); + } else if ("state".equals(fieldName)) { + deserializedBgpPeerStatus.state = BgpPeerState.fromString(reader.getString()); + } else if ("connectedDuration".equals(fieldName)) { + deserializedBgpPeerStatus.connectedDuration = reader.getString(); + } else if ("routesReceived".equals(fieldName)) { + deserializedBgpPeerStatus.routesReceived = reader.getNullable(JsonReader::getLong); + } else if ("messagesSent".equals(fieldName)) { + deserializedBgpPeerStatus.messagesSent = reader.getNullable(JsonReader::getLong); + } else if ("messagesReceived".equals(fieldName)) { + deserializedBgpPeerStatus.messagesReceived = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedBgpPeerStatus; + }); + } +} 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..a2a17790e8079 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpPeerStatusListResult.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.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..e288683d7d5ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunities.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..309b587ea90fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunity.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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..29fc1e3fb99b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpServiceCommunityListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BgpServiceCommunityInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListServiceCommunity API service call. + */ +@Fluent +public final class BgpServiceCommunityListResult implements JsonSerializable { + /* + * A list of service community resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of BgpServiceCommunityListResult class. + */ + public BgpServiceCommunityListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpServiceCommunityListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpServiceCommunityListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpServiceCommunityListResult. + */ + public static BgpServiceCommunityListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpServiceCommunityListResult deserializedBgpServiceCommunityListResult + = new BgpServiceCommunityListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BgpServiceCommunityInner.fromJson(reader1)); + deserializedBgpServiceCommunityListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBgpServiceCommunityListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBgpServiceCommunityListResult; + }); + } +} 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..9651cc4b1e70b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BgpSettings.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * BGP settings details. + */ +@Fluent +public final class BgpSettings implements JsonSerializable { + /* + * The BGP speaker's ASN. + */ + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + private String bgpPeeringAddress; + + /* + * The weight added to routes learned from this BGP speaker. + */ + private Integer peerWeight; + + /* + * BGP peering address with IP configuration ID for virtual network gateway. + */ + private List bgpPeeringAddresses; + + /** + * Creates an instance of BgpSettings class. + */ + public BgpSettings() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("asn", this.asn); + jsonWriter.writeStringField("bgpPeeringAddress", this.bgpPeeringAddress); + jsonWriter.writeNumberField("peerWeight", this.peerWeight); + jsonWriter.writeArrayField("bgpPeeringAddresses", this.bgpPeeringAddresses, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BgpSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BgpSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BgpSettings. + */ + public static BgpSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BgpSettings deserializedBgpSettings = new BgpSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("asn".equals(fieldName)) { + deserializedBgpSettings.asn = reader.getNullable(JsonReader::getLong); + } else if ("bgpPeeringAddress".equals(fieldName)) { + deserializedBgpSettings.bgpPeeringAddress = reader.getString(); + } else if ("peerWeight".equals(fieldName)) { + deserializedBgpSettings.peerWeight = reader.getNullable(JsonReader::getInt); + } else if ("bgpPeeringAddresses".equals(fieldName)) { + List bgpPeeringAddresses + = reader.readArray(reader1 -> IpConfigurationBgpPeeringAddress.fromJson(reader1)); + deserializedBgpSettings.bgpPeeringAddresses = bgpPeeringAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedBgpSettings; + }); + } +} 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..1b9e6744ec2b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/BreakOutCategoryPolicies.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network Virtual Appliance Sku Properties. + */ +@Fluent +public final class BreakOutCategoryPolicies implements JsonSerializable { + /* + * Flag to control breakout of o365 allow category. + */ + private Boolean allow; + + /* + * Flag to control breakout of o365 optimize category. + */ + private Boolean optimize; + + /* + * Flag to control breakout of o365 default category. + */ + private Boolean defaultProperty; + + /** + * Creates an instance of BreakOutCategoryPolicies class. + */ + public BreakOutCategoryPolicies() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allow", this.allow); + jsonWriter.writeBooleanField("optimize", this.optimize); + jsonWriter.writeBooleanField("default", this.defaultProperty); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BreakOutCategoryPolicies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BreakOutCategoryPolicies if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the BreakOutCategoryPolicies. + */ + public static BreakOutCategoryPolicies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BreakOutCategoryPolicies deserializedBreakOutCategoryPolicies = new BreakOutCategoryPolicies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allow".equals(fieldName)) { + deserializedBreakOutCategoryPolicies.allow = reader.getNullable(JsonReader::getBoolean); + } else if ("optimize".equals(fieldName)) { + deserializedBreakOutCategoryPolicies.optimize = reader.getNullable(JsonReader::getBoolean); + } else if ("default".equals(fieldName)) { + deserializedBreakOutCategoryPolicies.defaultProperty = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedBreakOutCategoryPolicies; + }); + } +} 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..a46785855c5cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CheckPrivateLinkServiceVisibilityRequest.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body of the CheckPrivateLinkServiceVisibility API service call. + */ +@Fluent +public final class CheckPrivateLinkServiceVisibilityRequest + implements JsonSerializable { + /* + * The alias of the private link service. + */ + private String privateLinkServiceAlias; + + /** + * Creates an instance of CheckPrivateLinkServiceVisibilityRequest class. + */ + public CheckPrivateLinkServiceVisibilityRequest() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateLinkServiceAlias", this.privateLinkServiceAlias); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckPrivateLinkServiceVisibilityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckPrivateLinkServiceVisibilityRequest if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckPrivateLinkServiceVisibilityRequest. + */ + public static CheckPrivateLinkServiceVisibilityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckPrivateLinkServiceVisibilityRequest deserializedCheckPrivateLinkServiceVisibilityRequest + = new CheckPrivateLinkServiceVisibilityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceAlias".equals(fieldName)) { + deserializedCheckPrivateLinkServiceVisibilityRequest.privateLinkServiceAlias = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckPrivateLinkServiceVisibilityRequest; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ChildResource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ChildResource.java new file mode 100644 index 0000000000000..fd999baaf2f74 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ChildResource.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.management.ProxyResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Proxy resource representation. + */ +@Immutable +public class ChildResource extends ProxyResource { + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ChildResource class. + */ + public ChildResource() { + } + + /** + * 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; + } + + /** + * Set the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @param etag the etag value to set. + * @return the ChildResource object itself. + */ + ChildResource withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChildResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChildResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChildResource. + */ + public static ChildResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChildResource deserializedChildResource = new ChildResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedChildResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedChildResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedChildResource.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedChildResource.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChildResource; + }); + } +} 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..d2650a6058c8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CircuitConnectionStatus.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Express Route Circuit connection state. + */ +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 a new instance of CircuitConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CircuitConnectionStatus() { + } + + /** + * Creates or finds a CircuitConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CircuitConnectionStatus. + */ + public static CircuitConnectionStatus fromString(String name) { + return fromString(name, CircuitConnectionStatus.class); + } + + /** + * Gets known CircuitConnectionStatus values. + * + * @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..4f6b580eef021 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CommissionedState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The commissioned state of the Custom IP Prefix. + */ +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 CommissionedNoInternetAdvertise for CommissionedState. + */ + public static final CommissionedState COMMISSIONED_NO_INTERNET_ADVERTISE + = fromString("CommissionedNoInternetAdvertise"); + + /** + * 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"); + + /** + * Static value Deprovisioned for CommissionedState. + */ + public static final CommissionedState DEPROVISIONED = fromString("Deprovisioned"); + + /** + * Creates a new instance of CommissionedState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommissionedState() { + } + + /** + * Creates or finds a CommissionedState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommissionedState. + */ + public static CommissionedState fromString(String name) { + return fromString(name, CommissionedState.class); + } + + /** + * Gets known CommissionedState values. + * + * @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/ConfigurationGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationGroup.java new file mode 100644 index 0000000000000..659564803fb23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationGroup.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupProperties; +import java.io.IOException; + +/** + * The network configuration group resource. + */ +@Fluent +public final class ConfigurationGroup implements JsonSerializable { + /* + * Network group ID. + */ + private String id; + + /* + * The network configuration group properties + */ + private NetworkGroupProperties innerProperties; + + /** + * Creates an instance of ConfigurationGroup class. + */ + public ConfigurationGroup() { + } + + /** + * Get the id property: Network group ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Network group ID. + * + * @param id the id value to set. + * @return the ConfigurationGroup object itself. + */ + public ConfigurationGroup withId(String id) { + this.id = id; + return this; + } + + /** + * Get the innerProperties property: The network configuration group properties. + * + * @return the innerProperties value. + */ + private NetworkGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the description property: A description of the network group. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the network group. + * + * @param description the description value to set. + * @return the ConfigurationGroup object itself. + */ + public ConfigurationGroup withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkGroupProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the memberType property: The type of the group member. + * + * @return the memberType value. + */ + public GroupMemberType memberType() { + return this.innerProperties() == null ? null : this.innerProperties().memberType(); + } + + /** + * Set the memberType property: The type of the group member. + * + * @param memberType the memberType value to set. + * @return the ConfigurationGroup object itself. + */ + public ConfigurationGroup withMemberType(GroupMemberType memberType) { + if (this.innerProperties() == null) { + this.innerProperties = new NetworkGroupProperties(); + } + this.innerProperties().withMemberType(memberType); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the scope assignment resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConfigurationGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConfigurationGroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConfigurationGroup. + */ + public static ConfigurationGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConfigurationGroup deserializedConfigurationGroup = new ConfigurationGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConfigurationGroup.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedConfigurationGroup.innerProperties = NetworkGroupProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConfigurationGroup; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationPolicyGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationPolicyGroups.java new file mode 100644 index 0000000000000..e5ee0b327603d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationPolicyGroups.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ConfigurationPolicyGroups. + */ +public interface ConfigurationPolicyGroups { + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, String configurationPolicyGroupName); + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, String configurationPolicyGroupName, + Context context); + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, + String vpnServerConfigurationName, String configurationPolicyGroupName, Context context); + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @param configurationPolicyGroupName The name of the ConfigurationPolicyGroup 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 vpnServerConfigurationPolicyGroup Resource. + */ + VpnServerConfigurationPolicyGroup get(String resourceGroupName, String vpnServerConfigurationName, + String configurationPolicyGroupName); + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName); + + /** + * Lists all the configurationPolicyGroups in a resource group for a vpnServerConfiguration. + * + * @param resourceGroupName The resource group name of the VpnServerConfiguration. + * @param vpnServerConfigurationName The 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 VpnServerConfigurationPolicyGroups as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByVpnServerConfiguration(String resourceGroupName, + String vpnServerConfigurationName, Context context); + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @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 vpnServerConfigurationPolicyGroup Resource along with {@link Response}. + */ + VpnServerConfigurationPolicyGroup getById(String id); + + /** + * Retrieves the details of a ConfigurationPolicyGroup. + * + * @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 vpnServerConfigurationPolicyGroup Resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a ConfigurationPolicyGroup. + * + * @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 ConfigurationPolicyGroup. + * + * @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 VpnServerConfigurationPolicyGroup resource. + * + * @param name resource name. + * @return the first stage of the new VpnServerConfigurationPolicyGroup definition. + */ + VpnServerConfigurationPolicyGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationType.java new file mode 100644 index 0000000000000..0983c21ae1ed7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConfigurationType.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 java.util.Collection; + +/** + * Configuration Deployment Type. + */ +public final class ConfigurationType extends ExpandableStringEnum { + /** + * Static value SecurityAdmin for ConfigurationType. + */ + public static final ConfigurationType SECURITY_ADMIN = fromString("SecurityAdmin"); + + /** + * Static value Connectivity for ConfigurationType. + */ + public static final ConfigurationType CONNECTIVITY = fromString("Connectivity"); + + /** + * Static value SecurityUser for ConfigurationType. + */ + public static final ConfigurationType SECURITY_USER = fromString("SecurityUser"); + + /** + * Static value Routing for ConfigurationType. + */ + public static final ConfigurationType ROUTING = fromString("Routing"); + + /** + * Creates a new instance of ConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigurationType() { + } + + /** + * Creates or finds a ConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationType. + */ + public static ConfigurationType fromString(String name) { + return fromString(name, ConfigurationType.class); + } + + /** + * Gets known ConfigurationType values. + * + * @return known ConfigurationType values. + */ + public static Collection values() { + return values(ConfigurationType.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..d69a47a402c3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitor.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorParameters; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Parameters that define the operation to create a connection monitor. + */ +@Fluent +public final class ConnectionMonitor implements JsonSerializable { + /* + * Connection monitor location. + */ + private String location; + + /* + * Connection monitor tags. + */ + private Map tags; + + /* + * Properties of the connection monitor. + */ + private ConnectionMonitorParameters innerProperties = new ConnectionMonitorParameters(); + + /** + * Creates an instance of ConnectionMonitor class. + */ + public ConnectionMonitor() { + } + + /** + * 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 innerProperties property: Properties of the connection monitor. + * + * @return the innerProperties value. + */ + private ConnectionMonitorParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the source property: Describes the source of connection monitor. + * + * @return the source value. + */ + public ConnectionMonitorSource source() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the destination property: Describes the destination of connection monitor. + * + * @return the destination value. + */ + public ConnectionMonitorDestination destination() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withDestination(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withAutoStart(autoStart); + return this; + } + + /** + * Get the monitoringIntervalInSeconds property: Monitoring interval in seconds. + * + * @return the monitoringIntervalInSeconds value. + */ + public Integer monitoringIntervalInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withMonitoringIntervalInSeconds(monitoringIntervalInSeconds); + return this; + } + + /** + * Get the endpoints property: List of connection monitor endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withEndpoints(endpoints); + return this; + } + + /** + * Get the testConfigurations property: List of connection monitor test configurations. + * + * @return the testConfigurations value. + */ + public List testConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withTestConfigurations(testConfigurations); + return this; + } + + /** + * Get the testGroups property: List of connection monitor test groups. + * + * @return the testGroups value. + */ + public List testGroups() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withTestGroups(testGroups); + return this; + } + + /** + * Get the outputs property: List of connection monitor outputs. + * + * @return the outputs value. + */ + public List outputs() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withOutputs(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorParameters(); + } + this.innerProperties().withNotes(notes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ConnectionMonitor")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitor.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitor from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitor if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionMonitor. + */ + public static ConnectionMonitor fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitor deserializedConnectionMonitor = new ConnectionMonitor(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedConnectionMonitor.innerProperties = ConnectionMonitorParameters.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedConnectionMonitor.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectionMonitor.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitor; + }); + } +} 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..c9a431781e9f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorDestination.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the destination of connection monitor. + */ +@Fluent +public final class ConnectionMonitorDestination implements JsonSerializable { + /* + * The ID of the resource used as the destination by connection monitor. + */ + private String resourceId; + + /* + * Address of the connection monitor destination (IP or domain name). + */ + private String address; + + /* + * The destination port used by connection monitor. + */ + private Integer port; + + /** + * Creates an instance of ConnectionMonitorDestination class. + */ + public ConnectionMonitorDestination() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorDestination if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorDestination. + */ + public static ConnectionMonitorDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorDestination deserializedConnectionMonitorDestination = new ConnectionMonitorDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedConnectionMonitorDestination.resourceId = reader.getString(); + } else if ("address".equals(fieldName)) { + deserializedConnectionMonitorDestination.address = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedConnectionMonitorDestination.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorDestination; + }); + } +} 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..8f850d564ec9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpoint.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the connection monitor endpoint. + */ +@Fluent +public final class ConnectionMonitorEndpoint implements JsonSerializable { + /* + * The name of the connection monitor endpoint. + */ + private String name; + + /* + * The endpoint type. + */ + private EndpointType type; + + /* + * Resource ID of the connection monitor endpoint are supported for AzureVM, AzureVMSS, AzureVNet, AzureSubnet, + * MMAWorkspaceMachine, MMAWorkspaceNetwork, AzureArcVM endpoint type. + */ + private String resourceId; + + /* + * Address of the connection monitor endpoint. Supported for AzureVM, ExternalAddress, ArcMachine, + * MMAWorkspaceMachine endpoint type. + */ + private String address; + + /* + * Filter field is getting deprecated and should not be used. Instead use Include/Exclude scope fields for it. + */ + private ConnectionMonitorEndpointFilter filter; + + /* + * Endpoint scope defines which target resource to monitor in case of compound resource endpoints like VMSS, + * AzureSubnet, AzureVNet, MMAWorkspaceNetwork, AzureArcNetwork. + */ + private ConnectionMonitorEndpointScope scope; + + /* + * Test coverage for the endpoint. + */ + private CoverageLevel coverageLevel; + + /* + * Location details is optional and only being used for 'AzureArcNetwork' type endpoints, which contains region + * details. + */ + private ConnectionMonitorEndpointLocationDetails locationDetails; + + /* + * Subscription ID for connection monitor endpoint. It's an optional parameter which is being used for + * 'AzureArcNetwork' type endpoint. + */ + private String subscriptionId; + + /** + * Creates an instance of ConnectionMonitorEndpoint class. + */ + public ConnectionMonitorEndpoint() { + } + + /** + * 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 are supported for AzureVM, AzureVMSS, + * AzureVNet, AzureSubnet, MMAWorkspaceMachine, MMAWorkspaceNetwork, AzureArcVM endpoint type. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of the connection monitor endpoint are supported for AzureVM, AzureVMSS, + * AzureVNet, AzureSubnet, MMAWorkspaceMachine, MMAWorkspaceNetwork, AzureArcVM endpoint type. + * + * @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. Supported for AzureVM, ExternalAddress, + * ArcMachine, MMAWorkspaceMachine endpoint type. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Address of the connection monitor endpoint. Supported for AzureVM, ExternalAddress, + * ArcMachine, MMAWorkspaceMachine endpoint type. + * + * @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 field is getting deprecated and should not be used. Instead use Include/Exclude + * scope fields for it. + * + * @return the filter value. + */ + public ConnectionMonitorEndpointFilter filter() { + return this.filter; + } + + /** + * Set the filter property: Filter field is getting deprecated and should not be used. Instead use Include/Exclude + * scope fields for it. + * + * @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 defines which target resource to monitor in case of compound resource + * endpoints like VMSS, AzureSubnet, AzureVNet, MMAWorkspaceNetwork, AzureArcNetwork. + * + * @return the scope value. + */ + public ConnectionMonitorEndpointScope scope() { + return this.scope; + } + + /** + * Set the scope property: Endpoint scope defines which target resource to monitor in case of compound resource + * endpoints like VMSS, AzureSubnet, AzureVNet, MMAWorkspaceNetwork, AzureArcNetwork. + * + * @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; + } + + /** + * Get the locationDetails property: Location details is optional and only being used for 'AzureArcNetwork' type + * endpoints, which contains region details. + * + * @return the locationDetails value. + */ + public ConnectionMonitorEndpointLocationDetails locationDetails() { + return this.locationDetails; + } + + /** + * Set the locationDetails property: Location details is optional and only being used for 'AzureArcNetwork' type + * endpoints, which contains region details. + * + * @param locationDetails the locationDetails value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withLocationDetails(ConnectionMonitorEndpointLocationDetails locationDetails) { + this.locationDetails = locationDetails; + return this; + } + + /** + * Get the subscriptionId property: Subscription ID for connection monitor endpoint. It's an optional parameter + * which is being used for 'AzureArcNetwork' type endpoint. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription ID for connection monitor endpoint. It's an optional parameter + * which is being used for 'AzureArcNetwork' type endpoint. + * + * @param subscriptionId the subscriptionId value to set. + * @return the ConnectionMonitorEndpoint object itself. + */ + public ConnectionMonitorEndpoint withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ConnectionMonitorEndpoint")); + } + if (filter() != null) { + filter().validate(); + } + if (scope() != null) { + scope().validate(); + } + if (locationDetails() != null) { + locationDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorEndpoint.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeJsonField("filter", this.filter); + jsonWriter.writeJsonField("scope", this.scope); + jsonWriter.writeStringField("coverageLevel", this.coverageLevel == null ? null : this.coverageLevel.toString()); + jsonWriter.writeJsonField("locationDetails", this.locationDetails); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorEndpoint if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionMonitorEndpoint. + */ + public static ConnectionMonitorEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorEndpoint deserializedConnectionMonitorEndpoint = new ConnectionMonitorEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.type = EndpointType.fromString(reader.getString()); + } else if ("resourceId".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.resourceId = reader.getString(); + } else if ("address".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.address = reader.getString(); + } else if ("filter".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.filter = ConnectionMonitorEndpointFilter.fromJson(reader); + } else if ("scope".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.scope = ConnectionMonitorEndpointScope.fromJson(reader); + } else if ("coverageLevel".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.coverageLevel = CoverageLevel.fromString(reader.getString()); + } else if ("locationDetails".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.locationDetails + = ConnectionMonitorEndpointLocationDetails.fromJson(reader); + } else if ("subscriptionId".equals(fieldName)) { + deserializedConnectionMonitorEndpoint.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorEndpoint; + }); + } +} 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..d0e3949d183c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilter.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the connection monitor endpoint filter. + */ +@Fluent +public final class ConnectionMonitorEndpointFilter implements JsonSerializable { + /* + * The behavior of the endpoint filter. Currently only 'Include' is supported. + */ + private ConnectionMonitorEndpointFilterType type; + + /* + * List of items in the filter. + */ + private List items; + + /** + * Creates an instance of ConnectionMonitorEndpointFilter class. + */ + public ConnectionMonitorEndpointFilter() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorEndpointFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorEndpointFilter if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorEndpointFilter. + */ + public static ConnectionMonitorEndpointFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorEndpointFilter deserializedConnectionMonitorEndpointFilter + = new ConnectionMonitorEndpointFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedConnectionMonitorEndpointFilter.type + = ConnectionMonitorEndpointFilterType.fromString(reader.getString()); + } else if ("items".equals(fieldName)) { + List items + = reader.readArray(reader1 -> ConnectionMonitorEndpointFilterItem.fromJson(reader1)); + deserializedConnectionMonitorEndpointFilter.items = items; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorEndpointFilter; + }); + } +} 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..4eaae36b5ce8f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItem.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the connection monitor endpoint filter item. + */ +@Fluent +public final class ConnectionMonitorEndpointFilterItem + implements JsonSerializable { + /* + * The type of item included in the filter. Currently only 'AgentAddress' is supported. + */ + private ConnectionMonitorEndpointFilterItemType type; + + /* + * The address of the filter item. + */ + private String address; + + /** + * Creates an instance of ConnectionMonitorEndpointFilterItem class. + */ + public ConnectionMonitorEndpointFilterItem() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("address", this.address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorEndpointFilterItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorEndpointFilterItem if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorEndpointFilterItem. + */ + public static ConnectionMonitorEndpointFilterItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorEndpointFilterItem deserializedConnectionMonitorEndpointFilterItem + = new ConnectionMonitorEndpointFilterItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedConnectionMonitorEndpointFilterItem.type + = ConnectionMonitorEndpointFilterItemType.fromString(reader.getString()); + } else if ("address".equals(fieldName)) { + deserializedConnectionMonitorEndpointFilterItem.address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorEndpointFilterItem; + }); + } +} 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..8e17571fae3b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterItemType.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 java.util.Collection; + +/** + * The type of item included in the filter. Currently only 'AgentAddress' is supported. + */ +public final class ConnectionMonitorEndpointFilterItemType + extends ExpandableStringEnum { + /** + * Static value AgentAddress for ConnectionMonitorEndpointFilterItemType. + */ + public static final ConnectionMonitorEndpointFilterItemType AGENT_ADDRESS = fromString("AgentAddress"); + + /** + * Creates a new instance of ConnectionMonitorEndpointFilterItemType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionMonitorEndpointFilterItemType() { + } + + /** + * Creates or finds a ConnectionMonitorEndpointFilterItemType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterItemType. + */ + public static ConnectionMonitorEndpointFilterItemType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterItemType.class); + } + + /** + * Gets known ConnectionMonitorEndpointFilterItemType values. + * + * @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..fe4b8146a1cce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointFilterType.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 java.util.Collection; + +/** + * The behavior of the endpoint filter. Currently only 'Include' is supported. + */ +public final class ConnectionMonitorEndpointFilterType + extends ExpandableStringEnum { + /** + * Static value Include for ConnectionMonitorEndpointFilterType. + */ + public static final ConnectionMonitorEndpointFilterType INCLUDE = fromString("Include"); + + /** + * Creates a new instance of ConnectionMonitorEndpointFilterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionMonitorEndpointFilterType() { + } + + /** + * Creates or finds a ConnectionMonitorEndpointFilterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorEndpointFilterType. + */ + public static ConnectionMonitorEndpointFilterType fromString(String name) { + return fromString(name, ConnectionMonitorEndpointFilterType.class); + } + + /** + * Gets known ConnectionMonitorEndpointFilterType values. + * + * @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/ConnectionMonitorEndpointLocationDetails.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointLocationDetails.java new file mode 100644 index 0000000000000..471f5ed6c535a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointLocationDetails.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Connection monitor endpoint location details only being used for 'AzureArcNetwork' type endpoints, which contains the + * region details. + */ +@Fluent +public final class ConnectionMonitorEndpointLocationDetails + implements JsonSerializable { + /* + * Region for connection monitor endpoint. + */ + private String region; + + /** + * Creates an instance of ConnectionMonitorEndpointLocationDetails class. + */ + public ConnectionMonitorEndpointLocationDetails() { + } + + /** + * Get the region property: Region for connection monitor endpoint. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region for connection monitor endpoint. + * + * @param region the region value to set. + * @return the ConnectionMonitorEndpointLocationDetails object itself. + */ + public ConnectionMonitorEndpointLocationDetails withRegion(String region) { + this.region = region; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("region", this.region); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorEndpointLocationDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorEndpointLocationDetails if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorEndpointLocationDetails. + */ + public static ConnectionMonitorEndpointLocationDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorEndpointLocationDetails deserializedConnectionMonitorEndpointLocationDetails + = new ConnectionMonitorEndpointLocationDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("region".equals(fieldName)) { + deserializedConnectionMonitorEndpointLocationDetails.region = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorEndpointLocationDetails; + }); + } +} 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..9ee4cc2dd9084 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScope.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the connection monitor endpoint scope. + */ +@Fluent +public final class ConnectionMonitorEndpointScope implements JsonSerializable { + /* + * List of items which needs to be included to the endpoint scope. + */ + private List include; + + /* + * List of items which needs to be excluded from the endpoint scope. + */ + private List exclude; + + /** + * Creates an instance of ConnectionMonitorEndpointScope class. + */ + public ConnectionMonitorEndpointScope() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("include", this.include, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("exclude", this.exclude, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorEndpointScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorEndpointScope if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorEndpointScope. + */ + public static ConnectionMonitorEndpointScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorEndpointScope deserializedConnectionMonitorEndpointScope + = new ConnectionMonitorEndpointScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("include".equals(fieldName)) { + List include + = reader.readArray(reader1 -> ConnectionMonitorEndpointScopeItem.fromJson(reader1)); + deserializedConnectionMonitorEndpointScope.include = include; + } else if ("exclude".equals(fieldName)) { + List exclude + = reader.readArray(reader1 -> ConnectionMonitorEndpointScopeItem.fromJson(reader1)); + deserializedConnectionMonitorEndpointScope.exclude = exclude; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorEndpointScope; + }); + } +} 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..f089204205de3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorEndpointScopeItem.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the connection monitor endpoint scope item. + */ +@Fluent +public final class ConnectionMonitorEndpointScopeItem implements JsonSerializable { + /* + * The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or IPv4/IPv6 IP address. + */ + private String address; + + /** + * Creates an instance of ConnectionMonitorEndpointScopeItem class. + */ + public ConnectionMonitorEndpointScopeItem() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorEndpointScopeItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorEndpointScopeItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorEndpointScopeItem. + */ + public static ConnectionMonitorEndpointScopeItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorEndpointScopeItem deserializedConnectionMonitorEndpointScopeItem + = new ConnectionMonitorEndpointScopeItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedConnectionMonitorEndpointScopeItem.address = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorEndpointScopeItem; + }); + } +} 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..1a8fcd03d54dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorHttpConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the HTTP configuration. + */ +@Fluent +public final class ConnectionMonitorHttpConfiguration implements JsonSerializable { + /* + * The port to connect to. + */ + private Integer port; + + /* + * The HTTP method to use. + */ + private HttpConfigurationMethod method; + + /* + * The path component of the URI. For instance, "/dir1/dir2". + */ + private String path; + + /* + * The HTTP headers to transmit with the request. + */ + private List requestHeaders; + + /* + * HTTP status codes to consider successful. For instance, "2xx,301-304,418". + */ + private List validStatusCodeRanges; + + /* + * Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit. + */ + private Boolean preferHttps; + + /** + * Creates an instance of ConnectionMonitorHttpConfiguration class. + */ + public ConnectionMonitorHttpConfiguration() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeStringField("method", this.method == null ? null : this.method.toString()); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeArrayField("requestHeaders", this.requestHeaders, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("validStatusCodeRanges", this.validStatusCodeRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("preferHTTPS", this.preferHttps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorHttpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorHttpConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorHttpConfiguration. + */ + public static ConnectionMonitorHttpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorHttpConfiguration deserializedConnectionMonitorHttpConfiguration + = new ConnectionMonitorHttpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedConnectionMonitorHttpConfiguration.port = reader.getNullable(JsonReader::getInt); + } else if ("method".equals(fieldName)) { + deserializedConnectionMonitorHttpConfiguration.method + = HttpConfigurationMethod.fromString(reader.getString()); + } else if ("path".equals(fieldName)) { + deserializedConnectionMonitorHttpConfiguration.path = reader.getString(); + } else if ("requestHeaders".equals(fieldName)) { + List requestHeaders = reader.readArray(reader1 -> HttpHeader.fromJson(reader1)); + deserializedConnectionMonitorHttpConfiguration.requestHeaders = requestHeaders; + } else if ("validStatusCodeRanges".equals(fieldName)) { + List validStatusCodeRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionMonitorHttpConfiguration.validStatusCodeRanges = validStatusCodeRanges; + } else if ("preferHTTPS".equals(fieldName)) { + deserializedConnectionMonitorHttpConfiguration.preferHttps + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorHttpConfiguration; + }); + } +} 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..8c8a22d68b49f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorIcmpConfiguration.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the ICMP configuration. + */ +@Fluent +public final class ConnectionMonitorIcmpConfiguration implements JsonSerializable { + /* + * Value indicating whether path evaluation with trace route should be disabled. + */ + private Boolean disableTraceRoute; + + /** + * Creates an instance of ConnectionMonitorIcmpConfiguration class. + */ + public ConnectionMonitorIcmpConfiguration() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("disableTraceRoute", this.disableTraceRoute); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorIcmpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorIcmpConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorIcmpConfiguration. + */ + public static ConnectionMonitorIcmpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorIcmpConfiguration deserializedConnectionMonitorIcmpConfiguration + = new ConnectionMonitorIcmpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disableTraceRoute".equals(fieldName)) { + deserializedConnectionMonitorIcmpConfiguration.disableTraceRoute + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorIcmpConfiguration; + }); + } +} 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..758ab27ca80fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorListResult.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionMonitorResultInner; +import java.io.IOException; +import java.util.List; + +/** + * List of connection monitors. + */ +@Fluent +public final class ConnectionMonitorListResult implements JsonSerializable { + /* + * Information about connection monitors. + */ + private List value; + + /** + * Creates an instance of ConnectionMonitorListResult class. + */ + public ConnectionMonitorListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorListResult. + */ + public static ConnectionMonitorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorListResult deserializedConnectionMonitorListResult = new ConnectionMonitorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConnectionMonitorResultInner.fromJson(reader1)); + deserializedConnectionMonitorListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorListResult; + }); + } +} 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..53b472fc29c8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorOutput.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a connection monitor output destination. + */ +@Fluent +public final class ConnectionMonitorOutput implements JsonSerializable { + /* + * Connection monitor output destination type. Currently, only "Workspace" is supported. + */ + private OutputType type; + + /* + * Describes the settings for producing output into a log analytics workspace. + */ + private ConnectionMonitorWorkspaceSettings workspaceSettings; + + /** + * Creates an instance of ConnectionMonitorOutput class. + */ + public ConnectionMonitorOutput() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("workspaceSettings", this.workspaceSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorOutput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorOutput. + */ + public static ConnectionMonitorOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorOutput deserializedConnectionMonitorOutput = new ConnectionMonitorOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedConnectionMonitorOutput.type = OutputType.fromString(reader.getString()); + } else if ("workspaceSettings".equals(fieldName)) { + deserializedConnectionMonitorOutput.workspaceSettings + = ConnectionMonitorWorkspaceSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorOutput; + }); + } +} 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..034bc7123c387 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorQueryResult.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.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..266efcbf83eeb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorResult.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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/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..d4f006d25727a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSource.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the source of connection monitor. + */ +@Fluent +public final class ConnectionMonitorSource implements JsonSerializable { + /* + * The ID of the resource used as the source by connection monitor. + */ + private String resourceId; + + /* + * The source port used by connection monitor. + */ + private Integer port; + + /** + * Creates an instance of ConnectionMonitorSource class. + */ + public ConnectionMonitorSource() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property resourceId in model ConnectionMonitorSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorSource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorSource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionMonitorSource. + */ + public static ConnectionMonitorSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorSource deserializedConnectionMonitorSource = new ConnectionMonitorSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedConnectionMonitorSource.resourceId = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedConnectionMonitorSource.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorSource; + }); + } +} 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..8f5a27f6d772f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSourceStatus.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of connection monitor source. + */ +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 a new instance of ConnectionMonitorSourceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionMonitorSourceStatus() { + } + + /** + * Creates or finds a ConnectionMonitorSourceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorSourceStatus. + */ + public static ConnectionMonitorSourceStatus fromString(String name) { + return fromString(name, ConnectionMonitorSourceStatus.class); + } + + /** + * Gets known ConnectionMonitorSourceStatus values. + * + * @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..0e0a544e7212b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorSuccessThreshold.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the threshold for declaring a test successful. + */ +@Fluent +public final class ConnectionMonitorSuccessThreshold implements JsonSerializable { + /* + * The maximum percentage of failed checks permitted for a test to evaluate as successful. + */ + private Integer checksFailedPercent; + + /* + * The maximum round-trip time in milliseconds permitted for a test to evaluate as successful. + */ + private Float roundTripTimeMs; + + /** + * Creates an instance of ConnectionMonitorSuccessThreshold class. + */ + public ConnectionMonitorSuccessThreshold() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("checksFailedPercent", this.checksFailedPercent); + jsonWriter.writeNumberField("roundTripTimeMs", this.roundTripTimeMs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorSuccessThreshold from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorSuccessThreshold if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorSuccessThreshold. + */ + public static ConnectionMonitorSuccessThreshold fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorSuccessThreshold deserializedConnectionMonitorSuccessThreshold + = new ConnectionMonitorSuccessThreshold(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("checksFailedPercent".equals(fieldName)) { + deserializedConnectionMonitorSuccessThreshold.checksFailedPercent + = reader.getNullable(JsonReader::getInt); + } else if ("roundTripTimeMs".equals(fieldName)) { + deserializedConnectionMonitorSuccessThreshold.roundTripTimeMs + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorSuccessThreshold; + }); + } +} 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..953cb37dc3623 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTcpConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the TCP configuration. + */ +@Fluent +public final class ConnectionMonitorTcpConfiguration implements JsonSerializable { + /* + * The port to connect to. + */ + private Integer port; + + /* + * Value indicating whether path evaluation with trace route should be disabled. + */ + private Boolean disableTraceRoute; + + /* + * Destination port behavior. + */ + private DestinationPortBehavior destinationPortBehavior; + + /** + * Creates an instance of ConnectionMonitorTcpConfiguration class. + */ + public ConnectionMonitorTcpConfiguration() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeBooleanField("disableTraceRoute", this.disableTraceRoute); + jsonWriter.writeStringField("destinationPortBehavior", + this.destinationPortBehavior == null ? null : this.destinationPortBehavior.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorTcpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorTcpConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorTcpConfiguration. + */ + public static ConnectionMonitorTcpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorTcpConfiguration deserializedConnectionMonitorTcpConfiguration + = new ConnectionMonitorTcpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedConnectionMonitorTcpConfiguration.port = reader.getNullable(JsonReader::getInt); + } else if ("disableTraceRoute".equals(fieldName)) { + deserializedConnectionMonitorTcpConfiguration.disableTraceRoute + = reader.getNullable(JsonReader::getBoolean); + } else if ("destinationPortBehavior".equals(fieldName)) { + deserializedConnectionMonitorTcpConfiguration.destinationPortBehavior + = DestinationPortBehavior.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorTcpConfiguration; + }); + } +} 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..554212661af43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a connection monitor test configuration. + */ +@Fluent +public final class ConnectionMonitorTestConfiguration implements JsonSerializable { + /* + * The name of the connection monitor test configuration. + */ + private String name; + + /* + * The frequency of test evaluation, in seconds. + */ + private Integer testFrequencySec; + + /* + * The protocol to use in test evaluation. + */ + 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. + */ + private PreferredIpVersion preferredIpVersion; + + /* + * The parameters used to perform test evaluation over HTTP. + */ + private ConnectionMonitorHttpConfiguration httpConfiguration; + + /* + * The parameters used to perform test evaluation over TCP. + */ + private ConnectionMonitorTcpConfiguration tcpConfiguration; + + /* + * The parameters used to perform test evaluation over ICMP. + */ + private ConnectionMonitorIcmpConfiguration icmpConfiguration; + + /* + * The threshold for declaring a test successful. + */ + private ConnectionMonitorSuccessThreshold successThreshold; + + /** + * Creates an instance of ConnectionMonitorTestConfiguration class. + */ + public ConnectionMonitorTestConfiguration() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property name in model ConnectionMonitorTestConfiguration")); + } + if (protocol() == null) { + throw LOGGER.atError() + .log(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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorTestConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeNumberField("testFrequencySec", this.testFrequencySec); + jsonWriter.writeStringField("preferredIPVersion", + this.preferredIpVersion == null ? null : this.preferredIpVersion.toString()); + jsonWriter.writeJsonField("httpConfiguration", this.httpConfiguration); + jsonWriter.writeJsonField("tcpConfiguration", this.tcpConfiguration); + jsonWriter.writeJsonField("icmpConfiguration", this.icmpConfiguration); + jsonWriter.writeJsonField("successThreshold", this.successThreshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorTestConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorTestConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionMonitorTestConfiguration. + */ + public static ConnectionMonitorTestConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorTestConfiguration deserializedConnectionMonitorTestConfiguration + = new ConnectionMonitorTestConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.name = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.protocol + = ConnectionMonitorTestConfigurationProtocol.fromString(reader.getString()); + } else if ("testFrequencySec".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.testFrequencySec + = reader.getNullable(JsonReader::getInt); + } else if ("preferredIPVersion".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.preferredIpVersion + = PreferredIpVersion.fromString(reader.getString()); + } else if ("httpConfiguration".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.httpConfiguration + = ConnectionMonitorHttpConfiguration.fromJson(reader); + } else if ("tcpConfiguration".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.tcpConfiguration + = ConnectionMonitorTcpConfiguration.fromJson(reader); + } else if ("icmpConfiguration".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.icmpConfiguration + = ConnectionMonitorIcmpConfiguration.fromJson(reader); + } else if ("successThreshold".equals(fieldName)) { + deserializedConnectionMonitorTestConfiguration.successThreshold + = ConnectionMonitorSuccessThreshold.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorTestConfiguration; + }); + } +} 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..576f83147ff29 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestConfigurationProtocol.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol to use in test evaluation. + */ +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 a new instance of ConnectionMonitorTestConfigurationProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionMonitorTestConfigurationProtocol() { + } + + /** + * Creates or finds a ConnectionMonitorTestConfigurationProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorTestConfigurationProtocol. + */ + public static ConnectionMonitorTestConfigurationProtocol fromString(String name) { + return fromString(name, ConnectionMonitorTestConfigurationProtocol.class); + } + + /** + * Gets known ConnectionMonitorTestConfigurationProtocol values. + * + * @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..b217d2644d9d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorTestGroup.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Describes the connection monitor test group. + */ +@Fluent +public final class ConnectionMonitorTestGroup implements JsonSerializable { + /* + * The name of the connection monitor test group. + */ + private String name; + + /* + * Value indicating whether test group is disabled. + */ + private Boolean disable; + + /* + * List of test configuration names. + */ + private List testConfigurations; + + /* + * List of source endpoint names. + */ + private List sources; + + /* + * List of destination endpoint names. + */ + private List destinations; + + /** + * Creates an instance of ConnectionMonitorTestGroup class. + */ + public ConnectionMonitorTestGroup() { + } + + /** + * 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.atError() + .log( + new IllegalArgumentException("Missing required property name in model ConnectionMonitorTestGroup")); + } + if (testConfigurations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property testConfigurations in model ConnectionMonitorTestGroup")); + } + if (sources() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sources in model ConnectionMonitorTestGroup")); + } + if (destinations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinations in model ConnectionMonitorTestGroup")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorTestGroup.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("testConfigurations", this.testConfigurations, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("disable", this.disable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorTestGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorTestGroup if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionMonitorTestGroup. + */ + public static ConnectionMonitorTestGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorTestGroup deserializedConnectionMonitorTestGroup = new ConnectionMonitorTestGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedConnectionMonitorTestGroup.name = reader.getString(); + } else if ("testConfigurations".equals(fieldName)) { + List testConfigurations = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionMonitorTestGroup.testConfigurations = testConfigurations; + } else if ("sources".equals(fieldName)) { + List sources = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionMonitorTestGroup.sources = sources; + } else if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionMonitorTestGroup.destinations = destinations; + } else if ("disable".equals(fieldName)) { + deserializedConnectionMonitorTestGroup.disable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorTestGroup; + }); + } +} 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..fcfc6099c59e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of connection monitor. + */ +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 a new instance of ConnectionMonitorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionMonitorType() { + } + + /** + * Creates or finds a ConnectionMonitorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionMonitorType. + */ + public static ConnectionMonitorType fromString(String name) { + return fromString(name, ConnectionMonitorType.class); + } + + /** + * Gets known ConnectionMonitorType values. + * + * @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..91fdf45c59207 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitorWorkspaceSettings.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.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the settings for producing output into a log analytics workspace. + */ +@Fluent +public final class ConnectionMonitorWorkspaceSettings implements JsonSerializable { + /* + * Log analytics workspace resource ID. + */ + private String workspaceResourceId; + + /** + * Creates an instance of ConnectionMonitorWorkspaceSettings class. + */ + public ConnectionMonitorWorkspaceSettings() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("workspaceResourceId", this.workspaceResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionMonitorWorkspaceSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionMonitorWorkspaceSettings if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionMonitorWorkspaceSettings. + */ + public static ConnectionMonitorWorkspaceSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionMonitorWorkspaceSettings deserializedConnectionMonitorWorkspaceSettings + = new ConnectionMonitorWorkspaceSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workspaceResourceId".equals(fieldName)) { + deserializedConnectionMonitorWorkspaceSettings.workspaceResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionMonitorWorkspaceSettings; + }); + } +} 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..3aa3f29ad6956 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionMonitors.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkWatcherName, + String connectionMonitorName, 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. + */ + ConnectionMonitorResult get(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..38dc38f284bc3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionResetSharedKey.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.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..978c921e19ffd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKey.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.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/ConnectionSharedKeyResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKeyResult.java new file mode 100644 index 0000000000000..e9d7d8483f288 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKeyResult.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.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyResultInner; + +/** + * An immutable client-side representation of ConnectionSharedKeyResult. + */ +public interface ConnectionSharedKeyResult { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the properties property: Properties of the shared key. + * + * @return the properties value. + */ + SharedKeyProperties properties(); + + /** + * 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 inner com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyResultInner object. + * + * @return the inner object. + */ + ConnectionSharedKeyResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKeyResultList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKeyResultList.java new file mode 100644 index 0000000000000..2a99a695063da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionSharedKeyResultList.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyResultInner; +import java.io.IOException; +import java.util.List; + +/** + * The list of shared keys for the vpn link connection. It should only contain one shared key for each vpn link + * connection. + */ +@Fluent +public final class ConnectionSharedKeyResultList implements JsonSerializable { + /* + * List of SharedKeys. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ConnectionSharedKeyResultList class. + */ + public ConnectionSharedKeyResultList() { + } + + /** + * Get the value property: List of SharedKeys. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of SharedKeys. + * + * @param value the value value to set. + * @return the ConnectionSharedKeyResultList object itself. + */ + public ConnectionSharedKeyResultList 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 ConnectionSharedKeyResultList object itself. + */ + public ConnectionSharedKeyResultList 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionSharedKeyResultList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionSharedKeyResultList if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionSharedKeyResultList. + */ + public static ConnectionSharedKeyResultList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionSharedKeyResultList deserializedConnectionSharedKeyResultList + = new ConnectionSharedKeyResultList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConnectionSharedKeyResultInner.fromJson(reader1)); + deserializedConnectionSharedKeyResultList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConnectionSharedKeyResultList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionSharedKeyResultList; + }); + } +} 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..a45a14e71f08a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The connection state. + */ +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 a new instance of ConnectionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionState() { + } + + /** + * Creates or finds a ConnectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionState. + */ + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** + * Gets known ConnectionState values. + * + * @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..8a54572d02bc8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStateSnapshot.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Connection state snapshot. + */ +@Fluent +public final class ConnectionStateSnapshot implements JsonSerializable { + /* + * The connection state. + */ + private ConnectionState connectionState; + + /* + * The start time of the connection snapshot. + */ + private OffsetDateTime startTime; + + /* + * The end time of the connection snapshot. + */ + private OffsetDateTime endTime; + + /* + * Connectivity analysis evaluation state. + */ + private EvaluationState evaluationState; + + /* + * Average latency in ms. + */ + private Long avgLatencyInMs; + + /* + * Minimum latency in ms. + */ + private Long minLatencyInMs; + + /* + * Maximum latency in ms. + */ + private Long maxLatencyInMs; + + /* + * The number of sent probes. + */ + private Long probesSent; + + /* + * The number of failed probes. + */ + private Long probesFailed; + + /* + * List of hops between the source and the destination. + */ + private List hops; + + /** + * Creates an instance of ConnectionStateSnapshot class. + */ + public ConnectionStateSnapshot() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectionState", + this.connectionState == null ? null : this.connectionState.toString()); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeStringField("evaluationState", + this.evaluationState == null ? null : this.evaluationState.toString()); + jsonWriter.writeNumberField("avgLatencyInMs", this.avgLatencyInMs); + jsonWriter.writeNumberField("minLatencyInMs", this.minLatencyInMs); + jsonWriter.writeNumberField("maxLatencyInMs", this.maxLatencyInMs); + jsonWriter.writeNumberField("probesSent", this.probesSent); + jsonWriter.writeNumberField("probesFailed", this.probesFailed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionStateSnapshot from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionStateSnapshot if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionStateSnapshot. + */ + public static ConnectionStateSnapshot fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionStateSnapshot deserializedConnectionStateSnapshot = new ConnectionStateSnapshot(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionState".equals(fieldName)) { + deserializedConnectionStateSnapshot.connectionState + = ConnectionState.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedConnectionStateSnapshot.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedConnectionStateSnapshot.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("evaluationState".equals(fieldName)) { + deserializedConnectionStateSnapshot.evaluationState + = EvaluationState.fromString(reader.getString()); + } else if ("avgLatencyInMs".equals(fieldName)) { + deserializedConnectionStateSnapshot.avgLatencyInMs = reader.getNullable(JsonReader::getLong); + } else if ("minLatencyInMs".equals(fieldName)) { + deserializedConnectionStateSnapshot.minLatencyInMs = reader.getNullable(JsonReader::getLong); + } else if ("maxLatencyInMs".equals(fieldName)) { + deserializedConnectionStateSnapshot.maxLatencyInMs = reader.getNullable(JsonReader::getLong); + } else if ("probesSent".equals(fieldName)) { + deserializedConnectionStateSnapshot.probesSent = reader.getNullable(JsonReader::getLong); + } else if ("probesFailed".equals(fieldName)) { + deserializedConnectionStateSnapshot.probesFailed = reader.getNullable(JsonReader::getLong); + } else if ("hops".equals(fieldName)) { + List hops = reader.readArray(reader1 -> ConnectivityHop.fromJson(reader1)); + deserializedConnectionStateSnapshot.hops = hops; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionStateSnapshot; + }); + } +} 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..bf23b626527ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectionStatus.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 java.util.Collection; + +/** + * The connection status. + */ +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 a new instance of ConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionStatus() { + } + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** + * Gets known ConnectionStatus values. + * + * @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/ConnectivityConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfiguration.java new file mode 100644 index 0000000000000..dfde8f1195efa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfiguration.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationInner; +import java.util.List; + +/** + * An immutable client-side representation of ConnectivityConfiguration. + */ +public interface ConnectivityConfiguration { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the connectivity configuration. + * + * @return the description value. + */ + String description(); + + /** + * Gets the connectivityTopology property: Connectivity topology type. + * + * @return the connectivityTopology value. + */ + ConnectivityTopology connectivityTopology(); + + /** + * Gets the hubs property: List of hubItems. + * + * @return the hubs value. + */ + List hubs(); + + /** + * Gets the isGlobal property: Flag if global mesh is supported. + * + * @return the isGlobal value. + */ + IsGlobal isGlobal(); + + /** + * Gets the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + List appliesToGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the connectivity configuration resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @return the deleteExistingPeering value. + */ + DeleteExistingPeering deleteExistingPeering(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationInner object. + * + * @return the inner object. + */ + ConnectivityConfigurationInner innerModel(); + + /** + * The entirety of the ConnectivityConfiguration definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ConnectivityConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ConnectivityConfiguration definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ConnectivityConfiguration definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @return the next definition stage. + */ + WithCreate withExistingNetworkManager(String resourceGroupName, String networkManagerName); + } + + /** + * The stage of the ConnectivityConfiguration 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.WithDescription, DefinitionStages.WithConnectivityTopology, + DefinitionStages.WithHubs, DefinitionStages.WithIsGlobal, DefinitionStages.WithAppliesToGroups, + DefinitionStages.WithDeleteExistingPeering { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConnectivityConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConnectivityConfiguration create(Context context); + } + + /** + * The stage of the ConnectivityConfiguration definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the connectivity configuration.. + * + * @param description A description of the connectivity configuration. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the ConnectivityConfiguration definition allowing to specify connectivityTopology. + */ + interface WithConnectivityTopology { + /** + * Specifies the connectivityTopology property: Connectivity topology type.. + * + * @param connectivityTopology Connectivity topology type. + * @return the next definition stage. + */ + WithCreate withConnectivityTopology(ConnectivityTopology connectivityTopology); + } + + /** + * The stage of the ConnectivityConfiguration definition allowing to specify hubs. + */ + interface WithHubs { + /** + * Specifies the hubs property: List of hubItems. + * + * @param hubs List of hubItems. + * @return the next definition stage. + */ + WithCreate withHubs(List hubs); + } + + /** + * The stage of the ConnectivityConfiguration definition allowing to specify isGlobal. + */ + interface WithIsGlobal { + /** + * Specifies the isGlobal property: Flag if global mesh is supported.. + * + * @param isGlobal Flag if global mesh is supported. + * @return the next definition stage. + */ + WithCreate withIsGlobal(IsGlobal isGlobal); + } + + /** + * The stage of the ConnectivityConfiguration definition allowing to specify appliesToGroups. + */ + interface WithAppliesToGroups { + /** + * Specifies the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups Groups for configuration. + * @return the next definition stage. + */ + WithCreate withAppliesToGroups(List appliesToGroups); + } + + /** + * The stage of the ConnectivityConfiguration definition allowing to specify deleteExistingPeering. + */ + interface WithDeleteExistingPeering { + /** + * Specifies the deleteExistingPeering property: Flag if need to remove current existing peerings.. + * + * @param deleteExistingPeering Flag if need to remove current existing peerings. + * @return the next definition stage. + */ + WithCreate withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering); + } + } + + /** + * Begins update for the ConnectivityConfiguration resource. + * + * @return the stage of resource update. + */ + ConnectivityConfiguration.Update update(); + + /** + * The template for ConnectivityConfiguration update. + */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithConnectivityTopology, UpdateStages.WithHubs, + UpdateStages.WithIsGlobal, UpdateStages.WithAppliesToGroups, UpdateStages.WithDeleteExistingPeering { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConnectivityConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConnectivityConfiguration apply(Context context); + } + + /** + * The ConnectivityConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the ConnectivityConfiguration update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the connectivity configuration.. + * + * @param description A description of the connectivity configuration. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the ConnectivityConfiguration update allowing to specify connectivityTopology. + */ + interface WithConnectivityTopology { + /** + * Specifies the connectivityTopology property: Connectivity topology type.. + * + * @param connectivityTopology Connectivity topology type. + * @return the next definition stage. + */ + Update withConnectivityTopology(ConnectivityTopology connectivityTopology); + } + + /** + * The stage of the ConnectivityConfiguration update allowing to specify hubs. + */ + interface WithHubs { + /** + * Specifies the hubs property: List of hubItems. + * + * @param hubs List of hubItems. + * @return the next definition stage. + */ + Update withHubs(List hubs); + } + + /** + * The stage of the ConnectivityConfiguration update allowing to specify isGlobal. + */ + interface WithIsGlobal { + /** + * Specifies the isGlobal property: Flag if global mesh is supported.. + * + * @param isGlobal Flag if global mesh is supported. + * @return the next definition stage. + */ + Update withIsGlobal(IsGlobal isGlobal); + } + + /** + * The stage of the ConnectivityConfiguration update allowing to specify appliesToGroups. + */ + interface WithAppliesToGroups { + /** + * Specifies the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups Groups for configuration. + * @return the next definition stage. + */ + Update withAppliesToGroups(List appliesToGroups); + } + + /** + * The stage of the ConnectivityConfiguration update allowing to specify deleteExistingPeering. + */ + interface WithDeleteExistingPeering { + /** + * Specifies the deleteExistingPeering property: Flag if need to remove current existing peerings.. + * + * @param deleteExistingPeering Flag if need to remove current existing peerings. + * @return the next definition stage. + */ + Update withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConnectivityConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConnectivityConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurationListResult.java new file mode 100644 index 0000000000000..2d06ba082cb7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list network manager connectivity configurations. It contains a list of configurations and a + * link to get the next set of results. + */ +@Fluent +public final class ConnectivityConfigurationListResult + implements JsonSerializable { + /* + * Gets a page of Connectivity Configurations + */ + private List value; + + /* + * Gets the URL to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ConnectivityConfigurationListResult class. + */ + public ConnectivityConfigurationListResult() { + } + + /** + * Get the value property: Gets a page of Connectivity Configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of Connectivity Configurations. + * + * @param value the value value to set. + * @return the ConnectivityConfigurationListResult object itself. + */ + public ConnectivityConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the ConnectivityConfigurationListResult object itself. + */ + public ConnectivityConfigurationListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityConfigurationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectivityConfigurationListResult. + */ + public static ConnectivityConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityConfigurationListResult deserializedConnectivityConfigurationListResult + = new ConnectivityConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ConnectivityConfigurationInner.fromJson(reader1)); + deserializedConnectivityConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConnectivityConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityConfigurationListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurations.java new file mode 100644 index 0000000000000..f98dee7414ae4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityConfigurations.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ConnectivityConfigurations. + */ +public interface ConnectivityConfigurations { + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context); + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name. + */ + ConnectivityConfiguration get(String resourceGroupName, String networkManagerName, String configurationName); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager connectivity configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, Boolean force, + Context context); + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 manager connectivity configurations as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager connectivity configuration in a specified network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 manager connectivity configurations as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context); + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration 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 Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name along with {@link Response}. + */ + ConnectivityConfiguration getById(String id); + + /** + * Gets a Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration 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 Network Connectivity Configuration, specified by the resource group, network manager name, and + * connectivity Configuration name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a network manager connectivity configuration, specified by the resource group, network manager name, and + * connectivity configuration name. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new ConnectivityConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new ConnectivityConfiguration definition. + */ + ConnectivityConfiguration.DefinitionStages.Blank define(String name); +} 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..37bd21955ec7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityDestination.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define destination of connection. + */ +@Fluent +public final class ConnectivityDestination implements JsonSerializable { + /* + * The ID of the resource to which a connection attempt will be made. + */ + private String resourceId; + + /* + * The IP address or URI the resource to which a connection attempt will be made. + */ + private String address; + + /* + * Port on which check connectivity will be performed. + */ + private Integer port; + + /** + * Creates an instance of ConnectivityDestination class. + */ + public ConnectivityDestination() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityDestination if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectivityDestination. + */ + public static ConnectivityDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityDestination deserializedConnectivityDestination = new ConnectivityDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedConnectivityDestination.resourceId = reader.getString(); + } else if ("address".equals(fieldName)) { + deserializedConnectivityDestination.address = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedConnectivityDestination.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityDestination; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityGroupItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityGroupItem.java new file mode 100644 index 0000000000000..eaf0a4b25ccb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityGroupItem.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Connectivity group item. + */ +@Fluent +public final class ConnectivityGroupItem implements JsonSerializable { + /* + * Network group Id. + */ + private String networkGroupId; + + /* + * Flag if need to use hub gateway. + */ + private UseHubGateway useHubGateway; + + /* + * Flag if global is supported. + */ + private IsGlobal isGlobal; + + /* + * Group connectivity type. + */ + private GroupConnectivity groupConnectivity; + + /** + * Creates an instance of ConnectivityGroupItem class. + */ + public ConnectivityGroupItem() { + } + + /** + * Get the networkGroupId property: Network group Id. + * + * @return the networkGroupId value. + */ + public String networkGroupId() { + return this.networkGroupId; + } + + /** + * Set the networkGroupId property: Network group Id. + * + * @param networkGroupId the networkGroupId value to set. + * @return the ConnectivityGroupItem object itself. + */ + public ConnectivityGroupItem withNetworkGroupId(String networkGroupId) { + this.networkGroupId = networkGroupId; + return this; + } + + /** + * Get the useHubGateway property: Flag if need to use hub gateway. + * + * @return the useHubGateway value. + */ + public UseHubGateway useHubGateway() { + return this.useHubGateway; + } + + /** + * Set the useHubGateway property: Flag if need to use hub gateway. + * + * @param useHubGateway the useHubGateway value to set. + * @return the ConnectivityGroupItem object itself. + */ + public ConnectivityGroupItem withUseHubGateway(UseHubGateway useHubGateway) { + this.useHubGateway = useHubGateway; + return this; + } + + /** + * Get the isGlobal property: Flag if global is supported. + * + * @return the isGlobal value. + */ + public IsGlobal isGlobal() { + return this.isGlobal; + } + + /** + * Set the isGlobal property: Flag if global is supported. + * + * @param isGlobal the isGlobal value to set. + * @return the ConnectivityGroupItem object itself. + */ + public ConnectivityGroupItem withIsGlobal(IsGlobal isGlobal) { + this.isGlobal = isGlobal; + return this; + } + + /** + * Get the groupConnectivity property: Group connectivity type. + * + * @return the groupConnectivity value. + */ + public GroupConnectivity groupConnectivity() { + return this.groupConnectivity; + } + + /** + * Set the groupConnectivity property: Group connectivity type. + * + * @param groupConnectivity the groupConnectivity value to set. + * @return the ConnectivityGroupItem object itself. + */ + public ConnectivityGroupItem withGroupConnectivity(GroupConnectivity groupConnectivity) { + this.groupConnectivity = groupConnectivity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkGroupId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkGroupId in model ConnectivityGroupItem")); + } + if (groupConnectivity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property groupConnectivity in model ConnectivityGroupItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityGroupItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkGroupId", this.networkGroupId); + jsonWriter.writeStringField("groupConnectivity", + this.groupConnectivity == null ? null : this.groupConnectivity.toString()); + jsonWriter.writeStringField("useHubGateway", this.useHubGateway == null ? null : this.useHubGateway.toString()); + jsonWriter.writeStringField("isGlobal", this.isGlobal == null ? null : this.isGlobal.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityGroupItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityGroupItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivityGroupItem. + */ + public static ConnectivityGroupItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityGroupItem deserializedConnectivityGroupItem = new ConnectivityGroupItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkGroupId".equals(fieldName)) { + deserializedConnectivityGroupItem.networkGroupId = reader.getString(); + } else if ("groupConnectivity".equals(fieldName)) { + deserializedConnectivityGroupItem.groupConnectivity + = GroupConnectivity.fromString(reader.getString()); + } else if ("useHubGateway".equals(fieldName)) { + deserializedConnectivityGroupItem.useHubGateway = UseHubGateway.fromString(reader.getString()); + } else if ("isGlobal".equals(fieldName)) { + deserializedConnectivityGroupItem.isGlobal = IsGlobal.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityGroupItem; + }); + } +} 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..c922e3a3af5aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityHop.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Information about a hop between the source and the destination. + */ +@Immutable +public final class ConnectivityHop implements JsonSerializable { + /* + * The type of the hop. + */ + private String type; + + /* + * The ID of the hop. + */ + private String id; + + /* + * The IP address of the hop. + */ + private String address; + + /* + * The ID of the resource corresponding to this hop. + */ + private String resourceId; + + /* + * List of next hop identifiers. + */ + private List nextHopIds; + + /* + * List of previous hop identifiers. + */ + private List previousHopIds; + + /* + * List of hop links. + */ + private List links; + + /* + * List of previous hop links. + */ + private List previousLinks; + + /* + * List of issues. + */ + private List issues; + + /** + * Creates an instance of ConnectivityHop class. + */ + public ConnectivityHop() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityHop from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityHop if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectivityHop. + */ + public static ConnectivityHop fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityHop deserializedConnectivityHop = new ConnectivityHop(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedConnectivityHop.type = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedConnectivityHop.id = reader.getString(); + } else if ("address".equals(fieldName)) { + deserializedConnectivityHop.address = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedConnectivityHop.resourceId = reader.getString(); + } else if ("nextHopIds".equals(fieldName)) { + List nextHopIds = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectivityHop.nextHopIds = nextHopIds; + } else if ("previousHopIds".equals(fieldName)) { + List previousHopIds = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectivityHop.previousHopIds = previousHopIds; + } else if ("links".equals(fieldName)) { + List links = reader.readArray(reader1 -> HopLink.fromJson(reader1)); + deserializedConnectivityHop.links = links; + } else if ("previousLinks".equals(fieldName)) { + List previousLinks = reader.readArray(reader1 -> HopLink.fromJson(reader1)); + deserializedConnectivityHop.previousLinks = previousLinks; + } else if ("issues".equals(fieldName)) { + List issues = reader.readArray(reader1 -> ConnectivityIssue.fromJson(reader1)); + deserializedConnectivityHop.issues = issues; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityHop; + }); + } +} 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..495650e61da8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityInformation.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.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..9a68309a0d1ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityIssue.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Information about an issue encountered in the process of checking for connectivity. + */ +@Immutable +public final class ConnectivityIssue implements JsonSerializable { + /* + * The origin of the issue. + */ + private Origin origin; + + /* + * The severity of the issue. + */ + private Severity severity; + + /* + * The type of issue. + */ + private IssueType type; + + /* + * Provides additional context on the issue. + */ + private List> context; + + /** + * Creates an instance of ConnectivityIssue class. + */ + public ConnectivityIssue() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityIssue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityIssue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectivityIssue. + */ + public static ConnectivityIssue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityIssue deserializedConnectivityIssue = new ConnectivityIssue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("origin".equals(fieldName)) { + deserializedConnectivityIssue.origin = Origin.fromString(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedConnectivityIssue.severity = Severity.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedConnectivityIssue.type = IssueType.fromString(reader.getString()); + } else if ("context".equals(fieldName)) { + List> context + = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2.getString())); + deserializedConnectivityIssue.context = context; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityIssue; + }); + } +} 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..505b91f86bf62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityParameters.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that determine how the connectivity check will be performed. + */ +@Fluent +public final class ConnectivityParameters implements JsonSerializable { + /* + * The source of the connection. + */ + private ConnectivitySource source; + + /* + * The destination of connection. + */ + private ConnectivityDestination destination; + + /* + * Network protocol. + */ + private Protocol protocol; + + /* + * Configuration of the protocol. + */ + private ProtocolConfiguration protocolConfiguration; + + /* + * Preferred IP version of the connection. + */ + private IpVersion preferredIpVersion; + + /** + * Creates an instance of ConnectivityParameters class. + */ + public ConnectivityParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property source in model ConnectivityParameters")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model ConnectivityParameters")); + } else { + destination().validate(); + } + if (protocolConfiguration() != null) { + protocolConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeJsonField("protocolConfiguration", this.protocolConfiguration); + jsonWriter.writeStringField("preferredIPVersion", + this.preferredIpVersion == null ? null : this.preferredIpVersion.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivityParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivityParameters. + */ + public static ConnectivityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivityParameters deserializedConnectivityParameters = new ConnectivityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedConnectivityParameters.source = ConnectivitySource.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedConnectivityParameters.destination = ConnectivityDestination.fromJson(reader); + } else if ("protocol".equals(fieldName)) { + deserializedConnectivityParameters.protocol = Protocol.fromString(reader.getString()); + } else if ("protocolConfiguration".equals(fieldName)) { + deserializedConnectivityParameters.protocolConfiguration = ProtocolConfiguration.fromJson(reader); + } else if ("preferredIPVersion".equals(fieldName)) { + deserializedConnectivityParameters.preferredIpVersion = IpVersion.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivityParameters; + }); + } +} 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..40073fd9a9008 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivitySource.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the source of the connection. + */ +@Fluent +public final class ConnectivitySource implements JsonSerializable { + /* + * The ID of the resource from which a connectivity check will be initiated. + */ + private String resourceId; + + /* + * The source port from which a connectivity check will be performed. + */ + private Integer port; + + /** + * Creates an instance of ConnectivitySource class. + */ + public ConnectivitySource() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property resourceId in model ConnectivitySource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivitySource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectivitySource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectivitySource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectivitySource. + */ + public static ConnectivitySource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectivitySource deserializedConnectivitySource = new ConnectivitySource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedConnectivitySource.resourceId = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedConnectivitySource.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectivitySource; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityTopology.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityTopology.java new file mode 100644 index 0000000000000..5899d5bae806d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ConnectivityTopology.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Connectivity topology type. + */ +public final class ConnectivityTopology extends ExpandableStringEnum { + /** + * Static value HubAndSpoke for ConnectivityTopology. + */ + public static final ConnectivityTopology HUB_AND_SPOKE = fromString("HubAndSpoke"); + + /** + * Static value Mesh for ConnectivityTopology. + */ + public static final ConnectivityTopology MESH = fromString("Mesh"); + + /** + * Creates a new instance of ConnectivityTopology value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectivityTopology() { + } + + /** + * Creates or finds a ConnectivityTopology from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectivityTopology. + */ + public static ConnectivityTopology fromString(String name) { + return fromString(name, ConnectivityTopology.class); + } + + /** + * Gets known ConnectivityTopology values. + * + * @return known ConnectivityTopology values. + */ + public static Collection values() { + return values(ConnectivityTopology.class); + } +} 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..77ef0e15a450a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Container.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Reference to container resource in remote resource provider. + */ +@Fluent +public final class Container extends SubResource { + /** + * Creates an instance of Container class. + */ + public Container() { + } + + /** + * {@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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Container from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Container if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Container. + */ + public static Container fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Container deserializedContainer = new Container(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainer.withId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedContainer; + }); + } +} 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..46dc536e63f9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterface.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfacePropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Container network interface child resource. + */ +@Fluent +public final class ContainerNetworkInterface extends SubResource { + /* + * Container network interface properties. + */ + private ContainerNetworkInterfacePropertiesFormat innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + private String name; + + /* + * Sub Resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of ContainerNetworkInterface class. + */ + public ContainerNetworkInterface() { + } + + /** + * Get the innerProperties property: Container network interface properties. + * + * @return the innerProperties value. + */ + private ContainerNetworkInterfacePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ContainerNetworkInterface withId(String id) { + super.withId(id); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerNetworkInterfacePropertiesFormat(); + } + this.innerProperties().withContainer(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.innerProperties() == null ? null : this.innerProperties().ipConfigurations(); + } + + /** + * Get the provisioningState property: The provisioning state of the container network interface resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerNetworkInterface from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerNetworkInterface if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerNetworkInterface. + */ + public static ContainerNetworkInterface fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerNetworkInterface deserializedContainerNetworkInterface = new ContainerNetworkInterface(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerNetworkInterface.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedContainerNetworkInterface.innerProperties + = ContainerNetworkInterfacePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedContainerNetworkInterface.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerNetworkInterface.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedContainerNetworkInterface.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerNetworkInterface; + }); + } +} 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..bab4df8944c78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfaceConfigurationPropertiesFormat; +import com.azure.resourcemanager.network.generated.fluent.models.IpConfigurationProfileInner; +import java.io.IOException; +import java.util.List; + +/** + * Container network interface configuration child resource. + */ +@Fluent +public final class ContainerNetworkInterfaceConfiguration extends SubResource { + /* + * Container network interface configuration properties. + */ + private ContainerNetworkInterfaceConfigurationPropertiesFormat innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + private String name; + + /* + * Sub Resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of ContainerNetworkInterfaceConfiguration class. + */ + public ContainerNetworkInterfaceConfiguration() { + } + + /** + * Get the innerProperties property: Container network interface configuration properties. + * + * @return the innerProperties value. + */ + private ContainerNetworkInterfaceConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ContainerNetworkInterfaceConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the ipConfigurations property: A list of ip configurations of the container network interface configuration. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerNetworkInterfaceConfigurationPropertiesFormat(); + } + this.innerProperties().withIpConfigurations(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerNetworkInterfaceConfigurationPropertiesFormat(); + } + this.innerProperties().withContainerNetworkInterfaces(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerNetworkInterfaceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerNetworkInterfaceConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerNetworkInterfaceConfiguration. + */ + public static ContainerNetworkInterfaceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerNetworkInterfaceConfiguration deserializedContainerNetworkInterfaceConfiguration + = new ContainerNetworkInterfaceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedContainerNetworkInterfaceConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedContainerNetworkInterfaceConfiguration.innerProperties + = ContainerNetworkInterfaceConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedContainerNetworkInterfaceConfiguration.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerNetworkInterfaceConfiguration.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedContainerNetworkInterfaceConfiguration.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerNetworkInterfaceConfiguration; + }); + } +} 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..88db1d3262821 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ContainerNetworkInterfaceIpConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ContainerNetworkInterfaceIpConfigurationPropertiesFormat; +import java.io.IOException; + +/** + * The ip configuration for a container network interface. + */ +@Fluent +public final class ContainerNetworkInterfaceIpConfiguration + implements JsonSerializable { + /* + * Properties of the container network interface IP configuration. + */ + private ContainerNetworkInterfaceIpConfigurationPropertiesFormat innerProperties; + + /* + * The name of the resource. This name can be used to access the resource. + */ + private String name; + + /* + * Sub Resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of ContainerNetworkInterfaceIpConfiguration class. + */ + public ContainerNetworkInterfaceIpConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the container network interface IP configuration. + * + * @return the innerProperties value. + */ + private ContainerNetworkInterfaceIpConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerNetworkInterfaceIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerNetworkInterfaceIpConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ContainerNetworkInterfaceIpConfiguration. + */ + public static ContainerNetworkInterfaceIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerNetworkInterfaceIpConfiguration deserializedContainerNetworkInterfaceIpConfiguration + = new ContainerNetworkInterfaceIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedContainerNetworkInterfaceIpConfiguration.innerProperties + = ContainerNetworkInterfaceIpConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedContainerNetworkInterfaceIpConfiguration.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedContainerNetworkInterfaceIpConfiguration.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedContainerNetworkInterfaceIpConfiguration.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerNetworkInterfaceIpConfiguration; + }); + } +} 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..80604ac01d76b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CoverageLevel.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Test coverage for the endpoint. + */ +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 a new instance of CoverageLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CoverageLevel() { + } + + /** + * Creates or finds a CoverageLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding CoverageLevel. + */ + public static CoverageLevel fromString(String name) { + return fromString(name, CoverageLevel.class); + } + + /** + * Gets known CoverageLevel values. + * + * @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/Criterion.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Criterion.java new file mode 100644 index 0000000000000..e1ffbf1f68a51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Criterion.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A matching criteria which matches routes based on route prefix, community, and AS path. + */ +@Fluent +public final class Criterion implements JsonSerializable { + /* + * List of route prefixes which this criteria matches. + */ + private List routePrefix; + + /* + * List of BGP communities which this criteria matches. + */ + private List community; + + /* + * List of AS paths which this criteria matches. + */ + private List asPath; + + /* + * Match condition to apply RouteMap rules. + */ + private RouteMapMatchCondition matchCondition; + + /** + * Creates an instance of Criterion class. + */ + public Criterion() { + } + + /** + * Get the routePrefix property: List of route prefixes which this criteria matches. + * + * @return the routePrefix value. + */ + public List routePrefix() { + return this.routePrefix; + } + + /** + * Set the routePrefix property: List of route prefixes which this criteria matches. + * + * @param routePrefix the routePrefix value to set. + * @return the Criterion object itself. + */ + public Criterion withRoutePrefix(List routePrefix) { + this.routePrefix = routePrefix; + return this; + } + + /** + * Get the community property: List of BGP communities which this criteria matches. + * + * @return the community value. + */ + public List community() { + return this.community; + } + + /** + * Set the community property: List of BGP communities which this criteria matches. + * + * @param community the community value to set. + * @return the Criterion object itself. + */ + public Criterion withCommunity(List community) { + this.community = community; + return this; + } + + /** + * Get the asPath property: List of AS paths which this criteria matches. + * + * @return the asPath value. + */ + public List asPath() { + return this.asPath; + } + + /** + * Set the asPath property: List of AS paths which this criteria matches. + * + * @param asPath the asPath value to set. + * @return the Criterion object itself. + */ + public Criterion withAsPath(List asPath) { + this.asPath = asPath; + return this; + } + + /** + * Get the matchCondition property: Match condition to apply RouteMap rules. + * + * @return the matchCondition value. + */ + public RouteMapMatchCondition matchCondition() { + return this.matchCondition; + } + + /** + * Set the matchCondition property: Match condition to apply RouteMap rules. + * + * @param matchCondition the matchCondition value to set. + * @return the Criterion object itself. + */ + public Criterion withMatchCondition(RouteMapMatchCondition matchCondition) { + this.matchCondition = matchCondition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routePrefix", this.routePrefix, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("community", this.community, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("asPath", this.asPath, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("matchCondition", + this.matchCondition == null ? null : this.matchCondition.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Criterion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Criterion if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Criterion. + */ + public static Criterion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Criterion deserializedCriterion = new Criterion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routePrefix".equals(fieldName)) { + List routePrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedCriterion.routePrefix = routePrefix; + } else if ("community".equals(fieldName)) { + List community = reader.readArray(reader1 -> reader1.getString()); + deserializedCriterion.community = community; + } else if ("asPath".equals(fieldName)) { + List asPath = reader.readArray(reader1 -> reader1.getString()); + deserializedCriterion.asPath = asPath; + } else if ("matchCondition".equals(fieldName)) { + deserializedCriterion.matchCondition = RouteMapMatchCondition.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCriterion; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CrossTenantScopes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CrossTenantScopes.java new file mode 100644 index 0000000000000..2eab333b2890e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CrossTenantScopes.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Cross tenant scopes. + */ +@Immutable +public final class CrossTenantScopes implements JsonSerializable { + /* + * Tenant ID. + */ + private String tenantId; + + /* + * List of management groups. + */ + private List managementGroups; + + /* + * List of subscriptions. + */ + private List subscriptions; + + /** + * Creates an instance of CrossTenantScopes class. + */ + public CrossTenantScopes() { + } + + /** + * Get the tenantId property: Tenant ID. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the managementGroups property: List of management groups. + * + * @return the managementGroups value. + */ + public List managementGroups() { + return this.managementGroups; + } + + /** + * Get the subscriptions property: List of subscriptions. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantScopes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantScopes if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the CrossTenantScopes. + */ + public static CrossTenantScopes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantScopes deserializedCrossTenantScopes = new CrossTenantScopes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedCrossTenantScopes.tenantId = reader.getString(); + } else if ("managementGroups".equals(fieldName)) { + List managementGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedCrossTenantScopes.managementGroups = managementGroups; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedCrossTenantScopes.subscriptions = subscriptions; + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantScopes; + }); + } +} 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..84ccbdcecb2db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomDnsConfigPropertiesFormat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Contains custom Dns resolution configuration from customer. + */ +@Fluent +public final class CustomDnsConfigPropertiesFormat implements JsonSerializable { + /* + * Fqdn that resolves to private endpoint ip address. + */ + private String fqdn; + + /* + * A list of private ip addresses of the private endpoint. + */ + private List ipAddresses; + + /** + * Creates an instance of CustomDnsConfigPropertiesFormat class. + */ + public CustomDnsConfigPropertiesFormat() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeArrayField("ipAddresses", this.ipAddresses, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDnsConfigPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDnsConfigPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomDnsConfigPropertiesFormat. + */ + public static CustomDnsConfigPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDnsConfigPropertiesFormat deserializedCustomDnsConfigPropertiesFormat + = new CustomDnsConfigPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fqdn".equals(fieldName)) { + deserializedCustomDnsConfigPropertiesFormat.fqdn = reader.getString(); + } else if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedCustomDnsConfigPropertiesFormat.ipAddresses = ipAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDnsConfigPropertiesFormat; + }); + } +} 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..42cffdfa45e70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefix.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the asn property: The ASN for CIDR advertising. Should be an integer as string. + * + * @return the asn value. + */ + String asn(); + + /** + * 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. + */ + SubResource 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 expressRouteAdvertise property: Whether to do express route advertise. + * + * @return the expressRouteAdvertise value. + */ + Boolean expressRouteAdvertise(); + + /** + * Gets the geo property: The Geo for CIDR advertising. Should be an Geo code. + * + * @return the geo value. + */ + Geo geo(); + + /** + * Gets the noInternetAdvertise property: Whether to Advertise the range to Internet. + * + * @return the noInternetAdvertise value. + */ + Boolean noInternetAdvertise(); + + /** + * Gets the prefixType property: Type of custom IP prefix. Should be Singular, Parent, or Child. + * + * @return the prefixType value. + */ + CustomIpPrefixType prefixType(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithAsn, DefinitionStages.WithCidr, DefinitionStages.WithSignedMessage, + DefinitionStages.WithAuthorizationMessage, DefinitionStages.WithCustomIpPrefixParent, + DefinitionStages.WithCommissionedState, DefinitionStages.WithExpressRouteAdvertise, + DefinitionStages.WithGeo, DefinitionStages.WithNoInternetAdvertise, DefinitionStages.WithPrefixType { + /** + * 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 asn. + */ + interface WithAsn { + /** + * Specifies the asn property: The ASN for CIDR advertising. Should be an integer as string.. + * + * @param asn The ASN for CIDR advertising. Should be an integer as string. + * @return the next definition stage. + */ + WithCreate withAsn(String asn); + } + + /** + * 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(SubResource 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); + } + + /** + * The stage of the CustomIpPrefix definition allowing to specify expressRouteAdvertise. + */ + interface WithExpressRouteAdvertise { + /** + * Specifies the expressRouteAdvertise property: Whether to do express route advertise.. + * + * @param expressRouteAdvertise Whether to do express route advertise. + * @return the next definition stage. + */ + WithCreate withExpressRouteAdvertise(Boolean expressRouteAdvertise); + } + + /** + * The stage of the CustomIpPrefix definition allowing to specify geo. + */ + interface WithGeo { + /** + * Specifies the geo property: The Geo for CIDR advertising. Should be an Geo code.. + * + * @param geo The Geo for CIDR advertising. Should be an Geo code. + * @return the next definition stage. + */ + WithCreate withGeo(Geo geo); + } + + /** + * The stage of the CustomIpPrefix definition allowing to specify noInternetAdvertise. + */ + interface WithNoInternetAdvertise { + /** + * Specifies the noInternetAdvertise property: Whether to Advertise the range to Internet.. + * + * @param noInternetAdvertise Whether to Advertise the range to Internet. + * @return the next definition stage. + */ + WithCreate withNoInternetAdvertise(Boolean noInternetAdvertise); + } + + /** + * The stage of the CustomIpPrefix definition allowing to specify prefixType. + */ + interface WithPrefixType { + /** + * Specifies the prefixType property: Type of custom IP prefix. Should be Singular, Parent, or Child.. + * + * @param prefixType Type of custom IP prefix. Should be Singular, Parent, or Child. + * @return the next definition stage. + */ + WithCreate withPrefixType(CustomIpPrefixType prefixType); + } + } + + /** + * 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..ef19ee35738cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.CustomIpPrefixInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListCustomIpPrefixes API service call. + */ +@Fluent +public final class CustomIpPrefixListResult implements JsonSerializable { + /* + * A list of Custom IP prefixes that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of CustomIpPrefixListResult class. + */ + public CustomIpPrefixListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomIpPrefixListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomIpPrefixListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CustomIpPrefixListResult. + */ + public static CustomIpPrefixListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomIpPrefixListResult deserializedCustomIpPrefixListResult = new CustomIpPrefixListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CustomIpPrefixInner.fromJson(reader1)); + deserializedCustomIpPrefixListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCustomIpPrefixListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomIpPrefixListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixType.java new file mode 100644 index 0000000000000..52d0069844b95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of custom IP prefix. Should be Singular, Parent, or Child. + */ +public final class CustomIpPrefixType extends ExpandableStringEnum { + /** + * Static value Singular for CustomIpPrefixType. + */ + public static final CustomIpPrefixType SINGULAR = fromString("Singular"); + + /** + * Static value Parent for CustomIpPrefixType. + */ + public static final CustomIpPrefixType PARENT = fromString("Parent"); + + /** + * Static value Child for CustomIpPrefixType. + */ + public static final CustomIpPrefixType CHILD = fromString("Child"); + + /** + * Creates a new instance of CustomIpPrefixType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomIpPrefixType() { + } + + /** + * Creates or finds a CustomIpPrefixType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomIpPrefixType. + */ + public static CustomIpPrefixType fromString(String name) { + return fromString(name, CustomIpPrefixType.class); + } + + /** + * Gets known CustomIpPrefixType values. + * + * @return known CustomIpPrefixType values. + */ + public static Collection values() { + return values(CustomIpPrefixType.class); + } +} 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..3b78f64d2628e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/CustomIpPrefixes.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String customIpPrefixName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..bdd2f72d3bd7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicies.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..52bc2211e8964 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosCustomPolicy.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.DdosCustomPolicyInner; +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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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 { + /** + * 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); + } + } + + /** + * 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/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..dee36a84cfa8d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlan.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.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 publicIpAddresses property: The list of public IPs associated with the DDoS protection plan resource. + * This list is read-only. + * + * @return the publicIpAddresses value. + */ + List publicIpAddresses(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..818e2a6626fe7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlanListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.DdosProtectionPlanInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of DDoS protection plans. + */ +@Fluent +public final class DdosProtectionPlanListResult implements JsonSerializable { + /* + * A list of DDoS protection plans. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of DdosProtectionPlanListResult class. + */ + public DdosProtectionPlanListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DdosProtectionPlanListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DdosProtectionPlanListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DdosProtectionPlanListResult. + */ + public static DdosProtectionPlanListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DdosProtectionPlanListResult deserializedDdosProtectionPlanListResult = new DdosProtectionPlanListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DdosProtectionPlanInner.fromJson(reader1)); + deserializedDdosProtectionPlanListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDdosProtectionPlanListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDdosProtectionPlanListResult; + }); + } +} 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..1bb5e342ca06f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosProtectionPlans.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..19135a9c427a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettings.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains the DDoS protection settings of the public IP. + */ +@Fluent +public final class DdosSettings implements JsonSerializable { + /* + * The DDoS protection mode of the public IP + */ + private DdosSettingsProtectionMode protectionMode; + + /* + * The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled + */ + private SubResource ddosProtectionPlan; + + /** + * Creates an instance of DdosSettings class. + */ + public DdosSettings() { + } + + /** + * Get the protectionMode property: The DDoS protection mode of the public IP. + * + * @return the protectionMode value. + */ + public DdosSettingsProtectionMode protectionMode() { + return this.protectionMode; + } + + /** + * Set the protectionMode property: The DDoS protection mode of the public IP. + * + * @param protectionMode the protectionMode value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withProtectionMode(DdosSettingsProtectionMode protectionMode) { + this.protectionMode = protectionMode; + return this; + } + + /** + * Get the ddosProtectionPlan property: The DDoS protection plan associated with the public IP. Can only be set if + * ProtectionMode is Enabled. + * + * @return the ddosProtectionPlan value. + */ + public SubResource ddosProtectionPlan() { + return this.ddosProtectionPlan; + } + + /** + * Set the ddosProtectionPlan property: The DDoS protection plan associated with the public IP. Can only be set if + * ProtectionMode is Enabled. + * + * @param ddosProtectionPlan the ddosProtectionPlan value to set. + * @return the DdosSettings object itself. + */ + public DdosSettings withDdosProtectionPlan(SubResource ddosProtectionPlan) { + this.ddosProtectionPlan = ddosProtectionPlan; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protectionMode", + this.protectionMode == null ? null : this.protectionMode.toString()); + jsonWriter.writeJsonField("ddosProtectionPlan", this.ddosProtectionPlan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DdosSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DdosSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DdosSettings. + */ + public static DdosSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DdosSettings deserializedDdosSettings = new DdosSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protectionMode".equals(fieldName)) { + deserializedDdosSettings.protectionMode = DdosSettingsProtectionMode.fromString(reader.getString()); + } else if ("ddosProtectionPlan".equals(fieldName)) { + deserializedDdosSettings.ddosProtectionPlan = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDdosSettings; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionMode.java new file mode 100644 index 0000000000000..d33b9e8a68e1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DdosSettingsProtectionMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The DDoS protection mode of the public IP. + */ +public final class DdosSettingsProtectionMode extends ExpandableStringEnum { + /** + * Static value VirtualNetworkInherited for DdosSettingsProtectionMode. + */ + public static final DdosSettingsProtectionMode VIRTUAL_NETWORK_INHERITED = fromString("VirtualNetworkInherited"); + + /** + * Static value Enabled for DdosSettingsProtectionMode. + */ + public static final DdosSettingsProtectionMode ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for DdosSettingsProtectionMode. + */ + public static final DdosSettingsProtectionMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of DdosSettingsProtectionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DdosSettingsProtectionMode() { + } + + /** + * Creates or finds a DdosSettingsProtectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DdosSettingsProtectionMode. + */ + public static DdosSettingsProtectionMode fromString(String name) { + return fromString(name, DdosSettingsProtectionMode.class); + } + + /** + * Gets known DdosSettingsProtectionMode values. + * + * @return known DdosSettingsProtectionMode values. + */ + public static Collection values() { + return values(DdosSettingsProtectionMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultAdminRule.java new file mode 100644 index 0000000000000..3fa719005c119 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultAdminRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BaseAdminRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.DefaultAdminPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Network default admin rule. + */ +@Fluent +public final class DefaultAdminRule extends BaseAdminRuleInner { + /* + * Whether the rule is custom or default. + */ + private AdminRuleKind kind = AdminRuleKind.DEFAULT; + + /* + * Indicates the properties of the security admin rule + */ + private DefaultAdminPropertiesFormat innerProperties; + + /* + * The system metadata related to this resource. + */ + private SystemData systemData; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DefaultAdminRule class. + */ + public DefaultAdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + @Override + public AdminRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Indicates the properties of the security admin rule. + * + * @return the innerProperties value. + */ + private DefaultAdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the flag property: Default rule flag. + * + * @return the flag value. + */ + public String flag() { + return this.innerProperties() == null ? null : this.innerProperties().flag(); + } + + /** + * Set the flag property: Default rule flag. + * + * @param flag the flag value to set. + * @return the DefaultAdminRule object itself. + */ + public DefaultAdminRule withFlag(String flag) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultAdminPropertiesFormat(); + } + this.innerProperties().withFlag(flag); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.innerProperties() == null ? null : this.innerProperties().sources(); + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.innerProperties() == null ? null : this.innerProperties().destinations(); + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.innerProperties() == null ? null : this.innerProperties().access(); + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.innerProperties() == null ? null : this.innerProperties().direction(); + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DefaultAdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DefaultAdminRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DefaultAdminRule. + */ + public static DefaultAdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DefaultAdminRule deserializedDefaultAdminRule = new DefaultAdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDefaultAdminRule.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDefaultAdminRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDefaultAdminRule.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedDefaultAdminRule.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedDefaultAdminRule.systemData = SystemData.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedDefaultAdminRule.kind = AdminRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedDefaultAdminRule.innerProperties = DefaultAdminPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDefaultAdminRule; + }); + } +} 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..c158b0056d8b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DefaultSecurityRules.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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkSecurityGroupName, + String defaultSecurityRuleName, 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); +} 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..b807fa60bacbc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Delegation.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceDelegationPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Details the service to which the subnet is delegated. + */ +@Fluent +public final class Delegation extends SubResource { + /* + * Properties of the subnet. + */ + private ServiceDelegationPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a subnet. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of Delegation class. + */ + public Delegation() { + } + + /** + * Get the innerProperties property: Properties of the subnet. + * + * @return the innerProperties value. + */ + private ServiceDelegationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public Delegation withId(String id) { + super.withId(id); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceDelegationPropertiesFormat(); + } + this.innerProperties().withServiceName(serviceName); + return this; + } + + /** + * Get the actions property: The actions permitted to the service upon delegation. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Get the provisioningState property: The provisioning state of the service delegation resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Delegation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Delegation if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Delegation. + */ + public static Delegation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Delegation deserializedDelegation = new Delegation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDelegation.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedDelegation.innerProperties = ServiceDelegationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedDelegation.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedDelegation.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDelegation.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDelegation; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DelegationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DelegationProperties.java new file mode 100644 index 0000000000000..31b7c7ee76a16 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DelegationProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the delegation. + */ +@Fluent +public final class DelegationProperties implements JsonSerializable { + /* + * The service name to which the NVA is delegated. + */ + private String serviceName; + + /* + * The current provisioning state. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of DelegationProperties class. + */ + public DelegationProperties() { + } + + /** + * Get the serviceName property: The service name to which the NVA is delegated. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: The service name to which the NVA is delegated. + * + * @param serviceName the serviceName value to set. + * @return the DelegationProperties object itself. + */ + public DelegationProperties withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceName", this.serviceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DelegationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DelegationProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DelegationProperties. + */ + public static DelegationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DelegationProperties deserializedDelegationProperties = new DelegationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedDelegationProperties.serviceName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedDelegationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDelegationProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteExistingPeering.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteExistingPeering.java new file mode 100644 index 0000000000000..e8ad95b6e675b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteExistingPeering.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Flag if need to remove current existing peerings. + */ +public final class DeleteExistingPeering extends ExpandableStringEnum { + /** + * Static value False for DeleteExistingPeering. + */ + public static final DeleteExistingPeering FALSE = fromString("False"); + + /** + * Static value True for DeleteExistingPeering. + */ + public static final DeleteExistingPeering TRUE = fromString("True"); + + /** + * Creates a new instance of DeleteExistingPeering value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteExistingPeering() { + } + + /** + * Creates or finds a DeleteExistingPeering from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteExistingPeering. + */ + public static DeleteExistingPeering fromString(String name) { + return fromString(name, DeleteExistingPeering.class); + } + + /** + * Gets known DeleteExistingPeering values. + * + * @return known DeleteExistingPeering values. + */ + public static Collection values() { + return values(DeleteExistingPeering.class); + } +} 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..d2fa24c490c10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeleteOptions.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specify what happens to the public IP address when the VM using it is deleted. + */ +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 a new instance of DeleteOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeleteOptions() { + } + + /** + * Creates or finds a DeleteOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeleteOptions. + */ + public static DeleteOptions fromString(String name) { + return fromString(name, DeleteOptions.class); + } + + /** + * Gets known DeleteOptions values. + * + * @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/DeploymentStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeploymentStatus.java new file mode 100644 index 0000000000000..91781cf381d09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeploymentStatus.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 java.util.Collection; + +/** + * Deployment Status. + */ +public final class DeploymentStatus extends ExpandableStringEnum { + /** + * Static value NotStarted for DeploymentStatus. + */ + public static final DeploymentStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Static value Deploying for DeploymentStatus. + */ + public static final DeploymentStatus DEPLOYING = fromString("Deploying"); + + /** + * Static value Deployed for DeploymentStatus. + */ + public static final DeploymentStatus DEPLOYED = fromString("Deployed"); + + /** + * Static value Failed for DeploymentStatus. + */ + public static final DeploymentStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of DeploymentStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentStatus() { + } + + /** + * Creates or finds a DeploymentStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentStatus. + */ + public static DeploymentStatus fromString(String name) { + return fromString(name, DeploymentStatus.class); + } + + /** + * Gets known DeploymentStatus values. + * + * @return known DeploymentStatus values. + */ + public static Collection values() { + return values(DeploymentStatus.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..f7936512f3b0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DestinationPortBehavior.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Destination port behavior. + */ +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 a new instance of DestinationPortBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DestinationPortBehavior() { + } + + /** + * Creates or finds a DestinationPortBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding DestinationPortBehavior. + */ + public static DestinationPortBehavior fromString(String name) { + return fromString(name, DestinationPortBehavior.class); + } + + /** + * Gets known DestinationPortBehavior values. + * + * @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..e3f182593e984 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DeviceProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * List of properties of the device. + */ +@Fluent +public final class DeviceProperties implements JsonSerializable { + /* + * Name of the device Vendor. + */ + private String deviceVendor; + + /* + * Model of the device. + */ + private String deviceModel; + + /* + * Link speed. + */ + private Integer linkSpeedInMbps; + + /** + * Creates an instance of DeviceProperties class. + */ + public DeviceProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceVendor", this.deviceVendor); + jsonWriter.writeStringField("deviceModel", this.deviceModel); + jsonWriter.writeNumberField("linkSpeedInMbps", this.linkSpeedInMbps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeviceProperties. + */ + public static DeviceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeviceProperties deserializedDeviceProperties = new DeviceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceVendor".equals(fieldName)) { + deserializedDeviceProperties.deviceVendor = reader.getString(); + } else if ("deviceModel".equals(fieldName)) { + deserializedDeviceProperties.deviceModel = reader.getString(); + } else if ("linkSpeedInMbps".equals(fieldName)) { + deserializedDeviceProperties.linkSpeedInMbps = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDeviceProperties; + }); + } +} 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..308a9cac5c190 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhGroup.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The DH Groups used in IKE Phase 1 for initial SA. + */ +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 a new instance of DhGroup value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DhGroup() { + } + + /** + * Creates or finds a DhGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding DhGroup. + */ + public static DhGroup fromString(String name) { + return fromString(name, DhGroup.class); + } + + /** + * Gets known DhGroup values. + * + * @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..a5441748c321d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DhcpOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The list of DNS servers IP addresses. + */ + private List dnsServers; + + /** + * Creates an instance of DhcpOptions class. + */ + public DhcpOptions() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DhcpOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DhcpOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DhcpOptions. + */ + public static DhcpOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DhcpOptions deserializedDhcpOptions = new DhcpOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedDhcpOptions.dnsServers = dnsServers; + } else { + reader.skipChildren(); + } + } + + return deserializedDhcpOptions; + }); + } +} 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..7e80389281ee3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Dimension.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dimension of the metric. + */ +@Fluent +public final class Dimension implements JsonSerializable { + /* + * The name of the dimension. + */ + private String name; + + /* + * The display name of the dimension. + */ + private String displayName; + + /* + * The internal name of the dimension. + */ + private String internalName; + + /** + * Creates an instance of Dimension class. + */ + public Dimension() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("internalName", this.internalName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dimension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dimension if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Dimension. + */ + public static Dimension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dimension deserializedDimension = new Dimension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimension.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDimension.displayName = reader.getString(); + } else if ("internalName".equals(fieldName)) { + deserializedDimension.internalName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimension; + }); + } +} 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..bd9d95ed48093 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Direction.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The direction of the traffic. + */ +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 a new instance of Direction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Direction() { + } + + /** + * Creates or finds a Direction from its string representation. + * + * @param name a name to look for. + * @return the corresponding Direction. + */ + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** + * Gets known Direction values. + * + * @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/DisableBgpRoutePropagation.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DisableBgpRoutePropagation.java new file mode 100644 index 0000000000000..832661e0f9f35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DisableBgpRoutePropagation.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Determines whether BGP route propagation is enabled. Defaults to true. + */ +public final class DisableBgpRoutePropagation extends ExpandableStringEnum { + /** + * Static value False for DisableBgpRoutePropagation. + */ + public static final DisableBgpRoutePropagation FALSE = fromString("False"); + + /** + * Static value True for DisableBgpRoutePropagation. + */ + public static final DisableBgpRoutePropagation TRUE = fromString("True"); + + /** + * Creates a new instance of DisableBgpRoutePropagation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DisableBgpRoutePropagation() { + } + + /** + * Creates or finds a DisableBgpRoutePropagation from its string representation. + * + * @param name a name to look for. + * @return the corresponding DisableBgpRoutePropagation. + */ + public static DisableBgpRoutePropagation fromString(String name) { + return fromString(name, DisableBgpRoutePropagation.class); + } + + /** + * Gets known DisableBgpRoutePropagation values. + * + * @return known DisableBgpRoutePropagation values. + */ + public static Collection values() { + return values(DisableBgpRoutePropagation.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..3cc653e45a8e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsNameAvailabilityResult.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.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..dabd52c2319cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DnsSettings.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * DNS Proxy Settings in Firewall Policy. + */ +@Fluent +public final class DnsSettings implements JsonSerializable { + /* + * List of Custom DNS Servers. + */ + private List servers; + + /* + * Enable DNS Proxy on Firewalls attached to the Firewall Policy. + */ + private Boolean enableProxy; + + /* + * FQDNs in Network Rules are supported when set to true. + */ + private Boolean requireProxyForNetworkRules; + + /** + * Creates an instance of DnsSettings class. + */ + public DnsSettings() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("servers", this.servers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableProxy", this.enableProxy); + jsonWriter.writeBooleanField("requireProxyForNetworkRules", this.requireProxyForNetworkRules); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DnsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DnsSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DnsSettings. + */ + public static DnsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DnsSettings deserializedDnsSettings = new DnsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("servers".equals(fieldName)) { + List servers = reader.readArray(reader1 -> reader1.getString()); + deserializedDnsSettings.servers = servers; + } else if ("enableProxy".equals(fieldName)) { + deserializedDnsSettings.enableProxy = reader.getNullable(JsonReader::getBoolean); + } else if ("requireProxyForNetworkRules".equals(fieldName)) { + deserializedDnsSettings.requireProxyForNetworkRules = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDnsSettings; + }); + } +} 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..25478bf3e012b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfiguration.java @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 qosDefinitionCollection property: QoS object definitions. + * + * @return the qosDefinitionCollection value. + */ + List qosDefinitionCollection(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, DefinitionStages.WithQosDefinitionCollection { + /** + * 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); + } + + /** + * The stage of the DscpConfiguration definition allowing to specify qosDefinitionCollection. + */ + interface WithQosDefinitionCollection { + /** + * Specifies the qosDefinitionCollection property: QoS object definitions. + * + * @param qosDefinitionCollection QoS object definitions. + * @return the next definition stage. + */ + WithCreate withQosDefinitionCollection(List qosDefinitionCollection); + } + } + + /** + * 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, UpdateStages.WithQosDefinitionCollection { + /** + * 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); + } + + /** + * The stage of the DscpConfiguration update allowing to specify qosDefinitionCollection. + */ + interface WithQosDefinitionCollection { + /** + * Specifies the qosDefinitionCollection property: QoS object definitions. + * + * @param qosDefinitionCollection QoS object definitions. + * @return the next definition stage. + */ + Update withQosDefinitionCollection(List qosDefinitionCollection); + } + } + + /** + * 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..41fb9c1bb621b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.DscpConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the DscpConfigurationList API service call. + */ +@Fluent +public final class DscpConfigurationListResult implements JsonSerializable { + /* + * A list of dscp configurations in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of DscpConfigurationListResult class. + */ + public DscpConfigurationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DscpConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DscpConfigurationListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DscpConfigurationListResult. + */ + public static DscpConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DscpConfigurationListResult deserializedDscpConfigurationListResult = new DscpConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DscpConfigurationInner.fromJson(reader1)); + deserializedDscpConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDscpConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDscpConfigurationListResult; + }); + } +} 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..0d4b894de2133 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/DscpConfigurations.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/EffectiveAdminRuleKind.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveAdminRuleKind.java new file mode 100644 index 0000000000000..052a66f4e67ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveAdminRuleKind.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether the rule is custom or default. + */ +public final class EffectiveAdminRuleKind extends ExpandableStringEnum { + /** + * Static value Custom for EffectiveAdminRuleKind. + */ + public static final EffectiveAdminRuleKind CUSTOM = fromString("Custom"); + + /** + * Static value Default for EffectiveAdminRuleKind. + */ + public static final EffectiveAdminRuleKind DEFAULT = fromString("Default"); + + /** + * Creates a new instance of EffectiveAdminRuleKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EffectiveAdminRuleKind() { + } + + /** + * Creates or finds a EffectiveAdminRuleKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveAdminRuleKind. + */ + public static EffectiveAdminRuleKind fromString(String name) { + return fromString(name, EffectiveAdminRuleKind.class); + } + + /** + * Gets known EffectiveAdminRuleKind values. + * + * @return known EffectiveAdminRuleKind values. + */ + public static Collection values() { + return values(EffectiveAdminRuleKind.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveBaseSecurityAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveBaseSecurityAdminRule.java new file mode 100644 index 0000000000000..f65fb8e0c43a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveBaseSecurityAdminRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network base admin rule. + */ +@Fluent +public class EffectiveBaseSecurityAdminRule implements JsonSerializable { + /* + * Whether the rule is custom or default. + */ + private EffectiveAdminRuleKind kind = EffectiveAdminRuleKind.fromString("EffectiveBaseSecurityAdminRule"); + + /* + * Resource ID. + */ + private String id; + + /* + * A description of the security admin configuration. + */ + private String configurationDescription; + + /* + * A description of the rule collection. + */ + private String ruleCollectionDescription; + + /* + * Groups for rule collection + */ + private List ruleCollectionAppliesToGroups; + + /* + * Effective configuration groups. + */ + private List ruleGroups; + + /** + * Creates an instance of EffectiveBaseSecurityAdminRule class. + */ + public EffectiveBaseSecurityAdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + public EffectiveAdminRuleKind kind() { + return this.kind; + } + + /** + * 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 EffectiveBaseSecurityAdminRule object itself. + */ + public EffectiveBaseSecurityAdminRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get the configurationDescription property: A description of the security admin configuration. + * + * @return the configurationDescription value. + */ + public String configurationDescription() { + return this.configurationDescription; + } + + /** + * Set the configurationDescription property: A description of the security admin configuration. + * + * @param configurationDescription the configurationDescription value to set. + * @return the EffectiveBaseSecurityAdminRule object itself. + */ + public EffectiveBaseSecurityAdminRule withConfigurationDescription(String configurationDescription) { + this.configurationDescription = configurationDescription; + return this; + } + + /** + * Get the ruleCollectionDescription property: A description of the rule collection. + * + * @return the ruleCollectionDescription value. + */ + public String ruleCollectionDescription() { + return this.ruleCollectionDescription; + } + + /** + * Set the ruleCollectionDescription property: A description of the rule collection. + * + * @param ruleCollectionDescription the ruleCollectionDescription value to set. + * @return the EffectiveBaseSecurityAdminRule object itself. + */ + public EffectiveBaseSecurityAdminRule withRuleCollectionDescription(String ruleCollectionDescription) { + this.ruleCollectionDescription = ruleCollectionDescription; + return this; + } + + /** + * Get the ruleCollectionAppliesToGroups property: Groups for rule collection. + * + * @return the ruleCollectionAppliesToGroups value. + */ + public List ruleCollectionAppliesToGroups() { + return this.ruleCollectionAppliesToGroups; + } + + /** + * Set the ruleCollectionAppliesToGroups property: Groups for rule collection. + * + * @param ruleCollectionAppliesToGroups the ruleCollectionAppliesToGroups value to set. + * @return the EffectiveBaseSecurityAdminRule object itself. + */ + public EffectiveBaseSecurityAdminRule + withRuleCollectionAppliesToGroups(List ruleCollectionAppliesToGroups) { + this.ruleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + return this; + } + + /** + * Get the ruleGroups property: Effective configuration groups. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the ruleGroups property: Effective configuration groups. + * + * @param ruleGroups the ruleGroups value to set. + * @return the EffectiveBaseSecurityAdminRule object itself. + */ + public EffectiveBaseSecurityAdminRule withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleCollectionAppliesToGroups() != null) { + ruleCollectionAppliesToGroups().forEach(e -> e.validate()); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("configurationDescription", this.configurationDescription); + jsonWriter.writeStringField("ruleCollectionDescription", this.ruleCollectionDescription); + jsonWriter.writeArrayField("ruleCollectionAppliesToGroups", this.ruleCollectionAppliesToGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ruleGroups", this.ruleGroups, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveBaseSecurityAdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveBaseSecurityAdminRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveBaseSecurityAdminRule. + */ + public static EffectiveBaseSecurityAdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Custom".equals(discriminatorValue)) { + return EffectiveSecurityAdminRule.fromJson(readerToUse.reset()); + } else if ("Default".equals(discriminatorValue)) { + return EffectiveDefaultSecurityAdminRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static EffectiveBaseSecurityAdminRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveBaseSecurityAdminRule deserializedEffectiveBaseSecurityAdminRule + = new EffectiveBaseSecurityAdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedEffectiveBaseSecurityAdminRule.kind + = EffectiveAdminRuleKind.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + deserializedEffectiveBaseSecurityAdminRule.id = reader.getString(); + } else if ("configurationDescription".equals(fieldName)) { + deserializedEffectiveBaseSecurityAdminRule.configurationDescription = reader.getString(); + } else if ("ruleCollectionDescription".equals(fieldName)) { + deserializedEffectiveBaseSecurityAdminRule.ruleCollectionDescription = reader.getString(); + } else if ("ruleCollectionAppliesToGroups".equals(fieldName)) { + List ruleCollectionAppliesToGroups + = reader.readArray(reader1 -> NetworkManagerSecurityGroupItem.fromJson(reader1)); + deserializedEffectiveBaseSecurityAdminRule.ruleCollectionAppliesToGroups + = ruleCollectionAppliesToGroups; + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedEffectiveBaseSecurityAdminRule.ruleGroups = ruleGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveBaseSecurityAdminRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveConnectivityConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveConnectivityConfiguration.java new file mode 100644 index 0000000000000..7dd2e1bca003f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveConnectivityConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ConnectivityConfigurationProperties; +import java.io.IOException; +import java.util.List; + +/** + * The network manager effective connectivity configuration. + */ +@Fluent +public class EffectiveConnectivityConfiguration implements JsonSerializable { + /* + * Connectivity configuration ID. + */ + private String id; + + /* + * Properties of a network manager connectivity configuration + */ + private ConnectivityConfigurationProperties innerProperties; + + /* + * Effective configuration groups. + */ + private List configurationGroups; + + /** + * Creates an instance of EffectiveConnectivityConfiguration class. + */ + public EffectiveConnectivityConfiguration() { + } + + /** + * Get the id property: Connectivity configuration ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Connectivity configuration ID. + * + * @param id the id value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the innerProperties property: Properties of a network manager connectivity configuration. + * + * @return the innerProperties value. + */ + private ConnectivityConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Set the innerProperties property: Properties of a network manager connectivity configuration. + * + * @param innerProperties the innerProperties value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + EffectiveConnectivityConfiguration withInnerProperties(ConnectivityConfigurationProperties innerProperties) { + this.innerProperties = innerProperties; + return this; + } + + /** + * Get the configurationGroups property: Effective configuration groups. + * + * @return the configurationGroups value. + */ + public List configurationGroups() { + return this.configurationGroups; + } + + /** + * Set the configurationGroups property: Effective configuration groups. + * + * @param configurationGroups the configurationGroups value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withConfigurationGroups(List configurationGroups) { + this.configurationGroups = configurationGroups; + return this; + } + + /** + * Get the description property: A description of the connectivity configuration. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description of the connectivity configuration. + * + * @param description the description value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the connectivityTopology property: Connectivity topology type. + * + * @return the connectivityTopology value. + */ + public ConnectivityTopology connectivityTopology() { + return this.innerProperties() == null ? null : this.innerProperties().connectivityTopology(); + } + + /** + * Set the connectivityTopology property: Connectivity topology type. + * + * @param connectivityTopology the connectivityTopology value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withConnectivityTopology(ConnectivityTopology connectivityTopology) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withConnectivityTopology(connectivityTopology); + return this; + } + + /** + * Get the hubs property: List of hubItems. + * + * @return the hubs value. + */ + public List hubs() { + return this.innerProperties() == null ? null : this.innerProperties().hubs(); + } + + /** + * Set the hubs property: List of hubItems. + * + * @param hubs the hubs value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withHubs(List hubs) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withHubs(hubs); + return this; + } + + /** + * Get the isGlobal property: Flag if global mesh is supported. + * + * @return the isGlobal value. + */ + public IsGlobal isGlobal() { + return this.innerProperties() == null ? null : this.innerProperties().isGlobal(); + } + + /** + * Set the isGlobal property: Flag if global mesh is supported. + * + * @param isGlobal the isGlobal value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withIsGlobal(IsGlobal isGlobal) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withIsGlobal(isGlobal); + return this; + } + + /** + * Get the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + public List appliesToGroups() { + return this.innerProperties() == null ? null : this.innerProperties().appliesToGroups(); + } + + /** + * Set the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups the appliesToGroups value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withAppliesToGroups(List appliesToGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withAppliesToGroups(appliesToGroups); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the connectivity configuration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @return the deleteExistingPeering value. + */ + public DeleteExistingPeering deleteExistingPeering() { + return this.innerProperties() == null ? null : this.innerProperties().deleteExistingPeering(); + } + + /** + * Set the deleteExistingPeering property: Flag if need to remove current existing peerings. + * + * @param deleteExistingPeering the deleteExistingPeering value to set. + * @return the EffectiveConnectivityConfiguration object itself. + */ + public EffectiveConnectivityConfiguration withDeleteExistingPeering(DeleteExistingPeering deleteExistingPeering) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectivityConfigurationProperties(); + } + this.innerProperties().withDeleteExistingPeering(deleteExistingPeering); + return this; + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (configurationGroups() != null) { + configurationGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeArrayField("configurationGroups", this.configurationGroups, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveConnectivityConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveConnectivityConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveConnectivityConfiguration. + */ + public static EffectiveConnectivityConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveConnectivityConfiguration deserializedEffectiveConnectivityConfiguration + = new EffectiveConnectivityConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEffectiveConnectivityConfiguration.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEffectiveConnectivityConfiguration.innerProperties + = ConnectivityConfigurationProperties.fromJson(reader); + } else if ("configurationGroups".equals(fieldName)) { + List configurationGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedEffectiveConnectivityConfiguration.configurationGroups = configurationGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveConnectivityConfiguration; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveDefaultSecurityAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveDefaultSecurityAdminRule.java new file mode 100644 index 0000000000000..6789a997dbb08 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveDefaultSecurityAdminRule.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.DefaultAdminPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Network default admin rule. + */ +@Fluent +public final class EffectiveDefaultSecurityAdminRule extends EffectiveBaseSecurityAdminRule { + /* + * Whether the rule is custom or default. + */ + private EffectiveAdminRuleKind kind = EffectiveAdminRuleKind.DEFAULT; + + /* + * Indicates the properties of the default security admin rule + */ + private DefaultAdminPropertiesFormat innerProperties; + + /** + * Creates an instance of EffectiveDefaultSecurityAdminRule class. + */ + public EffectiveDefaultSecurityAdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + @Override + public EffectiveAdminRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Indicates the properties of the default security admin rule. + * + * @return the innerProperties value. + */ + private DefaultAdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveDefaultSecurityAdminRule withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveDefaultSecurityAdminRule withConfigurationDescription(String configurationDescription) { + super.withConfigurationDescription(configurationDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveDefaultSecurityAdminRule withRuleCollectionDescription(String ruleCollectionDescription) { + super.withRuleCollectionDescription(ruleCollectionDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveDefaultSecurityAdminRule + withRuleCollectionAppliesToGroups(List ruleCollectionAppliesToGroups) { + super.withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveDefaultSecurityAdminRule withRuleGroups(List ruleGroups) { + super.withRuleGroups(ruleGroups); + return this; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Get the flag property: Default rule flag. + * + * @return the flag value. + */ + public String flag() { + return this.innerProperties() == null ? null : this.innerProperties().flag(); + } + + /** + * Set the flag property: Default rule flag. + * + * @param flag the flag value to set. + * @return the EffectiveDefaultSecurityAdminRule object itself. + */ + public EffectiveDefaultSecurityAdminRule withFlag(String flag) { + if (this.innerProperties() == null) { + this.innerProperties = new DefaultAdminPropertiesFormat(); + } + this.innerProperties().withFlag(flag); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.innerProperties() == null ? null : this.innerProperties().sources(); + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.innerProperties() == null ? null : this.innerProperties().destinations(); + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.innerProperties() == null ? null : this.innerProperties().access(); + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.innerProperties() == null ? null : this.innerProperties().direction(); + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (ruleCollectionAppliesToGroups() != null) { + ruleCollectionAppliesToGroups().forEach(e -> e.validate()); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("configurationDescription", configurationDescription()); + jsonWriter.writeStringField("ruleCollectionDescription", ruleCollectionDescription()); + jsonWriter.writeArrayField("ruleCollectionAppliesToGroups", ruleCollectionAppliesToGroups(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ruleGroups", ruleGroups(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveDefaultSecurityAdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveDefaultSecurityAdminRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveDefaultSecurityAdminRule. + */ + public static EffectiveDefaultSecurityAdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveDefaultSecurityAdminRule deserializedEffectiveDefaultSecurityAdminRule + = new EffectiveDefaultSecurityAdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEffectiveDefaultSecurityAdminRule.withId(reader.getString()); + } else if ("configurationDescription".equals(fieldName)) { + deserializedEffectiveDefaultSecurityAdminRule.withConfigurationDescription(reader.getString()); + } else if ("ruleCollectionDescription".equals(fieldName)) { + deserializedEffectiveDefaultSecurityAdminRule.withRuleCollectionDescription(reader.getString()); + } else if ("ruleCollectionAppliesToGroups".equals(fieldName)) { + List ruleCollectionAppliesToGroups + = reader.readArray(reader1 -> NetworkManagerSecurityGroupItem.fromJson(reader1)); + deserializedEffectiveDefaultSecurityAdminRule + .withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedEffectiveDefaultSecurityAdminRule.withRuleGroups(ruleGroups); + } else if ("kind".equals(fieldName)) { + deserializedEffectiveDefaultSecurityAdminRule.kind + = EffectiveAdminRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedEffectiveDefaultSecurityAdminRule.innerProperties + = DefaultAdminPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveDefaultSecurityAdminRule; + }); + } +} 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..3d2ef819858e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroup.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Effective network security group. + */ +@Fluent +public final class EffectiveNetworkSecurityGroup implements JsonSerializable { + /* + * The ID of network security group that is applied. + */ + private SubResource networkSecurityGroup; + + /* + * Associated resources. + */ + private EffectiveNetworkSecurityGroupAssociation association; + + /* + * A collection of effective security rules. + */ + private List effectiveSecurityRules; + + /* + * Mapping of tags to list of IP Addresses included within the tag. + */ + private String tagMap; + + /** + * Creates an instance of EffectiveNetworkSecurityGroup class. + */ + public EffectiveNetworkSecurityGroup() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkSecurityGroup", this.networkSecurityGroup); + jsonWriter.writeJsonField("association", this.association); + jsonWriter.writeArrayField("effectiveSecurityRules", this.effectiveSecurityRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("tagMap", this.tagMap); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveNetworkSecurityGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveNetworkSecurityGroup if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveNetworkSecurityGroup. + */ + public static EffectiveNetworkSecurityGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveNetworkSecurityGroup deserializedEffectiveNetworkSecurityGroup + = new EffectiveNetworkSecurityGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkSecurityGroup".equals(fieldName)) { + deserializedEffectiveNetworkSecurityGroup.networkSecurityGroup = SubResource.fromJson(reader); + } else if ("association".equals(fieldName)) { + deserializedEffectiveNetworkSecurityGroup.association + = EffectiveNetworkSecurityGroupAssociation.fromJson(reader); + } else if ("effectiveSecurityRules".equals(fieldName)) { + List effectiveSecurityRules + = reader.readArray(reader1 -> EffectiveNetworkSecurityRule.fromJson(reader1)); + deserializedEffectiveNetworkSecurityGroup.effectiveSecurityRules = effectiveSecurityRules; + } else if ("tagMap".equals(fieldName)) { + deserializedEffectiveNetworkSecurityGroup.tagMap = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveNetworkSecurityGroup; + }); + } +} 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..4b87906549597 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupAssociation.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The effective network security group association. + */ +@Fluent +public final class EffectiveNetworkSecurityGroupAssociation + implements JsonSerializable { + /* + * The ID of the Azure network manager if assigned. + */ + private SubResource networkManager; + + /* + * The ID of the subnet if assigned. + */ + private SubResource subnet; + + /* + * The ID of the network interface if assigned. + */ + private SubResource networkInterface; + + /** + * Creates an instance of EffectiveNetworkSecurityGroupAssociation class. + */ + public EffectiveNetworkSecurityGroupAssociation() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkManager", this.networkManager); + jsonWriter.writeJsonField("subnet", this.subnet); + jsonWriter.writeJsonField("networkInterface", this.networkInterface); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveNetworkSecurityGroupAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveNetworkSecurityGroupAssociation if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveNetworkSecurityGroupAssociation. + */ + public static EffectiveNetworkSecurityGroupAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveNetworkSecurityGroupAssociation deserializedEffectiveNetworkSecurityGroupAssociation + = new EffectiveNetworkSecurityGroupAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkManager".equals(fieldName)) { + deserializedEffectiveNetworkSecurityGroupAssociation.networkManager = SubResource.fromJson(reader); + } else if ("subnet".equals(fieldName)) { + deserializedEffectiveNetworkSecurityGroupAssociation.subnet = SubResource.fromJson(reader); + } else if ("networkInterface".equals(fieldName)) { + deserializedEffectiveNetworkSecurityGroupAssociation.networkInterface + = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveNetworkSecurityGroupAssociation; + }); + } +} 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..820bdc1317a71 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityGroupListResult.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.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..340c010f92d20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveNetworkSecurityRule.java @@ -0,0 +1,514 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Effective network security rules. + */ +@Fluent +public final class EffectiveNetworkSecurityRule implements JsonSerializable { + /* + * The name of the security rule specified by the user (if created by the user). + */ + private String name; + + /* + * The network protocol this rule applies to. + */ + private EffectiveSecurityRuleProtocol protocol; + + /* + * The source port or range. + */ + private String sourcePortRange; + + /* + * The destination port or range. + */ + 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 (*). + */ + 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 (*). + */ + private List destinationPortRanges; + + /* + * The source address prefix. + */ + private String sourceAddressPrefix; + + /* + * The destination address prefix. + */ + private String destinationAddressPrefix; + + /* + * The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + * AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + */ + private List sourceAddressPrefixes; + + /* + * The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, + * AzureLoadBalancer, Internet), System Tags, and the asterisk (*). + */ + private List destinationAddressPrefixes; + + /* + * The expanded source address prefix. + */ + private List expandedSourceAddressPrefix; + + /* + * Expanded destination address prefix. + */ + private List expandedDestinationAddressPrefix; + + /* + * Whether network traffic is allowed or denied. + */ + private SecurityRuleAccess access; + + /* + * The priority of the rule. + */ + private Integer priority; + + /* + * The direction of the rule. + */ + private SecurityRuleDirection direction; + + /** + * Creates an instance of EffectiveNetworkSecurityRule class. + */ + public EffectiveNetworkSecurityRule() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("sourcePortRange", this.sourcePortRange); + jsonWriter.writeStringField("destinationPortRange", this.destinationPortRange); + jsonWriter.writeArrayField("sourcePortRanges", this.sourcePortRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPortRanges", this.destinationPortRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("sourceAddressPrefix", this.sourceAddressPrefix); + jsonWriter.writeStringField("destinationAddressPrefix", this.destinationAddressPrefix); + jsonWriter.writeArrayField("sourceAddressPrefixes", this.sourceAddressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationAddressPrefixes", this.destinationAddressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("expandedSourceAddressPrefix", this.expandedSourceAddressPrefix, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("expandedDestinationAddressPrefix", this.expandedDestinationAddressPrefix, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("access", this.access == null ? null : this.access.toString()); + jsonWriter.writeNumberField("priority", this.priority); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveNetworkSecurityRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveNetworkSecurityRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveNetworkSecurityRule. + */ + public static EffectiveNetworkSecurityRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveNetworkSecurityRule deserializedEffectiveNetworkSecurityRule = new EffectiveNetworkSecurityRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.name = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.protocol + = EffectiveSecurityRuleProtocol.fromString(reader.getString()); + } else if ("sourcePortRange".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.sourcePortRange = reader.getString(); + } else if ("destinationPortRange".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.destinationPortRange = reader.getString(); + } else if ("sourcePortRanges".equals(fieldName)) { + List sourcePortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveNetworkSecurityRule.sourcePortRanges = sourcePortRanges; + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveNetworkSecurityRule.destinationPortRanges = destinationPortRanges; + } else if ("sourceAddressPrefix".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.sourceAddressPrefix = reader.getString(); + } else if ("destinationAddressPrefix".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.destinationAddressPrefix = reader.getString(); + } else if ("sourceAddressPrefixes".equals(fieldName)) { + List sourceAddressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveNetworkSecurityRule.sourceAddressPrefixes = sourceAddressPrefixes; + } else if ("destinationAddressPrefixes".equals(fieldName)) { + List destinationAddressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveNetworkSecurityRule.destinationAddressPrefixes = destinationAddressPrefixes; + } else if ("expandedSourceAddressPrefix".equals(fieldName)) { + List expandedSourceAddressPrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveNetworkSecurityRule.expandedSourceAddressPrefix = expandedSourceAddressPrefix; + } else if ("expandedDestinationAddressPrefix".equals(fieldName)) { + List expandedDestinationAddressPrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveNetworkSecurityRule.expandedDestinationAddressPrefix + = expandedDestinationAddressPrefix; + } else if ("access".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.access = SecurityRuleAccess.fromString(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.priority = reader.getNullable(JsonReader::getInt); + } else if ("direction".equals(fieldName)) { + deserializedEffectiveNetworkSecurityRule.direction + = SecurityRuleDirection.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveNetworkSecurityRule; + }); + } +} 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..d7e3cb2ff224f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoute.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Effective Route. + */ +@Fluent +public final class EffectiveRoute implements JsonSerializable { + /* + * The name of the user defined route. This is optional. + */ + private String name; + + /* + * If true, on-premises routes are not propagated to the network interfaces in the subnet. + */ + private Boolean disableBgpRoutePropagation; + + /* + * Who created the route. + */ + private EffectiveRouteSource source; + + /* + * The value of effective route. + */ + private EffectiveRouteState state; + + /* + * The address prefixes of the effective routes in CIDR notation. + */ + private List addressPrefix; + + /* + * The IP address of the next hop of the effective route. + */ + private List nextHopIpAddress; + + /* + * The type of Azure hop the packet should be sent to. + */ + private RouteNextHopType nextHopType; + + /** + * Creates an instance of EffectiveRoute class. + */ + public EffectiveRoute() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("disableBgpRoutePropagation", this.disableBgpRoutePropagation); + jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeArrayField("addressPrefix", this.addressPrefix, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("nextHopIpAddress", this.nextHopIpAddress, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextHopType", this.nextHopType == null ? null : this.nextHopType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveRoute if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveRoute. + */ + public static EffectiveRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveRoute deserializedEffectiveRoute = new EffectiveRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedEffectiveRoute.name = reader.getString(); + } else if ("disableBgpRoutePropagation".equals(fieldName)) { + deserializedEffectiveRoute.disableBgpRoutePropagation = reader.getNullable(JsonReader::getBoolean); + } else if ("source".equals(fieldName)) { + deserializedEffectiveRoute.source = EffectiveRouteSource.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedEffectiveRoute.state = EffectiveRouteState.fromString(reader.getString()); + } else if ("addressPrefix".equals(fieldName)) { + List addressPrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveRoute.addressPrefix = addressPrefix; + } else if ("nextHopIpAddress".equals(fieldName)) { + List nextHopIpAddress = reader.readArray(reader1 -> reader1.getString()); + deserializedEffectiveRoute.nextHopIpAddress = nextHopIpAddress; + } else if ("nextHopType".equals(fieldName)) { + deserializedEffectiveRoute.nextHopType = RouteNextHopType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveRoute; + }); + } +} 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..c416a2884049f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteListResult.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.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/EffectiveRouteMapRoute.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteMapRoute.java new file mode 100644 index 0000000000000..f741f39f3d689 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteMapRoute.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The effective RouteMap route configured on the connection resource. + */ +@Fluent +public final class EffectiveRouteMapRoute implements JsonSerializable { + /* + * The address prefix of the route. + */ + private String prefix; + + /* + * BGP communities of the route. + */ + private String bgpCommunities; + + /* + * The ASPath of this route. + */ + private String asPath; + + /** + * Creates an instance of EffectiveRouteMapRoute class. + */ + public EffectiveRouteMapRoute() { + } + + /** + * Get the prefix property: The address prefix of the route. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The address prefix of the route. + * + * @param prefix the prefix value to set. + * @return the EffectiveRouteMapRoute object itself. + */ + public EffectiveRouteMapRoute withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the bgpCommunities property: BGP communities of the route. + * + * @return the bgpCommunities value. + */ + public String bgpCommunities() { + return this.bgpCommunities; + } + + /** + * Set the bgpCommunities property: BGP communities of the route. + * + * @param bgpCommunities the bgpCommunities value to set. + * @return the EffectiveRouteMapRoute object itself. + */ + public EffectiveRouteMapRoute withBgpCommunities(String bgpCommunities) { + this.bgpCommunities = bgpCommunities; + 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 EffectiveRouteMapRoute object itself. + */ + public EffectiveRouteMapRoute withAsPath(String asPath) { + this.asPath = asPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prefix", this.prefix); + jsonWriter.writeStringField("bgpCommunities", this.bgpCommunities); + jsonWriter.writeStringField("asPath", this.asPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveRouteMapRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveRouteMapRoute if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveRouteMapRoute. + */ + public static EffectiveRouteMapRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveRouteMapRoute deserializedEffectiveRouteMapRoute = new EffectiveRouteMapRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + deserializedEffectiveRouteMapRoute.prefix = reader.getString(); + } else if ("bgpCommunities".equals(fieldName)) { + deserializedEffectiveRouteMapRoute.bgpCommunities = reader.getString(); + } else if ("asPath".equals(fieldName)) { + deserializedEffectiveRouteMapRoute.asPath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveRouteMapRoute; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteMapRouteList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteMapRouteList.java new file mode 100644 index 0000000000000..bebf4e39c339e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteMapRouteList.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.EffectiveRouteMapRouteListInner; +import java.util.List; + +/** + * An immutable client-side representation of EffectiveRouteMapRouteList. + */ +public interface EffectiveRouteMapRouteList { + /** + * Gets the value property: The list of Effective RouteMap Routes configured on the connection resource. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.EffectiveRouteMapRouteListInner object. + * + * @return the inner object. + */ + EffectiveRouteMapRouteListInner 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..ce3d1775afc1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteSource.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 java.util.Collection; + +/** + * Who created the route. + */ +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 a new instance of EffectiveRouteSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EffectiveRouteSource() { + } + + /** + * Creates or finds a EffectiveRouteSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveRouteSource. + */ + public static EffectiveRouteSource fromString(String name) { + return fromString(name, EffectiveRouteSource.class); + } + + /** + * Gets known EffectiveRouteSource values. + * + * @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..a66fb0b05eb55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRouteState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The value of effective route. + */ +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 a new instance of EffectiveRouteState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EffectiveRouteState() { + } + + /** + * Creates or finds a EffectiveRouteState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveRouteState. + */ + public static EffectiveRouteState fromString(String name) { + return fromString(name, EffectiveRouteState.class); + } + + /** + * Gets known EffectiveRouteState values. + * + * @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..cb73ac42e37b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveRoutesParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The parameters specifying the resource whose effective routes are being requested. + */ +@Fluent +public final class EffectiveRoutesParameters implements JsonSerializable { + /* + * The resource whose effective routes are being requested. + */ + private String resourceId; + + /* + * The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, + * VpnConnection and P2SConnection. + */ + private String virtualWanResourceType; + + /** + * Creates an instance of EffectiveRoutesParameters class. + */ + public EffectiveRoutesParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("virtualWanResourceType", this.virtualWanResourceType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveRoutesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveRoutesParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveRoutesParameters. + */ + public static EffectiveRoutesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveRoutesParameters deserializedEffectiveRoutesParameters = new EffectiveRoutesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedEffectiveRoutesParameters.resourceId = reader.getString(); + } else if ("virtualWanResourceType".equals(fieldName)) { + deserializedEffectiveRoutesParameters.virtualWanResourceType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveRoutesParameters; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityAdminRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityAdminRule.java new file mode 100644 index 0000000000000..6fa3a1d63c508 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityAdminRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.AdminPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Network admin rule. + */ +@Fluent +public final class EffectiveSecurityAdminRule extends EffectiveBaseSecurityAdminRule { + /* + * Whether the rule is custom or default. + */ + private EffectiveAdminRuleKind kind = EffectiveAdminRuleKind.CUSTOM; + + /* + * Indicates the properties of the security admin rule + */ + private AdminPropertiesFormat innerProperties; + + /** + * Creates an instance of EffectiveSecurityAdminRule class. + */ + public EffectiveSecurityAdminRule() { + } + + /** + * Get the kind property: Whether the rule is custom or default. + * + * @return the kind value. + */ + @Override + public EffectiveAdminRuleKind kind() { + return this.kind; + } + + /** + * Get the innerProperties property: Indicates the properties of the security admin rule. + * + * @return the innerProperties value. + */ + private AdminPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveSecurityAdminRule withId(String id) { + super.withId(id); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveSecurityAdminRule withConfigurationDescription(String configurationDescription) { + super.withConfigurationDescription(configurationDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveSecurityAdminRule withRuleCollectionDescription(String ruleCollectionDescription) { + super.withRuleCollectionDescription(ruleCollectionDescription); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveSecurityAdminRule + withRuleCollectionAppliesToGroups(List ruleCollectionAppliesToGroups) { + super.withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EffectiveSecurityAdminRule withRuleGroups(List ruleGroups) { + super.withRuleGroups(ruleGroups); + return this; + } + + /** + * Get the description property: A description for this rule. Restricted to 140 chars. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: A description for this rule. Restricted to 140 chars. + * + * @param description the description value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + public SecurityConfigurationRuleProtocol protocol() { + return this.innerProperties() == null ? null : this.innerProperties().protocol(); + } + + /** + * Set the protocol property: Network protocol this rule applies to. + * + * @param protocol the protocol value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withProtocol(SecurityConfigurationRuleProtocol protocol) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withProtocol(protocol); + return this; + } + + /** + * Get the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + public List sources() { + return this.innerProperties() == null ? null : this.innerProperties().sources(); + } + + /** + * Set the sources property: The CIDR or source IP ranges. + * + * @param sources the sources value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withSources(List sources) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withSources(sources); + return this; + } + + /** + * Get the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + public List destinations() { + return this.innerProperties() == null ? null : this.innerProperties().destinations(); + } + + /** + * Set the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @param destinations the destinations value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withDestinations(List destinations) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDestinations(destinations); + return this; + } + + /** + * Get the sourcePortRanges property: The source port ranges. + * + * @return the sourcePortRanges value. + */ + public List sourcePortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().sourcePortRanges(); + } + + /** + * Set the sourcePortRanges property: The source port ranges. + * + * @param sourcePortRanges the sourcePortRanges value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withSourcePortRanges(List sourcePortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withSourcePortRanges(sourcePortRanges); + return this; + } + + /** + * Get the destinationPortRanges property: The destination port ranges. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPortRanges(); + } + + /** + * Set the destinationPortRanges property: The destination port ranges. + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withDestinationPortRanges(List destinationPortRanges) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDestinationPortRanges(destinationPortRanges); + return this; + } + + /** + * Get the access property: Indicates the access allowed for this particular rule. + * + * @return the access value. + */ + public SecurityConfigurationRuleAccess access() { + return this.innerProperties() == null ? null : this.innerProperties().access(); + } + + /** + * Set the access property: Indicates the access allowed for this particular rule. + * + * @param access the access value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withAccess(SecurityConfigurationRuleAccess access) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withAccess(access); + return this; + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 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.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: The priority of the rule. The value can be between 1 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 EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + public SecurityConfigurationRuleDirection direction() { + return this.innerProperties() == null ? null : this.innerProperties().direction(); + } + + /** + * Set the direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @param direction the direction value to set. + * @return the EffectiveSecurityAdminRule object itself. + */ + public EffectiveSecurityAdminRule withDirection(SecurityConfigurationRuleDirection direction) { + if (this.innerProperties() == null) { + this.innerProperties = new AdminPropertiesFormat(); + } + this.innerProperties().withDirection(direction); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (ruleCollectionAppliesToGroups() != null) { + ruleCollectionAppliesToGroups().forEach(e -> e.validate()); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("configurationDescription", configurationDescription()); + jsonWriter.writeStringField("ruleCollectionDescription", ruleCollectionDescription()); + jsonWriter.writeArrayField("ruleCollectionAppliesToGroups", ruleCollectionAppliesToGroups(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ruleGroups", ruleGroups(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EffectiveSecurityAdminRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EffectiveSecurityAdminRule if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EffectiveSecurityAdminRule. + */ + public static EffectiveSecurityAdminRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EffectiveSecurityAdminRule deserializedEffectiveSecurityAdminRule = new EffectiveSecurityAdminRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEffectiveSecurityAdminRule.withId(reader.getString()); + } else if ("configurationDescription".equals(fieldName)) { + deserializedEffectiveSecurityAdminRule.withConfigurationDescription(reader.getString()); + } else if ("ruleCollectionDescription".equals(fieldName)) { + deserializedEffectiveSecurityAdminRule.withRuleCollectionDescription(reader.getString()); + } else if ("ruleCollectionAppliesToGroups".equals(fieldName)) { + List ruleCollectionAppliesToGroups + = reader.readArray(reader1 -> NetworkManagerSecurityGroupItem.fromJson(reader1)); + deserializedEffectiveSecurityAdminRule + .withRuleCollectionAppliesToGroups(ruleCollectionAppliesToGroups); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ConfigurationGroup.fromJson(reader1)); + deserializedEffectiveSecurityAdminRule.withRuleGroups(ruleGroups); + } else if ("kind".equals(fieldName)) { + deserializedEffectiveSecurityAdminRule.kind = EffectiveAdminRuleKind.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedEffectiveSecurityAdminRule.innerProperties = AdminPropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEffectiveSecurityAdminRule; + }); + } +} 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..617c17f0feb73 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EffectiveSecurityRuleProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The network protocol this rule applies to. + */ +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 a new instance of EffectiveSecurityRuleProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EffectiveSecurityRuleProtocol() { + } + + /** + * Creates or finds a EffectiveSecurityRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding EffectiveSecurityRuleProtocol. + */ + public static EffectiveSecurityRuleProtocol fromString(String name) { + return fromString(name, EffectiveSecurityRuleProtocol.class); + } + + /** + * Gets known EffectiveSecurityRuleProtocol values. + * + * @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..eac6adb27df10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServiceResult.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.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..150523d0f86bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointServicesListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.EndpointServiceResultInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListAvailableEndpointServices API service call. + */ +@Fluent +public final class EndpointServicesListResult implements JsonSerializable { + /* + * List of available endpoint services in a region. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of EndpointServicesListResult class. + */ + public EndpointServicesListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EndpointServicesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EndpointServicesListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EndpointServicesListResult. + */ + public static EndpointServicesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EndpointServicesListResult deserializedEndpointServicesListResult = new EndpointServicesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EndpointServiceResultInner.fromJson(reader1)); + deserializedEndpointServicesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEndpointServicesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpointServicesListResult; + }); + } +} 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..c47ee76e1b1ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EndpointType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The endpoint type. + */ +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"); + + /** + * Static value AzureArcVM for EndpointType. + */ + public static final EndpointType AZURE_ARC_VM = fromString("AzureArcVM"); + + /** + * Static value AzureVMSS for EndpointType. + */ + public static final EndpointType AZURE_VMSS = fromString("AzureVMSS"); + + /** + * Static value AzureArcNetwork for EndpointType. + */ + public static final EndpointType AZURE_ARC_NETWORK = fromString("AzureArcNetwork"); + + /** + * Creates a new instance of EndpointType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EndpointType() { + } + + /** + * Creates or finds a EndpointType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EndpointType. + */ + public static EndpointType fromString(String name) { + return fromString(name, EndpointType.class); + } + + /** + * Gets known EndpointType values. + * + * @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..1ecfaeb27fe65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Error.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.Immutable; +import com.azure.core.management.exception.AdditionalInfo; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Common error representation. + */ +@Immutable +public final class Error extends ManagementError { + /* + * Inner error message. + */ + private String innerError; + + /* + * Additional info for the error. + */ + private List additionalInfo; + + /* + * Details for the error. + */ + private List details; + + /* + * The target of the error. + */ + private String target; + + /* + * The error message parsed from the body of the http error response. + */ + private String message; + + /* + * The error code parsed from the body of the http error response. + */ + private String code; + + /** + * Creates an instance of Error class. + */ + public Error() { + } + + /** + * Get the innerError property: Inner error message. + * + * @return the innerError value. + */ + public String getInnerError() { + return this.innerError; + } + + /** + * Get the additionalInfo property: Additional info for the error. + * + * @return the additionalInfo value. + */ + @Override + public List getAdditionalInfo() { + return this.additionalInfo; + } + + /** + * Get the details property: Details for the error. + * + * @return the details value. + */ + @Override + public List getDetails() { + return this.details; + } + + /** + * Get the target property: The target of the error. + * + * @return the target value. + */ + @Override + public String getTarget() { + return this.target; + } + + /** + * Get the message property: The error message parsed from the body of the http error response. + * + * @return the message value. + */ + @Override + public String getMessage() { + return this.message; + } + + /** + * Get the code property: The error code parsed from the body of the http error response. + * + * @return the code value. + */ + @Override + public String getCode() { + return this.code; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Error from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Error. + */ + public static Error fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JsonReader bufferedReader = reader.bufferObject(); + bufferedReader.nextToken(); + while (bufferedReader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = bufferedReader.getFieldName(); + bufferedReader.nextToken(); + + if ("error".equals(fieldName)) { + return readManagementError(bufferedReader); + } else { + bufferedReader.skipChildren(); + } + } + return readManagementError(bufferedReader.reset()); + }); + } + + private static Error readManagementError(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Error deserializedError = new Error(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedError.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedError.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedError.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedError.details = details; + } else if ("additionalInfo".equals(fieldName)) { + List additionalInfo = reader.readArray(reader1 -> AdditionalInfo.fromJson(reader1)); + deserializedError.additionalInfo = additionalInfo; + } else if ("innerError".equals(fieldName)) { + deserializedError.innerError = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedError; + }); + } +} 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..3784354d32e83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ErrorException.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.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); + } + + /** + * {@inheritDoc} + */ + @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..98f7d72fb8d8c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluatedNetworkSecurityGroup.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Results of network security group evaluation. + */ +@Fluent +public final class EvaluatedNetworkSecurityGroup implements JsonSerializable { + /* + * Network security group ID. + */ + private String networkSecurityGroupId; + + /* + * Resource ID of nic or subnet to which network security group is applied. + */ + private String appliedTo; + + /* + * Matched network security rule. + */ + private MatchedRule matchedRule; + + /* + * List of network security rules evaluation results. + */ + private List rulesEvaluationResult; + + /** + * Creates an instance of EvaluatedNetworkSecurityGroup class. + */ + public EvaluatedNetworkSecurityGroup() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkSecurityGroupId", this.networkSecurityGroupId); + jsonWriter.writeStringField("appliedTo", this.appliedTo); + jsonWriter.writeJsonField("matchedRule", this.matchedRule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EvaluatedNetworkSecurityGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatedNetworkSecurityGroup if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the EvaluatedNetworkSecurityGroup. + */ + public static EvaluatedNetworkSecurityGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatedNetworkSecurityGroup deserializedEvaluatedNetworkSecurityGroup + = new EvaluatedNetworkSecurityGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkSecurityGroupId".equals(fieldName)) { + deserializedEvaluatedNetworkSecurityGroup.networkSecurityGroupId = reader.getString(); + } else if ("appliedTo".equals(fieldName)) { + deserializedEvaluatedNetworkSecurityGroup.appliedTo = reader.getString(); + } else if ("matchedRule".equals(fieldName)) { + deserializedEvaluatedNetworkSecurityGroup.matchedRule = MatchedRule.fromJson(reader); + } else if ("rulesEvaluationResult".equals(fieldName)) { + List rulesEvaluationResult + = reader.readArray(reader1 -> NetworkSecurityRulesEvaluationResult.fromJson(reader1)); + deserializedEvaluatedNetworkSecurityGroup.rulesEvaluationResult = rulesEvaluationResult; + } else { + reader.skipChildren(); + } + } + + return deserializedEvaluatedNetworkSecurityGroup; + }); + } +} 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..e6e6c116e3f41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/EvaluationState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Connectivity analysis evaluation state. + */ +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 a new instance of EvaluationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EvaluationState() { + } + + /** + * Creates or finds a EvaluationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvaluationState. + */ + public static EvaluationState fromString(String name) { + return fromString(name, EvaluationState.class); + } + + /** + * Gets known EvaluationState values. + * + * @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/ExceptionEntry.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntry.java new file mode 100644 index 0000000000000..c5ff35107d244 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntry.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Adds exception to allow a request when the condition is satisfied. + */ +@Fluent +public final class ExceptionEntry implements JsonSerializable { + /* + * The variable on which we evaluate the exception condition + */ + private ExceptionEntryMatchVariable matchVariable; + + /* + * Allowed values for the matchVariable + */ + private List values; + + /* + * Operates on the allowed values for the matchVariable + */ + private ExceptionEntryValueMatchOperator valueMatchOperator; + + /* + * When the matchVariable points to a key-value pair (e.g, RequestHeader), this operates on the selector + */ + private ExceptionEntrySelectorMatchOperator selectorMatchOperator; + + /* + * When the matchVariable points to a key-value pair (e.g, RequestHeader), this identifies the key. + */ + private String selector; + + /* + * The managed rule sets that are associated with the exception. + */ + private List exceptionManagedRuleSets; + + /** + * Creates an instance of ExceptionEntry class. + */ + public ExceptionEntry() { + } + + /** + * Get the matchVariable property: The variable on which we evaluate the exception condition. + * + * @return the matchVariable value. + */ + public ExceptionEntryMatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: The variable on which we evaluate the exception condition. + * + * @param matchVariable the matchVariable value to set. + * @return the ExceptionEntry object itself. + */ + public ExceptionEntry withMatchVariable(ExceptionEntryMatchVariable matchVariable) { + this.matchVariable = matchVariable; + return this; + } + + /** + * Get the values property: Allowed values for the matchVariable. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Allowed values for the matchVariable. + * + * @param values the values value to set. + * @return the ExceptionEntry object itself. + */ + public ExceptionEntry withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the valueMatchOperator property: Operates on the allowed values for the matchVariable. + * + * @return the valueMatchOperator value. + */ + public ExceptionEntryValueMatchOperator valueMatchOperator() { + return this.valueMatchOperator; + } + + /** + * Set the valueMatchOperator property: Operates on the allowed values for the matchVariable. + * + * @param valueMatchOperator the valueMatchOperator value to set. + * @return the ExceptionEntry object itself. + */ + public ExceptionEntry withValueMatchOperator(ExceptionEntryValueMatchOperator valueMatchOperator) { + this.valueMatchOperator = valueMatchOperator; + return this; + } + + /** + * Get the selectorMatchOperator property: When the matchVariable points to a key-value pair (e.g, RequestHeader), + * this operates on the selector. + * + * @return the selectorMatchOperator value. + */ + public ExceptionEntrySelectorMatchOperator selectorMatchOperator() { + return this.selectorMatchOperator; + } + + /** + * Set the selectorMatchOperator property: When the matchVariable points to a key-value pair (e.g, RequestHeader), + * this operates on the selector. + * + * @param selectorMatchOperator the selectorMatchOperator value to set. + * @return the ExceptionEntry object itself. + */ + public ExceptionEntry withSelectorMatchOperator(ExceptionEntrySelectorMatchOperator selectorMatchOperator) { + this.selectorMatchOperator = selectorMatchOperator; + return this; + } + + /** + * Get the selector property: When the matchVariable points to a key-value pair (e.g, RequestHeader), this + * identifies the key. + * + * @return the selector value. + */ + public String selector() { + return this.selector; + } + + /** + * Set the selector property: When the matchVariable points to a key-value pair (e.g, RequestHeader), this + * identifies the key. + * + * @param selector the selector value to set. + * @return the ExceptionEntry object itself. + */ + public ExceptionEntry withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the exceptionManagedRuleSets property: The managed rule sets that are associated with the exception. + * + * @return the exceptionManagedRuleSets value. + */ + public List exceptionManagedRuleSets() { + return this.exceptionManagedRuleSets; + } + + /** + * Set the exceptionManagedRuleSets property: The managed rule sets that are associated with the exception. + * + * @param exceptionManagedRuleSets the exceptionManagedRuleSets value to set. + * @return the ExceptionEntry object itself. + */ + public ExceptionEntry withExceptionManagedRuleSets(List exceptionManagedRuleSets) { + this.exceptionManagedRuleSets = exceptionManagedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property matchVariable in model ExceptionEntry")); + } + if (valueMatchOperator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property valueMatchOperator in model ExceptionEntry")); + } + if (exceptionManagedRuleSets() != null) { + exceptionManagedRuleSets().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExceptionEntry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("matchVariable", this.matchVariable == null ? null : this.matchVariable.toString()); + jsonWriter.writeStringField("valueMatchOperator", + this.valueMatchOperator == null ? null : this.valueMatchOperator.toString()); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("selectorMatchOperator", + this.selectorMatchOperator == null ? null : this.selectorMatchOperator.toString()); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeArrayField("exceptionManagedRuleSets", this.exceptionManagedRuleSets, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExceptionEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExceptionEntry if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExceptionEntry. + */ + public static ExceptionEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExceptionEntry deserializedExceptionEntry = new ExceptionEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchVariable".equals(fieldName)) { + deserializedExceptionEntry.matchVariable + = ExceptionEntryMatchVariable.fromString(reader.getString()); + } else if ("valueMatchOperator".equals(fieldName)) { + deserializedExceptionEntry.valueMatchOperator + = ExceptionEntryValueMatchOperator.fromString(reader.getString()); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedExceptionEntry.values = values; + } else if ("selectorMatchOperator".equals(fieldName)) { + deserializedExceptionEntry.selectorMatchOperator + = ExceptionEntrySelectorMatchOperator.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedExceptionEntry.selector = reader.getString(); + } else if ("exceptionManagedRuleSets".equals(fieldName)) { + List exceptionManagedRuleSets + = reader.readArray(reader1 -> ExclusionManagedRuleSet.fromJson(reader1)); + deserializedExceptionEntry.exceptionManagedRuleSets = exceptionManagedRuleSets; + } else { + reader.skipChildren(); + } + } + + return deserializedExceptionEntry; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryMatchVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryMatchVariable.java new file mode 100644 index 0000000000000..85092fe7d5701 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryMatchVariable.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The variable on which we evaluate the exception condition. + */ +public final class ExceptionEntryMatchVariable extends ExpandableStringEnum { + /** + * Static value RequestURI for ExceptionEntryMatchVariable. + */ + public static final ExceptionEntryMatchVariable REQUEST_URI = fromString("RequestURI"); + + /** + * Static value RemoteAddr for ExceptionEntryMatchVariable. + */ + public static final ExceptionEntryMatchVariable REMOTE_ADDR = fromString("RemoteAddr"); + + /** + * Static value RequestHeader for ExceptionEntryMatchVariable. + */ + public static final ExceptionEntryMatchVariable REQUEST_HEADER = fromString("RequestHeader"); + + /** + * Creates a new instance of ExceptionEntryMatchVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExceptionEntryMatchVariable() { + } + + /** + * Creates or finds a ExceptionEntryMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExceptionEntryMatchVariable. + */ + public static ExceptionEntryMatchVariable fromString(String name) { + return fromString(name, ExceptionEntryMatchVariable.class); + } + + /** + * Gets known ExceptionEntryMatchVariable values. + * + * @return known ExceptionEntryMatchVariable values. + */ + public static Collection values() { + return values(ExceptionEntryMatchVariable.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntrySelectorMatchOperator.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntrySelectorMatchOperator.java new file mode 100644 index 0000000000000..40f46fc6ecfa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntrySelectorMatchOperator.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * When the matchVariable points to a key-value pair (e.g, RequestHeader), this operates on the selector. + */ +public final class ExceptionEntrySelectorMatchOperator + extends ExpandableStringEnum { + /** + * Static value Equals for ExceptionEntrySelectorMatchOperator. + */ + public static final ExceptionEntrySelectorMatchOperator EQUALS = fromString("Equals"); + + /** + * Static value Contains for ExceptionEntrySelectorMatchOperator. + */ + public static final ExceptionEntrySelectorMatchOperator CONTAINS = fromString("Contains"); + + /** + * Static value StartsWith for ExceptionEntrySelectorMatchOperator. + */ + public static final ExceptionEntrySelectorMatchOperator STARTS_WITH = fromString("StartsWith"); + + /** + * Static value EndsWith for ExceptionEntrySelectorMatchOperator. + */ + public static final ExceptionEntrySelectorMatchOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Creates a new instance of ExceptionEntrySelectorMatchOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExceptionEntrySelectorMatchOperator() { + } + + /** + * Creates or finds a ExceptionEntrySelectorMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExceptionEntrySelectorMatchOperator. + */ + public static ExceptionEntrySelectorMatchOperator fromString(String name) { + return fromString(name, ExceptionEntrySelectorMatchOperator.class); + } + + /** + * Gets known ExceptionEntrySelectorMatchOperator values. + * + * @return known ExceptionEntrySelectorMatchOperator values. + */ + public static Collection values() { + return values(ExceptionEntrySelectorMatchOperator.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryValueMatchOperator.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryValueMatchOperator.java new file mode 100644 index 0000000000000..3cb2a7ebd9bc1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExceptionEntryValueMatchOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operates on the allowed values for the matchVariable. + */ +public final class ExceptionEntryValueMatchOperator extends ExpandableStringEnum { + /** + * Static value Equals for ExceptionEntryValueMatchOperator. + */ + public static final ExceptionEntryValueMatchOperator EQUALS = fromString("Equals"); + + /** + * Static value Contains for ExceptionEntryValueMatchOperator. + */ + public static final ExceptionEntryValueMatchOperator CONTAINS = fromString("Contains"); + + /** + * Static value StartsWith for ExceptionEntryValueMatchOperator. + */ + public static final ExceptionEntryValueMatchOperator STARTS_WITH = fromString("StartsWith"); + + /** + * Static value EndsWith for ExceptionEntryValueMatchOperator. + */ + public static final ExceptionEntryValueMatchOperator ENDS_WITH = fromString("EndsWith"); + + /** + * Static value IPMatch for ExceptionEntryValueMatchOperator. + */ + public static final ExceptionEntryValueMatchOperator IPMATCH = fromString("IPMatch"); + + /** + * Creates a new instance of ExceptionEntryValueMatchOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExceptionEntryValueMatchOperator() { + } + + /** + * Creates or finds a ExceptionEntryValueMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExceptionEntryValueMatchOperator. + */ + public static ExceptionEntryValueMatchOperator fromString(String name) { + return fromString(name, ExceptionEntryValueMatchOperator.class); + } + + /** + * Gets known ExceptionEntryValueMatchOperator values. + * + * @return known ExceptionEntryValueMatchOperator values. + */ + public static Collection values() { + return values(ExceptionEntryValueMatchOperator.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRule.java new file mode 100644 index 0000000000000..19f618f4fd87b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRule.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines a managed rule to use for exclusion. + */ +@Fluent +public final class ExclusionManagedRule implements JsonSerializable { + /* + * Identifier for the managed rule. + */ + private String ruleId; + + /** + * Creates an instance of ExclusionManagedRule class. + */ + public ExclusionManagedRule() { + } + + /** + * 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 ExclusionManagedRule object itself. + */ + public ExclusionManagedRule withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleId in model ExclusionManagedRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExclusionManagedRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleId", this.ruleId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExclusionManagedRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExclusionManagedRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExclusionManagedRule. + */ + public static ExclusionManagedRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExclusionManagedRule deserializedExclusionManagedRule = new ExclusionManagedRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleId".equals(fieldName)) { + deserializedExclusionManagedRule.ruleId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExclusionManagedRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleGroup.java new file mode 100644 index 0000000000000..6e4b93c1226f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleGroup.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines a managed rule group to use for exclusion. + */ +@Fluent +public final class ExclusionManagedRuleGroup implements JsonSerializable { + /* + * The managed rule group for exclusion. + */ + private String ruleGroupName; + + /* + * List of rules that will be excluded. If none specified, all rules in the group will be excluded. + */ + private List rules; + + /** + * Creates an instance of ExclusionManagedRuleGroup class. + */ + public ExclusionManagedRuleGroup() { + } + + /** + * Get the ruleGroupName property: The managed rule group for exclusion. + * + * @return the ruleGroupName value. + */ + public String ruleGroupName() { + return this.ruleGroupName; + } + + /** + * Set the ruleGroupName property: The managed rule group for exclusion. + * + * @param ruleGroupName the ruleGroupName value to set. + * @return the ExclusionManagedRuleGroup object itself. + */ + public ExclusionManagedRuleGroup withRuleGroupName(String ruleGroupName) { + this.ruleGroupName = ruleGroupName; + return this; + } + + /** + * Get the rules property: List of rules that will be excluded. If none specified, all rules in the group will be + * excluded. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: List of rules that will be excluded. If none specified, all rules in the group will be + * excluded. + * + * @param rules the rules value to set. + * @return the ExclusionManagedRuleGroup object itself. + */ + public ExclusionManagedRuleGroup 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.atError() + .log(new IllegalArgumentException( + "Missing required property ruleGroupName in model ExclusionManagedRuleGroup")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExclusionManagedRuleGroup.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleGroupName", this.ruleGroupName); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExclusionManagedRuleGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExclusionManagedRuleGroup if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExclusionManagedRuleGroup. + */ + public static ExclusionManagedRuleGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExclusionManagedRuleGroup deserializedExclusionManagedRuleGroup = new ExclusionManagedRuleGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleGroupName".equals(fieldName)) { + deserializedExclusionManagedRuleGroup.ruleGroupName = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ExclusionManagedRule.fromJson(reader1)); + deserializedExclusionManagedRuleGroup.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedExclusionManagedRuleGroup; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleSet.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleSet.java new file mode 100644 index 0000000000000..9d6d1abebe756 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExclusionManagedRuleSet.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines a managed rule set for Exclusions. + */ +@Fluent +public final class ExclusionManagedRuleSet implements JsonSerializable { + /* + * Defines the rule set type to use. + */ + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + private String ruleSetVersion; + + /* + * Defines the rule groups to apply to the rule set. + */ + private List ruleGroups; + + /** + * Creates an instance of ExclusionManagedRuleSet class. + */ + public ExclusionManagedRuleSet() { + } + + /** + * 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 ExclusionManagedRuleSet object itself. + */ + public ExclusionManagedRuleSet 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 ExclusionManagedRuleSet object itself. + */ + public ExclusionManagedRuleSet withRuleSetVersion(String ruleSetVersion) { + this.ruleSetVersion = ruleSetVersion; + return this; + } + + /** + * Get the ruleGroups property: Defines the rule groups to apply to the rule set. + * + * @return the ruleGroups value. + */ + public List ruleGroups() { + return this.ruleGroups; + } + + /** + * Set the ruleGroups property: Defines the rule groups to apply to the rule set. + * + * @param ruleGroups the ruleGroups value to set. + * @return the ExclusionManagedRuleSet object itself. + */ + public ExclusionManagedRuleSet withRuleGroups(List ruleGroups) { + this.ruleGroups = ruleGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleSetType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleSetType in model ExclusionManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ruleSetVersion in model ExclusionManagedRuleSet")); + } + if (ruleGroups() != null) { + ruleGroups().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExclusionManagedRuleSet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleSetType", this.ruleSetType); + jsonWriter.writeStringField("ruleSetVersion", this.ruleSetVersion); + jsonWriter.writeArrayField("ruleGroups", this.ruleGroups, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExclusionManagedRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExclusionManagedRuleSet if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExclusionManagedRuleSet. + */ + public static ExclusionManagedRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExclusionManagedRuleSet deserializedExclusionManagedRuleSet = new ExclusionManagedRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetType".equals(fieldName)) { + deserializedExclusionManagedRuleSet.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedExclusionManagedRuleSet.ruleSetVersion = reader.getString(); + } else if ("ruleGroups".equals(fieldName)) { + List ruleGroups + = reader.readArray(reader1 -> ExclusionManagedRuleGroup.fromJson(reader1)); + deserializedExclusionManagedRuleSet.ruleGroups = ruleGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedExclusionManagedRuleSet; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxy.java new file mode 100644 index 0000000000000..601ecf200d673 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExplicitProxy.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Explicit Proxy Settings in Firewall Policy. + */ +@Fluent +public final class ExplicitProxy implements JsonSerializable { + /* + * When set to true, explicit proxy mode is enabled. + */ + private Boolean enableExplicitProxy; + + /* + * Port number for explicit proxy http protocol, cannot be greater than 64000. + */ + private Integer httpPort; + + /* + * Port number for explicit proxy https protocol, cannot be greater than 64000. + */ + private Integer httpsPort; + + /* + * When set to true, pac file port and url needs to be provided. + */ + private Boolean enablePacFile; + + /* + * Port number for firewall to serve PAC file. + */ + private Integer pacFilePort; + + /* + * SAS URL for PAC file. + */ + private String pacFile; + + /** + * Creates an instance of ExplicitProxy class. + */ + public ExplicitProxy() { + } + + /** + * Get the enableExplicitProxy property: When set to true, explicit proxy mode is enabled. + * + * @return the enableExplicitProxy value. + */ + public Boolean enableExplicitProxy() { + return this.enableExplicitProxy; + } + + /** + * Set the enableExplicitProxy property: When set to true, explicit proxy mode is enabled. + * + * @param enableExplicitProxy the enableExplicitProxy value to set. + * @return the ExplicitProxy object itself. + */ + public ExplicitProxy withEnableExplicitProxy(Boolean enableExplicitProxy) { + this.enableExplicitProxy = enableExplicitProxy; + return this; + } + + /** + * Get the httpPort property: Port number for explicit proxy http protocol, cannot be greater than 64000. + * + * @return the httpPort value. + */ + public Integer httpPort() { + return this.httpPort; + } + + /** + * Set the httpPort property: Port number for explicit proxy http protocol, cannot be greater than 64000. + * + * @param httpPort the httpPort value to set. + * @return the ExplicitProxy object itself. + */ + public ExplicitProxy withHttpPort(Integer httpPort) { + this.httpPort = httpPort; + return this; + } + + /** + * Get the httpsPort property: Port number for explicit proxy https protocol, cannot be greater than 64000. + * + * @return the httpsPort value. + */ + public Integer httpsPort() { + return this.httpsPort; + } + + /** + * Set the httpsPort property: Port number for explicit proxy https protocol, cannot be greater than 64000. + * + * @param httpsPort the httpsPort value to set. + * @return the ExplicitProxy object itself. + */ + public ExplicitProxy withHttpsPort(Integer httpsPort) { + this.httpsPort = httpsPort; + return this; + } + + /** + * Get the enablePacFile property: When set to true, pac file port and url needs to be provided. + * + * @return the enablePacFile value. + */ + public Boolean enablePacFile() { + return this.enablePacFile; + } + + /** + * Set the enablePacFile property: When set to true, pac file port and url needs to be provided. + * + * @param enablePacFile the enablePacFile value to set. + * @return the ExplicitProxy object itself. + */ + public ExplicitProxy withEnablePacFile(Boolean enablePacFile) { + this.enablePacFile = enablePacFile; + return this; + } + + /** + * Get the pacFilePort property: Port number for firewall to serve PAC file. + * + * @return the pacFilePort value. + */ + public Integer pacFilePort() { + return this.pacFilePort; + } + + /** + * Set the pacFilePort property: Port number for firewall to serve PAC file. + * + * @param pacFilePort the pacFilePort value to set. + * @return the ExplicitProxy object itself. + */ + public ExplicitProxy withPacFilePort(Integer pacFilePort) { + this.pacFilePort = pacFilePort; + return this; + } + + /** + * Get the pacFile property: SAS URL for PAC file. + * + * @return the pacFile value. + */ + public String pacFile() { + return this.pacFile; + } + + /** + * Set the pacFile property: SAS URL for PAC file. + * + * @param pacFile the pacFile value to set. + * @return the ExplicitProxy object itself. + */ + public ExplicitProxy withPacFile(String pacFile) { + this.pacFile = pacFile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableExplicitProxy", this.enableExplicitProxy); + jsonWriter.writeNumberField("httpPort", this.httpPort); + jsonWriter.writeNumberField("httpsPort", this.httpsPort); + jsonWriter.writeBooleanField("enablePacFile", this.enablePacFile); + jsonWriter.writeNumberField("pacFilePort", this.pacFilePort); + jsonWriter.writeStringField("pacFile", this.pacFile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExplicitProxy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExplicitProxy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExplicitProxy. + */ + public static ExplicitProxy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExplicitProxy deserializedExplicitProxy = new ExplicitProxy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableExplicitProxy".equals(fieldName)) { + deserializedExplicitProxy.enableExplicitProxy = reader.getNullable(JsonReader::getBoolean); + } else if ("httpPort".equals(fieldName)) { + deserializedExplicitProxy.httpPort = reader.getNullable(JsonReader::getInt); + } else if ("httpsPort".equals(fieldName)) { + deserializedExplicitProxy.httpsPort = reader.getNullable(JsonReader::getInt); + } else if ("enablePacFile".equals(fieldName)) { + deserializedExplicitProxy.enablePacFile = reader.getNullable(JsonReader::getBoolean); + } else if ("pacFilePort".equals(fieldName)) { + deserializedExplicitProxy.pacFilePort = reader.getNullable(JsonReader::getInt); + } else if ("pacFile".equals(fieldName)) { + deserializedExplicitProxy.pacFile = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExplicitProxy; + }); + } +} 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..a6b12352c4a6b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuit.java @@ -0,0 +1,575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 authorizationKey property: The authorizationKey. + * + * @return the authorizationKey value. + */ + String authorizationKey(); + + /** + * Gets the authorizationStatus property: The authorization status of the Circuit. + * + * @return the authorizationStatus value. + */ + String authorizationStatus(); + + /** + * Gets the enableDirectPortRateLimit property: Flag denoting rate-limiting status of the ExpressRoute direct-port + * circuit. + * + * @return the enableDirectPortRateLimit value. + */ + Boolean enableDirectPortRateLimit(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithAuthorizationKey, DefinitionStages.WithEnableDirectPortRateLimit { + /** + * 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); + } + + /** + * The stage of the ExpressRouteCircuit 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 ExpressRouteCircuit definition allowing to specify enableDirectPortRateLimit. + */ + interface WithEnableDirectPortRateLimit { + /** + * Specifies the enableDirectPortRateLimit property: Flag denoting rate-limiting status of the ExpressRoute + * direct-port circuit.. + * + * @param enableDirectPortRateLimit Flag denoting rate-limiting status of the ExpressRoute direct-port + * circuit. + * @return the next definition stage. + */ + WithCreate withEnableDirectPortRateLimit(Boolean enableDirectPortRateLimit); + } + } + + /** + * 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..31dce4977682a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitArpTable.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ARP table associated with the ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitArpTable implements JsonSerializable { + /* + * Entry age in minutes. + */ + private Integer age; + + /* + * Interface address. + */ + private String interfaceProperty; + + /* + * The IP address. + */ + private String ipAddress; + + /* + * The MAC address. + */ + private String macAddress; + + /** + * Creates an instance of ExpressRouteCircuitArpTable class. + */ + public ExpressRouteCircuitArpTable() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("age", this.age); + jsonWriter.writeStringField("interface", this.interfaceProperty); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeStringField("macAddress", this.macAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitArpTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitArpTable if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitArpTable. + */ + public static ExpressRouteCircuitArpTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitArpTable deserializedExpressRouteCircuitArpTable = new ExpressRouteCircuitArpTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("age".equals(fieldName)) { + deserializedExpressRouteCircuitArpTable.age = reader.getNullable(JsonReader::getInt); + } else if ("interface".equals(fieldName)) { + deserializedExpressRouteCircuitArpTable.interfaceProperty = reader.getString(); + } else if ("ipAddress".equals(fieldName)) { + deserializedExpressRouteCircuitArpTable.ipAddress = reader.getString(); + } else if ("macAddress".equals(fieldName)) { + deserializedExpressRouteCircuitArpTable.macAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitArpTable; + }); + } +} 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..23c869b9619a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorization.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.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 connectionResourceUri property: The reference to the ExpressRoute connection resource using the + * authorization. + * + * @return the connectionResourceUri value. + */ + String connectionResourceUri(); + + /** + * Gets the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..491d8882d68a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitAuthorizations.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..cc255894d6a92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnection.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.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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..28c9c43c356ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitConnectionInner; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * The global reach connection associated with Private Peering in an ExpressRoute Circuit. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCircuitConnectionListResult class. + */ + public ExpressRouteCircuitConnectionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitConnectionListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitConnectionListResult. + */ + public static ExpressRouteCircuitConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitConnectionListResult deserializedExpressRouteCircuitConnectionListResult + = new ExpressRouteCircuitConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCircuitConnectionInner.fromJson(reader1)); + deserializedExpressRouteCircuitConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCircuitConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitConnectionListResult; + }); + } +} 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..a19dc7e5220a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitConnections.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with + * {@link Response}. + */ + Response getWithResponse(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 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 as paginated + * response with {@link PagedIterable}. + */ + 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 as paginated + * response with {@link PagedIterable}. + */ + 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 along with + * {@link Response}. + */ + 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 along with + * {@link Response}. + */ + 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..99fac1d83c521 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListExpressRouteCircuit API service call. + */ +@Fluent +public final class ExpressRouteCircuitListResult implements JsonSerializable { + /* + * A list of ExpressRouteCircuits in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCircuitListResult class. + */ + public ExpressRouteCircuitListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitListResult. + */ + public static ExpressRouteCircuitListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitListResult deserializedExpressRouteCircuitListResult + = new ExpressRouteCircuitListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCircuitInner.fromJson(reader1)); + deserializedExpressRouteCircuitListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCircuitListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitListResult; + }); + } +} 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..6e53cb91e284c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeering.java @@ -0,0 +1,791 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..198d3778f5e0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The advertised public prefix state of the Peering resource. + */ +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 a new instance of ExpressRouteCircuitPeeringAdvertisedPublicPrefixState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteCircuitPeeringAdvertisedPublicPrefixState() { + } + + /** + * Creates or finds a ExpressRouteCircuitPeeringAdvertisedPublicPrefixState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitPeeringAdvertisedPublicPrefixState. + */ + public static ExpressRouteCircuitPeeringAdvertisedPublicPrefixState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.class); + } + + /** + * Gets known ExpressRouteCircuitPeeringAdvertisedPublicPrefixState values. + * + * @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..4a584eef98dd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringConfig.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specifies the peering configuration. + */ +@Fluent +public final class ExpressRouteCircuitPeeringConfig implements JsonSerializable { + /* + * The reference to AdvertisedPublicPrefixes. + */ + private List advertisedPublicPrefixes; + + /* + * The communities of bgp peering. Specified for microsoft peering. + */ + private List advertisedCommunities; + + /* + * The advertised public prefix state of the Peering resource. + */ + private ExpressRouteCircuitPeeringAdvertisedPublicPrefixState advertisedPublicPrefixesState; + + /* + * The legacy mode of the peering. + */ + private Integer legacyMode; + + /* + * The CustomerASN of the peering. + */ + private Integer customerAsn; + + /* + * The RoutingRegistryName of the configuration. + */ + private String routingRegistryName; + + /** + * Creates an instance of ExpressRouteCircuitPeeringConfig class. + */ + public ExpressRouteCircuitPeeringConfig() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("advertisedPublicPrefixes", this.advertisedPublicPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("advertisedCommunities", this.advertisedCommunities, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("legacyMode", this.legacyMode); + jsonWriter.writeNumberField("customerASN", this.customerAsn); + jsonWriter.writeStringField("routingRegistryName", this.routingRegistryName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitPeeringConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitPeeringConfig if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitPeeringConfig. + */ + public static ExpressRouteCircuitPeeringConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitPeeringConfig deserializedExpressRouteCircuitPeeringConfig + = new ExpressRouteCircuitPeeringConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("advertisedPublicPrefixes".equals(fieldName)) { + List advertisedPublicPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedExpressRouteCircuitPeeringConfig.advertisedPublicPrefixes = advertisedPublicPrefixes; + } else if ("advertisedCommunities".equals(fieldName)) { + List advertisedCommunities = reader.readArray(reader1 -> reader1.getString()); + deserializedExpressRouteCircuitPeeringConfig.advertisedCommunities = advertisedCommunities; + } else if ("advertisedPublicPrefixesState".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringConfig.advertisedPublicPrefixesState + = ExpressRouteCircuitPeeringAdvertisedPublicPrefixState.fromString(reader.getString()); + } else if ("legacyMode".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringConfig.legacyMode = reader.getNullable(JsonReader::getInt); + } else if ("customerASN".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringConfig.customerAsn = reader.getNullable(JsonReader::getInt); + } else if ("routingRegistryName".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringConfig.routingRegistryName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitPeeringConfig; + }); + } +} 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..ea79b2a663944 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringId.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ExpressRoute circuit peering identifier. + */ +@Fluent +public final class ExpressRouteCircuitPeeringId implements JsonSerializable { + /* + * The ID of the ExpressRoute circuit peering. + */ + private String id; + + /** + * Creates an instance of ExpressRouteCircuitPeeringId class. + */ + public ExpressRouteCircuitPeeringId() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitPeeringId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitPeeringId if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitPeeringId. + */ + public static ExpressRouteCircuitPeeringId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitPeeringId deserializedExpressRouteCircuitPeeringId = new ExpressRouteCircuitPeeringId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringId.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitPeeringId; + }); + } +} 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..6dc2aee3198c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitPeeringListResult + implements JsonSerializable { + /* + * The peerings in an express route circuit. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCircuitPeeringListResult class. + */ + public ExpressRouteCircuitPeeringListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitPeeringListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitPeeringListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitPeeringListResult. + */ + public static ExpressRouteCircuitPeeringListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitPeeringListResult deserializedExpressRouteCircuitPeeringListResult + = new ExpressRouteCircuitPeeringListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCircuitPeeringInner.fromJson(reader1)); + deserializedExpressRouteCircuitPeeringListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCircuitPeeringListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitPeeringListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringPropertiesFormat.java new file mode 100644 index 0000000000000..c2577e020cfe8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringPropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCircuitPeeringPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of ExpressRouteCircuitPeeringPropertiesFormat. + */ +public interface ExpressRouteCircuitPeeringPropertiesFormat { + /** + * 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.ExpressRouteCircuitPeeringPropertiesFormatInner object. + * + * @return the inner object. + */ + ExpressRouteCircuitPeeringPropertiesFormatInner innerModel(); +} 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..ba0f5698a357e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeeringState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of peering. + */ +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 a new instance of ExpressRouteCircuitPeeringState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteCircuitPeeringState() { + } + + /** + * Creates or finds a ExpressRouteCircuitPeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitPeeringState. + */ + public static ExpressRouteCircuitPeeringState fromString(String name) { + return fromString(name, ExpressRouteCircuitPeeringState.class); + } + + /** + * Gets known ExpressRouteCircuitPeeringState values. + * + * @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..fd808d111ca33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitPeerings.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..ec33e4239e1bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitReference.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Reference to an express route circuit. + */ +@Fluent +public final class ExpressRouteCircuitReference implements JsonSerializable { + /* + * Corresponding Express Route Circuit Id. + */ + private String id; + + /** + * Creates an instance of ExpressRouteCircuitReference class. + */ + public ExpressRouteCircuitReference() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitReference if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitReference. + */ + public static ExpressRouteCircuitReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitReference deserializedExpressRouteCircuitReference = new ExpressRouteCircuitReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteCircuitReference.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitReference; + }); + } +} 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..ad6cc5d7db949 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTable.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitRoutesTable implements JsonSerializable { + /* + * IP address of a network entity. + */ + private String network; + + /* + * NextHop address. + */ + private String nextHop; + + /* + * Local preference value as set with the set local-preference route-map configuration command. + */ + private String locPrf; + + /* + * Route Weight. + */ + private Integer weight; + + /* + * Autonomous system paths to the destination network. + */ + private String path; + + /** + * Creates an instance of ExpressRouteCircuitRoutesTable class. + */ + public ExpressRouteCircuitRoutesTable() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("network", this.network); + jsonWriter.writeStringField("nextHop", this.nextHop); + jsonWriter.writeStringField("locPrf", this.locPrf); + jsonWriter.writeNumberField("weight", this.weight); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitRoutesTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitRoutesTable if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitRoutesTable. + */ + public static ExpressRouteCircuitRoutesTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitRoutesTable deserializedExpressRouteCircuitRoutesTable + = new ExpressRouteCircuitRoutesTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("network".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTable.network = reader.getString(); + } else if ("nextHop".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTable.nextHop = reader.getString(); + } else if ("locPrf".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTable.locPrf = reader.getString(); + } else if ("weight".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTable.weight = reader.getNullable(JsonReader::getInt); + } else if ("path".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTable.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitRoutesTable; + }); + } +} 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..5ffaa7a4bae1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitRoutesTableSummary.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitRoutesTableSummary + implements JsonSerializable { + /* + * IP address of the neighbor. + */ + private String neighbor; + + /* + * BGP version number spoken to the neighbor. + */ + private Integer v; + + /* + * Autonomous system number. + */ + 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. + */ + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer + * group. + */ + private String statePfxRcd; + + /** + * Creates an instance of ExpressRouteCircuitRoutesTableSummary class. + */ + public ExpressRouteCircuitRoutesTableSummary() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("neighbor", this.neighbor); + jsonWriter.writeNumberField("v", this.v); + jsonWriter.writeNumberField("as", this.as); + jsonWriter.writeStringField("upDown", this.upDown); + jsonWriter.writeStringField("statePfxRcd", this.statePfxRcd); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitRoutesTableSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitRoutesTableSummary if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitRoutesTableSummary. + */ + public static ExpressRouteCircuitRoutesTableSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitRoutesTableSummary deserializedExpressRouteCircuitRoutesTableSummary + = new ExpressRouteCircuitRoutesTableSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("neighbor".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTableSummary.neighbor = reader.getString(); + } else if ("v".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTableSummary.v = reader.getNullable(JsonReader::getInt); + } else if ("as".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTableSummary.as = reader.getNullable(JsonReader::getInt); + } else if ("upDown".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTableSummary.upDown = reader.getString(); + } else if ("statePfxRcd".equals(fieldName)) { + deserializedExpressRouteCircuitRoutesTableSummary.statePfxRcd = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitRoutesTableSummary; + }); + } +} 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..c50d5552a5ac4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitServiceProviderProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains ServiceProviderProperties in an ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitServiceProviderProperties + implements JsonSerializable { + /* + * The serviceProviderName. + */ + private String serviceProviderName; + + /* + * The peering location. + */ + private String peeringLocation; + + /* + * The BandwidthInMbps. + */ + private Integer bandwidthInMbps; + + /** + * Creates an instance of ExpressRouteCircuitServiceProviderProperties class. + */ + public ExpressRouteCircuitServiceProviderProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceProviderName", this.serviceProviderName); + jsonWriter.writeStringField("peeringLocation", this.peeringLocation); + jsonWriter.writeNumberField("bandwidthInMbps", this.bandwidthInMbps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitServiceProviderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitServiceProviderProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitServiceProviderProperties. + */ + public static ExpressRouteCircuitServiceProviderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitServiceProviderProperties deserializedExpressRouteCircuitServiceProviderProperties + = new ExpressRouteCircuitServiceProviderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceProviderName".equals(fieldName)) { + deserializedExpressRouteCircuitServiceProviderProperties.serviceProviderName = reader.getString(); + } else if ("peeringLocation".equals(fieldName)) { + deserializedExpressRouteCircuitServiceProviderProperties.peeringLocation = reader.getString(); + } else if ("bandwidthInMbps".equals(fieldName)) { + deserializedExpressRouteCircuitServiceProviderProperties.bandwidthInMbps + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitServiceProviderProperties; + }); + } +} 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..b70b53d62fa98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSku.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains SKU in an ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCircuitSku implements JsonSerializable { + /* + * The name of the SKU. + */ + private String name; + + /* + * The tier of the SKU. + */ + private ExpressRouteCircuitSkuTier tier; + + /* + * The family of the SKU. + */ + private ExpressRouteCircuitSkuFamily family; + + /** + * Creates an instance of ExpressRouteCircuitSku class. + */ + public ExpressRouteCircuitSku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + jsonWriter.writeStringField("family", this.family == null ? null : this.family.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCircuitSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCircuitSku if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCircuitSku. + */ + public static ExpressRouteCircuitSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCircuitSku deserializedExpressRouteCircuitSku = new ExpressRouteCircuitSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExpressRouteCircuitSku.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedExpressRouteCircuitSku.tier = ExpressRouteCircuitSkuTier.fromString(reader.getString()); + } else if ("family".equals(fieldName)) { + deserializedExpressRouteCircuitSku.family + = ExpressRouteCircuitSkuFamily.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCircuitSku; + }); + } +} 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..90e60f3f7a123 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuFamily.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The family of the SKU. + */ +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 a new instance of ExpressRouteCircuitSkuFamily value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteCircuitSkuFamily() { + } + + /** + * Creates or finds a ExpressRouteCircuitSkuFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitSkuFamily. + */ + public static ExpressRouteCircuitSkuFamily fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuFamily.class); + } + + /** + * Gets known ExpressRouteCircuitSkuFamily values. + * + * @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..da44773f5d742 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitSkuTier.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 java.util.Collection; + +/** + * The tier of the SKU. + */ +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 a new instance of ExpressRouteCircuitSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteCircuitSkuTier() { + } + + /** + * Creates or finds a ExpressRouteCircuitSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteCircuitSkuTier. + */ + public static ExpressRouteCircuitSkuTier fromString(String name) { + return fromString(name, ExpressRouteCircuitSkuTier.class); + } + + /** + * Gets known ExpressRouteCircuitSkuTier values. + * + * @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..e41bdcf0ae878 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitStats.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.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..60764d624a612 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuits.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getStatsWithResponse(String resourceGroupName, String circuitName, + 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 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 along with {@link Response}. + */ + Response getPeeringStatsWithResponse(String resourceGroupName, String circuitName, + String peeringName, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..c32faf946372e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsArpTableListResult.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.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..d58f31db9ea90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableListResult.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.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..154baef134427 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCircuitsRoutesTableSummaryListResult.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.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..122ec55b72de1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnection.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.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 enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + Boolean enablePrivateLinkFastPath(); + + /** + * 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..cbd57deda0274 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionId.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ID of the ExpressRouteConnection. + */ +@Immutable +public final class ExpressRouteConnectionId implements JsonSerializable { + /* + * The ID of the ExpressRouteConnection. + */ + private String id; + + /** + * Creates an instance of ExpressRouteConnectionId class. + */ + public ExpressRouteConnectionId() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteConnectionId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteConnectionId if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteConnectionId. + */ + public static ExpressRouteConnectionId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteConnectionId deserializedExpressRouteConnectionId = new ExpressRouteConnectionId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExpressRouteConnectionId.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteConnectionId; + }); + } +} 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..b05cc1e672343 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnectionList.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.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..fdbd5243857d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteConnections.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String expressRouteGatewayName, + String connectionName, 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); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String expressRouteGatewayName, + 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); +} 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..4949188f8a09f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnection.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..25e50850ff66b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListExpressRouteCrossConnection API service call. + */ +@Fluent +public final class ExpressRouteCrossConnectionListResult + implements JsonSerializable { + /* + * A list of ExpressRouteCrossConnection resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCrossConnectionListResult class. + */ + public ExpressRouteCrossConnectionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCrossConnectionListResult. + */ + public static ExpressRouteCrossConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionListResult deserializedExpressRouteCrossConnectionListResult + = new ExpressRouteCrossConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCrossConnectionInner.fromJson(reader1)); + deserializedExpressRouteCrossConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCrossConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionListResult; + }); + } +} 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..a99bd8ae64288 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeering.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.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..d0e1e9e16623f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeeringList.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCrossConnection. + */ +@Fluent +public final class ExpressRouteCrossConnectionPeeringList + implements JsonSerializable { + /* + * The peerings in an express route cross connection. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteCrossConnectionPeeringList class. + */ + public ExpressRouteCrossConnectionPeeringList() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionPeeringList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionPeeringList if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCrossConnectionPeeringList. + */ + public static ExpressRouteCrossConnectionPeeringList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionPeeringList deserializedExpressRouteCrossConnectionPeeringList + = new ExpressRouteCrossConnectionPeeringList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteCrossConnectionPeeringInner.fromJson(reader1)); + deserializedExpressRouteCrossConnectionPeeringList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteCrossConnectionPeeringList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionPeeringList; + }); + } +} 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..16abd77b440ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionPeerings.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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..68e428fe9251d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionRoutesTableSummary.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The routes table associated with the ExpressRouteCircuit. + */ +@Fluent +public final class ExpressRouteCrossConnectionRoutesTableSummary + implements JsonSerializable { + /* + * IP address of Neighbor router. + */ + private String neighbor; + + /* + * Autonomous system number. + */ + 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. + */ + private String upDown; + + /* + * Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer + * group. + */ + private String stateOrPrefixesReceived; + + /** + * Creates an instance of ExpressRouteCrossConnectionRoutesTableSummary class. + */ + public ExpressRouteCrossConnectionRoutesTableSummary() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("neighbor", this.neighbor); + jsonWriter.writeNumberField("asn", this.asn); + jsonWriter.writeStringField("upDown", this.upDown); + jsonWriter.writeStringField("stateOrPrefixesReceived", this.stateOrPrefixesReceived); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteCrossConnectionRoutesTableSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteCrossConnectionRoutesTableSummary if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteCrossConnectionRoutesTableSummary. + */ + public static ExpressRouteCrossConnectionRoutesTableSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteCrossConnectionRoutesTableSummary deserializedExpressRouteCrossConnectionRoutesTableSummary + = new ExpressRouteCrossConnectionRoutesTableSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("neighbor".equals(fieldName)) { + deserializedExpressRouteCrossConnectionRoutesTableSummary.neighbor = reader.getString(); + } else if ("asn".equals(fieldName)) { + deserializedExpressRouteCrossConnectionRoutesTableSummary.asn + = reader.getNullable(JsonReader::getInt); + } else if ("upDown".equals(fieldName)) { + deserializedExpressRouteCrossConnectionRoutesTableSummary.upDown = reader.getString(); + } else if ("stateOrPrefixesReceived".equals(fieldName)) { + deserializedExpressRouteCrossConnectionRoutesTableSummary.stateOrPrefixesReceived + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteCrossConnectionRoutesTableSummary; + }); + } +} 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..93f4c8165d8c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnections.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.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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Retrieves all the ExpressRouteCrossConnections in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=name eq + * '{circuitServiceKey}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String filter, 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String crossConnectionName, 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 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..eee08161aa332 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteCrossConnectionsRoutesTableSummaryListResult.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.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..44223bd17c2ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateway.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ExpressRouteConnectionInner; +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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 allowNonVirtualWanTraffic property: Configures this gateway to accept traffic from non Virtual WAN + * networks. + * + * @return the allowNonVirtualWanTraffic value. + */ + Boolean allowNonVirtualWanTraffic(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithExpressRouteConnections, DefinitionStages.WithVirtualHub, + DefinitionStages.WithAllowNonVirtualWanTraffic { + /** + * 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 expressRouteConnections. + */ + interface WithExpressRouteConnections { + /** + * Specifies the expressRouteConnections property: List of ExpressRoute connections to the ExpressRoute + * gateway.. + * + * @param expressRouteConnections List of ExpressRoute connections to the ExpressRoute gateway. + * @return the next definition stage. + */ + WithCreate withExpressRouteConnections(List expressRouteConnections); + } + + /** + * 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); + } + + /** + * The stage of the ExpressRouteGateway definition allowing to specify allowNonVirtualWanTraffic. + */ + interface WithAllowNonVirtualWanTraffic { + /** + * Specifies the allowNonVirtualWanTraffic property: Configures this gateway to accept traffic from non + * Virtual WAN networks.. + * + * @param allowNonVirtualWanTraffic Configures this gateway to accept traffic from non Virtual WAN networks. + * @return the next definition stage. + */ + WithCreate withAllowNonVirtualWanTraffic(Boolean allowNonVirtualWanTraffic); + } + } + + /** + * 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..52f608fd4a2cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayList.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.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..e9c9f8b80e1d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfiguration.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for auto scaling. + */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfiguration + implements JsonSerializable { + /* + * Minimum and maximum number of scale units to deploy. + */ + private ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds bounds; + + /** + * Creates an instance of ExpressRouteGatewayPropertiesAutoScaleConfiguration class. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfiguration() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("bounds", this.bounds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteGatewayPropertiesAutoScaleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteGatewayPropertiesAutoScaleConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteGatewayPropertiesAutoScaleConfiguration. + */ + public static ExpressRouteGatewayPropertiesAutoScaleConfiguration fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteGatewayPropertiesAutoScaleConfiguration deserializedExpressRouteGatewayPropertiesAutoScaleConfiguration + = new ExpressRouteGatewayPropertiesAutoScaleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bounds".equals(fieldName)) { + deserializedExpressRouteGatewayPropertiesAutoScaleConfiguration.bounds + = ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteGatewayPropertiesAutoScaleConfiguration; + }); + } +} 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..aee460dbb89d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Minimum and maximum number of scale units to deploy. + */ +@Fluent +public final class ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds + implements JsonSerializable { + /* + * Minimum number of scale units deployed for ExpressRoute gateway. + */ + private Integer min; + + /* + * Maximum number of scale units deployed for ExpressRoute gateway. + */ + private Integer max; + + /** + * Creates an instance of ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds class. + */ + public ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("min", this.min); + jsonWriter.writeNumberField("max", this.max); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds. + */ + public static ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds deserializedExpressRouteGatewayPropertiesAutoScaleConfigurationBounds + = new ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("min".equals(fieldName)) { + deserializedExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.min + = reader.getNullable(JsonReader::getInt); + } else if ("max".equals(fieldName)) { + deserializedExpressRouteGatewayPropertiesAutoScaleConfigurationBounds.max + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteGatewayPropertiesAutoScaleConfigurationBounds; + }); + } +} 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..da476083e0e30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteGateways.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.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ExpressRouteGateways. + */ +public interface ExpressRouteGateways { + /** + * 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 along with {@link Response}. + */ + Response listBySubscriptionWithResponse(Context context); + + /** + * 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 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 along with {@link Response}. + */ + Response listByResourceGroupWithResponse(String resourceGroupName, 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); + + /** + * 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String expressRouteGatewayName, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..2446ad748d87d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLink.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.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 coloLocation property: Cololocation for ExpressRoute Hybrid Direct. + * + * @return the coloLocation value. + */ + String coloLocation(); + + /** + * 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..91fcfd550b755 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkAdminState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Administrative state of the physical port. + */ +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 a new instance of ExpressRouteLinkAdminState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteLinkAdminState() { + } + + /** + * Creates or finds a ExpressRouteLinkAdminState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkAdminState. + */ + public static ExpressRouteLinkAdminState fromString(String name) { + return fromString(name, ExpressRouteLinkAdminState.class); + } + + /** + * Gets known ExpressRouteLinkAdminState values. + * + * @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..bd2f70db29a1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkConnectorType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Physical fiber port type. + */ +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 a new instance of ExpressRouteLinkConnectorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteLinkConnectorType() { + } + + /** + * Creates or finds a ExpressRouteLinkConnectorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkConnectorType. + */ + public static ExpressRouteLinkConnectorType fromString(String name) { + return fromString(name, ExpressRouteLinkConnectorType.class); + } + + /** + * Gets known ExpressRouteLinkConnectorType values. + * + * @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..62ffe8c960871 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRouteLink List Result + * + * Response for ListExpressRouteLinks API service call. + */ +@Fluent +public final class ExpressRouteLinkListResult implements JsonSerializable { + /* + * The list of ExpressRouteLink sub-resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteLinkListResult class. + */ + public ExpressRouteLinkListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteLinkListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteLinkListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteLinkListResult. + */ + public static ExpressRouteLinkListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteLinkListResult deserializedExpressRouteLinkListResult = new ExpressRouteLinkListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteLinkInner.fromJson(reader1)); + deserializedExpressRouteLinkListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteLinkListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteLinkListResult; + }); + } +} 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..fbb33ea5cd166 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecCipher.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 java.util.Collection; + +/** + * Mac security cipher. + */ +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 a new instance of ExpressRouteLinkMacSecCipher value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteLinkMacSecCipher() { + } + + /** + * Creates or finds a ExpressRouteLinkMacSecCipher from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkMacSecCipher. + */ + public static ExpressRouteLinkMacSecCipher fromString(String name) { + return fromString(name, ExpressRouteLinkMacSecCipher.class); + } + + /** + * Gets known ExpressRouteLinkMacSecCipher values. + * + * @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..33ae9ed36930f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecConfig.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of ExpressRouteLink Mac Security configuration. + * + * ExpressRouteLink Mac Security Configuration. + */ +@Fluent +public final class ExpressRouteLinkMacSecConfig implements JsonSerializable { + /* + * Keyvault Secret Identifier URL containing Mac security CKN key. + */ + private String cknSecretIdentifier; + + /* + * Keyvault Secret Identifier URL containing Mac security CAK key. + */ + private String cakSecretIdentifier; + + /* + * Mac security cipher. + */ + private ExpressRouteLinkMacSecCipher cipher; + + /* + * Sci mode enabled/disabled. + */ + private ExpressRouteLinkMacSecSciState sciState; + + /** + * Creates an instance of ExpressRouteLinkMacSecConfig class. + */ + public ExpressRouteLinkMacSecConfig() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cknSecretIdentifier", this.cknSecretIdentifier); + jsonWriter.writeStringField("cakSecretIdentifier", this.cakSecretIdentifier); + jsonWriter.writeStringField("cipher", this.cipher == null ? null : this.cipher.toString()); + jsonWriter.writeStringField("sciState", this.sciState == null ? null : this.sciState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteLinkMacSecConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteLinkMacSecConfig if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteLinkMacSecConfig. + */ + public static ExpressRouteLinkMacSecConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteLinkMacSecConfig deserializedExpressRouteLinkMacSecConfig = new ExpressRouteLinkMacSecConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cknSecretIdentifier".equals(fieldName)) { + deserializedExpressRouteLinkMacSecConfig.cknSecretIdentifier = reader.getString(); + } else if ("cakSecretIdentifier".equals(fieldName)) { + deserializedExpressRouteLinkMacSecConfig.cakSecretIdentifier = reader.getString(); + } else if ("cipher".equals(fieldName)) { + deserializedExpressRouteLinkMacSecConfig.cipher + = ExpressRouteLinkMacSecCipher.fromString(reader.getString()); + } else if ("sciState".equals(fieldName)) { + deserializedExpressRouteLinkMacSecConfig.sciState + = ExpressRouteLinkMacSecSciState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteLinkMacSecConfig; + }); + } +} 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..788baa6f62f5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinkMacSecSciState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Sci mode enabled/disabled. + */ +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 a new instance of ExpressRouteLinkMacSecSciState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRouteLinkMacSecSciState() { + } + + /** + * Creates or finds a ExpressRouteLinkMacSecSciState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRouteLinkMacSecSciState. + */ + public static ExpressRouteLinkMacSecSciState fromString(String name) { + return fromString(name, ExpressRouteLinkMacSecSciState.class); + } + + /** + * Gets known ExpressRouteLinkMacSecSciState values. + * + * @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..0210eb87f0b2d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteLinks.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String expressRoutePortName, String linkName, + 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 com.azure.core.management.exception.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. + */ + ExpressRouteLink get(String resourceGroupName, String expressRoutePortName, String linkName); + + /** + * 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 expressRouteLink List Result as paginated response with {@link PagedIterable}. + */ + 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 expressRouteLink List Result as paginated response with {@link PagedIterable}. + */ + 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..1e10175b97853 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of peering. + */ +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 a new instance of ExpressRoutePeeringState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRoutePeeringState() { + } + + /** + * Creates or finds a ExpressRoutePeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePeeringState. + */ + public static ExpressRoutePeeringState fromString(String name) { + return fromString(name, ExpressRoutePeeringState.class); + } + + /** + * Gets known ExpressRoutePeeringState values. + * + * @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..6c852e5ff7177 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePeeringType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The peering type. + */ +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 a new instance of ExpressRoutePeeringType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRoutePeeringType() { + } + + /** + * Creates or finds a ExpressRoutePeeringType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePeeringType. + */ + public static ExpressRoutePeeringType fromString(String name) { + return fromString(name, ExpressRoutePeeringType.class); + } + + /** + * Gets known ExpressRoutePeeringType values. + * + * @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..80d59f3081a35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePort.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 billingType property: The billing type of the ExpressRoutePort resource. + * + * @return the billingType value. + */ + ExpressRoutePortsBillingType billingType(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, DefinitionStages.WithBillingType { + /** + * 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); + } + + /** + * The stage of the ExpressRoutePort definition allowing to specify billingType. + */ + interface WithBillingType { + /** + * Specifies the billingType property: The billing type of the ExpressRoutePort resource.. + * + * @param billingType The billing type of the ExpressRoutePort resource. + * @return the next definition stage. + */ + WithCreate withBillingType(ExpressRoutePortsBillingType billingType); + } + } + + /** + * 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/ExpressRoutePortAuthorization.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorization.java new file mode 100644 index 0000000000000..e04eb60b158e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorization.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner; + +/** + * An immutable client-side representation of ExpressRoutePortAuthorization. + */ +public interface ExpressRoutePortAuthorization { + /** + * 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. + */ + ExpressRoutePortAuthorizationUseStatus authorizationUseStatus(); + + /** + * Gets the circuitResourceUri property: The reference to the ExpressRoute circuit resource using the authorization. + * + * @return the circuitResourceUri value. + */ + String circuitResourceUri(); + + /** + * Gets the provisioningState property: The provisioning state of the authorization resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner + * object. + * + * @return the inner object. + */ + ExpressRoutePortAuthorizationInner innerModel(); + + /** + * The entirety of the ExpressRoutePortAuthorization definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ExpressRoutePortAuthorization definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ExpressRoutePortAuthorization definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ExpressRoutePortAuthorization definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, expressRoutePortName. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @return the next definition stage. + */ + WithCreate withExistingExpressRoutePort(String resourceGroupName, String expressRoutePortName); + } + + /** + * The stage of the ExpressRoutePortAuthorization 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExpressRoutePortAuthorization create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExpressRoutePortAuthorization create(Context context); + } + + /** + * The stage of the ExpressRoutePortAuthorization 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); + } + } + + /** + * Begins update for the ExpressRoutePortAuthorization resource. + * + * @return the stage of resource update. + */ + ExpressRoutePortAuthorization.Update update(); + + /** + * The template for ExpressRoutePortAuthorization update. + */ + interface Update extends UpdateStages.WithName { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExpressRoutePortAuthorization apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExpressRoutePortAuthorization apply(Context context); + } + + /** + * The ExpressRoutePortAuthorization update stages. + */ + interface UpdateStages { + /** + * The stage of the ExpressRoutePortAuthorization 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExpressRoutePortAuthorization refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExpressRoutePortAuthorization refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationListResult.java new file mode 100644 index 0000000000000..a74b1521f4afa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortAuthorizationInner; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRoute Port Authorization List Result + * + * Response for ListExpressRoutePortAuthorizations API service call. + */ +@Fluent +public final class ExpressRoutePortAuthorizationListResult + implements JsonSerializable { + /* + * The authorizations in an ExpressRoute Port. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRoutePortAuthorizationListResult class. + */ + public ExpressRoutePortAuthorizationListResult() { + } + + /** + * Get the value property: The authorizations in an ExpressRoute Port. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The authorizations in an ExpressRoute Port. + * + * @param value the value value to set. + * @return the ExpressRoutePortAuthorizationListResult object itself. + */ + public ExpressRoutePortAuthorizationListResult 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 ExpressRoutePortAuthorizationListResult object itself. + */ + public ExpressRoutePortAuthorizationListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortAuthorizationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortAuthorizationListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortAuthorizationListResult. + */ + public static ExpressRoutePortAuthorizationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortAuthorizationListResult deserializedExpressRoutePortAuthorizationListResult + = new ExpressRoutePortAuthorizationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRoutePortAuthorizationInner.fromJson(reader1)); + deserializedExpressRoutePortAuthorizationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRoutePortAuthorizationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortAuthorizationListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationUseStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationUseStatus.java new file mode 100644 index 0000000000000..6cd44cb5ffce6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizationUseStatus.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 java.util.Collection; + +/** + * The authorization use status. + */ +public final class ExpressRoutePortAuthorizationUseStatus + extends ExpandableStringEnum { + /** + * Static value Available for ExpressRoutePortAuthorizationUseStatus. + */ + public static final ExpressRoutePortAuthorizationUseStatus AVAILABLE = fromString("Available"); + + /** + * Static value InUse for ExpressRoutePortAuthorizationUseStatus. + */ + public static final ExpressRoutePortAuthorizationUseStatus IN_USE = fromString("InUse"); + + /** + * Creates a new instance of ExpressRoutePortAuthorizationUseStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRoutePortAuthorizationUseStatus() { + } + + /** + * Creates or finds a ExpressRoutePortAuthorizationUseStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePortAuthorizationUseStatus. + */ + public static ExpressRoutePortAuthorizationUseStatus fromString(String name) { + return fromString(name, ExpressRoutePortAuthorizationUseStatus.class); + } + + /** + * Gets known ExpressRoutePortAuthorizationUseStatus values. + * + * @return known ExpressRoutePortAuthorizationUseStatus values. + */ + public static Collection values() { + return values(ExpressRoutePortAuthorizationUseStatus.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizations.java new file mode 100644 index 0000000000000..64ce4c75336e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortAuthorizations.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.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 ExpressRoutePortAuthorizations. + */ +public interface ExpressRoutePortAuthorizations { + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 expressRoutePortName, String authorizationName); + + /** + * Deletes the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 expressRoutePortName, String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String expressRoutePortName, + String authorizationName, Context context); + + /** + * Gets the specified authorization from the specified express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @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 port. + */ + ExpressRoutePortAuthorization get(String resourceGroupName, String expressRoutePortName, String authorizationName); + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 port as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String expressRoutePortName); + + /** + * Gets all authorizations in an express route port. + * + * @param resourceGroupName The name of the resource group. + * @param expressRoutePortName The name of the express route port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 port as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String expressRoutePortName, + Context context); + + /** + * Gets the specified authorization from the specified express route port. + * + * @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 port along with {@link Response}. + */ + ExpressRoutePortAuthorization getById(String id); + + /** + * Gets the specified authorization from the specified express route port. + * + * @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 port along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified authorization from the specified express route port. + * + * @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 port. + * + * @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 ExpressRoutePortAuthorization resource. + * + * @param name resource name. + * @return the first stage of the new ExpressRoutePortAuthorization definition. + */ + ExpressRoutePortAuthorization.DefinitionStages.Blank define(String name); +} 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..8d59a4f5fc11a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortInner; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRoute Port List Result + * + * Response for ListExpressRoutePorts API service call. + */ +@Fluent +public final class ExpressRoutePortListResult implements JsonSerializable { + /* + * A list of ExpressRoutePort resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRoutePortListResult class. + */ + public ExpressRoutePortListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortListResult. + */ + public static ExpressRoutePortListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortListResult deserializedExpressRoutePortListResult = new ExpressRoutePortListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRoutePortInner.fromJson(reader1)); + deserializedExpressRoutePortListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRoutePortListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortListResult; + }); + } +} 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..c935e5974d511 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePorts.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Port along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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 expressRoute Port. + */ + ExpressRoutePort getByResourceGroup(String resourceGroupName, String expressRoutePortName); + + /** + * 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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + 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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + 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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + 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 expressRoute Port List Result as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response generateLoaWithResponse(String resourceGroupName, + String expressRoutePortName, GenerateExpressRoutePortsLoaRequest request, 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); + + /** + * 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 expressRoute Port along with {@link Response}. + */ + 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 expressRoute Port along with {@link Response}. + */ + 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/ExpressRoutePortsBillingType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsBillingType.java new file mode 100644 index 0000000000000..303760604a158 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsBillingType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The billing type of the ExpressRoutePort resource. + */ +public final class ExpressRoutePortsBillingType extends ExpandableStringEnum { + /** + * Static value MeteredData for ExpressRoutePortsBillingType. + */ + public static final ExpressRoutePortsBillingType METERED_DATA = fromString("MeteredData"); + + /** + * Static value UnlimitedData for ExpressRoutePortsBillingType. + */ + public static final ExpressRoutePortsBillingType UNLIMITED_DATA = fromString("UnlimitedData"); + + /** + * Creates a new instance of ExpressRoutePortsBillingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRoutePortsBillingType() { + } + + /** + * Creates or finds a ExpressRoutePortsBillingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePortsBillingType. + */ + public static ExpressRoutePortsBillingType fromString(String name) { + return fromString(name, ExpressRoutePortsBillingType.class); + } + + /** + * Gets known ExpressRoutePortsBillingType values. + * + * @return known ExpressRoutePortsBillingType values. + */ + public static Collection values() { + return values(ExpressRoutePortsBillingType.class); + } +} 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..3c23e4e91a6e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsEncapsulation.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Encapsulation method on physical ports. + */ +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 a new instance of ExpressRoutePortsEncapsulation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressRoutePortsEncapsulation() { + } + + /** + * Creates or finds a ExpressRoutePortsEncapsulation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressRoutePortsEncapsulation. + */ + public static ExpressRoutePortsEncapsulation fromString(String name) { + return fromString(name, ExpressRoutePortsEncapsulation.class); + } + + /** + * Gets known ExpressRoutePortsEncapsulation values. + * + * @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..499087c4c66f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocation.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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..4ea3fbb0ef6b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationBandwidths.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ExpressRoutePorts Location Bandwidths + * + * Real-time inventory of available ExpressRoute port bandwidths. + */ +@Immutable +public final class ExpressRoutePortsLocationBandwidths + implements JsonSerializable { + /* + * Bandwidth descriptive name. + */ + private String offerName; + + /* + * Bandwidth value in Gbps. + */ + private Integer valueInGbps; + + /** + * Creates an instance of ExpressRoutePortsLocationBandwidths class. + */ + public ExpressRoutePortsLocationBandwidths() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortsLocationBandwidths from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortsLocationBandwidths if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortsLocationBandwidths. + */ + public static ExpressRoutePortsLocationBandwidths fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortsLocationBandwidths deserializedExpressRoutePortsLocationBandwidths + = new ExpressRoutePortsLocationBandwidths(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offerName".equals(fieldName)) { + deserializedExpressRoutePortsLocationBandwidths.offerName = reader.getString(); + } else if ("valueInGbps".equals(fieldName)) { + deserializedExpressRoutePortsLocationBandwidths.valueInGbps + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortsLocationBandwidths; + }); + } +} 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..213688ea61200 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRoutePortsLocationInner; +import java.io.IOException; +import java.util.List; + +/** + * ExpressRoutePorts Location List Result + * + * Response for ListExpressRoutePortsLocations API service call. + */ +@Fluent +public final class ExpressRoutePortsLocationListResult + implements JsonSerializable { + /* + * The list of all ExpressRoutePort peering locations. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRoutePortsLocationListResult class. + */ + public ExpressRoutePortsLocationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRoutePortsLocationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRoutePortsLocationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRoutePortsLocationListResult. + */ + public static ExpressRoutePortsLocationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRoutePortsLocationListResult deserializedExpressRoutePortsLocationListResult + = new ExpressRoutePortsLocationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRoutePortsLocationInner.fromJson(reader1)); + deserializedExpressRoutePortsLocationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRoutePortsLocationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRoutePortsLocationListResult; + }); + } +} 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..21a07fb1ab8b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRoutePortsLocations.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.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 expressRoutePorts Location List Result as paginated response with {@link PagedIterable}. + */ + 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 expressRoutePorts Location List Result as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRoutePorts Peering Location along with {@link Response}. + */ + Response getWithResponse(String locationName, 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 expressRoutePorts Peering Location. + */ + ExpressRoutePortsLocation get(String locationName); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPort.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPort.java new file mode 100644 index 0000000000000..568ef8430a070 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPort.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.models; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortInner; +import java.util.Map; + +/** + * An immutable client-side representation of ExpressRouteProviderPort. + */ +public interface ExpressRouteProviderPort { + /** + * 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the portPairDescriptor property: The name of the port pair. + * + * @return the portPairDescriptor value. + */ + String portPairDescriptor(); + + /** + * 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 peeringLocation property: The peering location of the port pair. + * + * @return the peeringLocation value. + */ + String peeringLocation(); + + /** + * Gets the overprovisionFactor property: Overprovisioning factor for the port pair. + * + * @return the overprovisionFactor value. + */ + Integer overprovisionFactor(); + + /** + * Gets the portBandwidthInMbps property: Bandwidth of the port in Mbps. + * + * @return the portBandwidthInMbps value. + */ + Integer portBandwidthInMbps(); + + /** + * Gets the usedBandwidthInMbps property: Used Bandwidth of the port in Mbps. + * + * @return the usedBandwidthInMbps value. + */ + Integer usedBandwidthInMbps(); + + /** + * Gets the remainingBandwidthInMbps property: Remaining Bandwidth of the port in Mbps. + * + * @return the remainingBandwidthInMbps value. + */ + Integer remainingBandwidthInMbps(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortInner object. + * + * @return the inner object. + */ + ExpressRouteProviderPortInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortListResult.java new file mode 100644 index 0000000000000..94535cd898d09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortListResult.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.resourcemanager.network.generated.fluent.models.ExpressRouteProviderPortListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of ExpressRouteProviderPortListResult. + */ +public interface ExpressRouteProviderPortListResult { + /** + * Gets the value property: A list of ExpressRouteProviderPort resources. + * + * @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.ExpressRouteProviderPortListResultInner + * object. + * + * @return the inner object. + */ + ExpressRouteProviderPortListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortsLocations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortsLocations.java new file mode 100644 index 0000000000000..07d2e6d1ac43d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteProviderPortsLocations.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.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ExpressRouteProviderPortsLocations. + */ +public interface ExpressRouteProviderPortsLocations { + /** + * Retrieves all the ExpressRouteProviderPorts in a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=location eq '{state}'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ListExpressRouteProviderPort API service call along with {@link Response}. + */ + Response listWithResponse(String filter, Context context); + + /** + * Retrieves all the ExpressRouteProviderPorts 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 ListExpressRouteProviderPort API service call. + */ + ExpressRouteProviderPortListResult list(); +} 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..f4d902e0764f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProvider.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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..d56f47c78591d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderBandwidthsOffered.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains bandwidths offered in ExpressRouteServiceProvider resources. + */ +@Fluent +public final class ExpressRouteServiceProviderBandwidthsOffered + implements JsonSerializable { + /* + * The OfferName. + */ + private String offerName; + + /* + * The ValueInMbps. + */ + private Integer valueInMbps; + + /** + * Creates an instance of ExpressRouteServiceProviderBandwidthsOffered class. + */ + public ExpressRouteServiceProviderBandwidthsOffered() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("offerName", this.offerName); + jsonWriter.writeNumberField("valueInMbps", this.valueInMbps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteServiceProviderBandwidthsOffered from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteServiceProviderBandwidthsOffered if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteServiceProviderBandwidthsOffered. + */ + public static ExpressRouteServiceProviderBandwidthsOffered fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteServiceProviderBandwidthsOffered deserializedExpressRouteServiceProviderBandwidthsOffered + = new ExpressRouteServiceProviderBandwidthsOffered(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("offerName".equals(fieldName)) { + deserializedExpressRouteServiceProviderBandwidthsOffered.offerName = reader.getString(); + } else if ("valueInMbps".equals(fieldName)) { + deserializedExpressRouteServiceProviderBandwidthsOffered.valueInMbps + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteServiceProviderBandwidthsOffered; + }); + } +} 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..32a22ff091153 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviderListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteServiceProviderInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListExpressRouteServiceProvider API service call. + */ +@Fluent +public final class ExpressRouteServiceProviderListResult + implements JsonSerializable { + /* + * A list of ExpressRouteResourceProvider resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ExpressRouteServiceProviderListResult class. + */ + public ExpressRouteServiceProviderListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExpressRouteServiceProviderListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExpressRouteServiceProviderListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExpressRouteServiceProviderListResult. + */ + public static ExpressRouteServiceProviderListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExpressRouteServiceProviderListResult deserializedExpressRouteServiceProviderListResult + = new ExpressRouteServiceProviderListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExpressRouteServiceProviderInner.fromJson(reader1)); + deserializedExpressRouteServiceProviderListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExpressRouteServiceProviderListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExpressRouteServiceProviderListResult; + }); + } +} 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..d3eac7f8ca181 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExpressRouteServiceProviders.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..f065b393f7e10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocation.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ExtendedLocation complex type. + */ +@Fluent +public final class ExtendedLocation implements JsonSerializable { + /* + * The name of the extended location. + */ + private String name; + + /* + * The type of the extended location. + */ + private ExtendedLocationTypes type; + + /** + * Creates an instance of ExtendedLocation class. + */ + public ExtendedLocation() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtendedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtendedLocation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ExtendedLocation. + */ + public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = ExtendedLocationTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExtendedLocation; + }); + } +} 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..54fd0d14baf06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ExtendedLocationTypes.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 java.util.Collection; + +/** + * The supported ExtendedLocation types. Currently only EdgeZone is supported in Microsoft.Network resources. + */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** + * Static value EdgeZone for ExtendedLocationTypes. + */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates a new instance of ExtendedLocationTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedLocationTypes() { + } + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** + * Gets known ExtendedLocationTypes values. + * + * @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/FilterItems.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FilterItems.java new file mode 100644 index 0000000000000..8815f9d58812f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FilterItems.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Will contain the filter name and values to operate on. + */ +@Fluent +public final class FilterItems implements JsonSerializable { + /* + * The name of the field we would like to filter + */ + private String field; + + /* + * List of values to filter the current field by + */ + private List values; + + /** + * Creates an instance of FilterItems class. + */ + public FilterItems() { + } + + /** + * Get the field property: The name of the field we would like to filter. + * + * @return the field value. + */ + public String field() { + return this.field; + } + + /** + * Set the field property: The name of the field we would like to filter. + * + * @param field the field value to set. + * @return the FilterItems object itself. + */ + public FilterItems withField(String field) { + this.field = field; + return this; + } + + /** + * Get the values property: List of values to filter the current field by. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: List of values to filter the current field by. + * + * @param values the values value to set. + * @return the FilterItems object itself. + */ + public FilterItems withValues(List values) { + this.values = values; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FilterItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FilterItems if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FilterItems. + */ + public static FilterItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FilterItems deserializedFilterItems = new FilterItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("field".equals(fieldName)) { + deserializedFilterItems.field = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedFilterItems.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedFilterItems; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPacketCaptureParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPacketCaptureParameters.java new file mode 100644 index 0000000000000..ac32ab47f5b93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPacketCaptureParameters.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Azure Firewall Packet Capture Parameters. + */ +@Fluent +public final class FirewallPacketCaptureParameters implements JsonSerializable { + /* + * Duration of packet capture in seconds. + */ + private Integer durationInSeconds; + + /* + * Number of packets to be captured. + */ + private Integer numberOfPacketsToCapture; + + /* + * Upload capture location + */ + private String sasUrl; + + /* + * Name of file to be uploaded to sasURL + */ + private String fileName; + + /* + * The protocol of packets to capture + */ + private AzureFirewallNetworkRuleProtocol protocol; + + /* + * The tcp-flag type to be captured. Used with protocol TCP + */ + private List flags; + + /* + * Rules to filter packet captures. + */ + private List filters; + + /** + * Creates an instance of FirewallPacketCaptureParameters class. + */ + public FirewallPacketCaptureParameters() { + } + + /** + * Get the durationInSeconds property: Duration of packet capture in seconds. + * + * @return the durationInSeconds value. + */ + public Integer durationInSeconds() { + return this.durationInSeconds; + } + + /** + * Set the durationInSeconds property: Duration of packet capture in seconds. + * + * @param durationInSeconds the durationInSeconds value to set. + * @return the FirewallPacketCaptureParameters object itself. + */ + public FirewallPacketCaptureParameters withDurationInSeconds(Integer durationInSeconds) { + this.durationInSeconds = durationInSeconds; + return this; + } + + /** + * Get the numberOfPacketsToCapture property: Number of packets to be captured. + * + * @return the numberOfPacketsToCapture value. + */ + public Integer numberOfPacketsToCapture() { + return this.numberOfPacketsToCapture; + } + + /** + * Set the numberOfPacketsToCapture property: Number of packets to be captured. + * + * @param numberOfPacketsToCapture the numberOfPacketsToCapture value to set. + * @return the FirewallPacketCaptureParameters object itself. + */ + public FirewallPacketCaptureParameters withNumberOfPacketsToCapture(Integer numberOfPacketsToCapture) { + this.numberOfPacketsToCapture = numberOfPacketsToCapture; + return this; + } + + /** + * Get the sasUrl property: Upload capture location. + * + * @return the sasUrl value. + */ + public String sasUrl() { + return this.sasUrl; + } + + /** + * Set the sasUrl property: Upload capture location. + * + * @param sasUrl the sasUrl value to set. + * @return the FirewallPacketCaptureParameters object itself. + */ + public FirewallPacketCaptureParameters withSasUrl(String sasUrl) { + this.sasUrl = sasUrl; + return this; + } + + /** + * Get the fileName property: Name of file to be uploaded to sasURL. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: Name of file to be uploaded to sasURL. + * + * @param fileName the fileName value to set. + * @return the FirewallPacketCaptureParameters object itself. + */ + public FirewallPacketCaptureParameters withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the protocol property: The protocol of packets to capture. + * + * @return the protocol value. + */ + public AzureFirewallNetworkRuleProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol of packets to capture. + * + * @param protocol the protocol value to set. + * @return the FirewallPacketCaptureParameters object itself. + */ + public FirewallPacketCaptureParameters withProtocol(AzureFirewallNetworkRuleProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the flags property: The tcp-flag type to be captured. Used with protocol TCP. + * + * @return the flags value. + */ + public List flags() { + return this.flags; + } + + /** + * Set the flags property: The tcp-flag type to be captured. Used with protocol TCP. + * + * @param flags the flags value to set. + * @return the FirewallPacketCaptureParameters object itself. + */ + public FirewallPacketCaptureParameters withFlags(List flags) { + this.flags = flags; + return this; + } + + /** + * Get the filters property: Rules to filter packet captures. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: Rules to filter packet captures. + * + * @param filters the filters value to set. + * @return the FirewallPacketCaptureParameters object itself. + */ + public FirewallPacketCaptureParameters withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (flags() != null) { + flags().forEach(e -> e.validate()); + } + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("durationInSeconds", this.durationInSeconds); + jsonWriter.writeNumberField("numberOfPacketsToCapture", this.numberOfPacketsToCapture); + jsonWriter.writeStringField("sasUrl", this.sasUrl); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeArrayField("flags", this.flags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPacketCaptureParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPacketCaptureParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPacketCaptureParameters. + */ + public static FirewallPacketCaptureParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPacketCaptureParameters deserializedFirewallPacketCaptureParameters + = new FirewallPacketCaptureParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("durationInSeconds".equals(fieldName)) { + deserializedFirewallPacketCaptureParameters.durationInSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("numberOfPacketsToCapture".equals(fieldName)) { + deserializedFirewallPacketCaptureParameters.numberOfPacketsToCapture + = reader.getNullable(JsonReader::getInt); + } else if ("sasUrl".equals(fieldName)) { + deserializedFirewallPacketCaptureParameters.sasUrl = reader.getString(); + } else if ("fileName".equals(fieldName)) { + deserializedFirewallPacketCaptureParameters.fileName = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedFirewallPacketCaptureParameters.protocol + = AzureFirewallNetworkRuleProtocol.fromString(reader.getString()); + } else if ("flags".equals(fieldName)) { + List flags + = reader.readArray(reader1 -> AzureFirewallPacketCaptureFlags.fromJson(reader1)); + deserializedFirewallPacketCaptureParameters.flags = flags; + } else if ("filters".equals(fieldName)) { + List filters + = reader.readArray(reader1 -> AzureFirewallPacketCaptureRule.fromJson(reader1)); + deserializedFirewallPacketCaptureParameters.filters = filters; + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPacketCaptureParameters; + }); + } +} 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..420223374d83e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicies.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String firewallPolicyName, + String expand, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..84c42f31411cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicy.java @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the size property: A read-only string that represents the size of the FirewallPolicyPropertiesFormat in MB. + * (ex 0.5MB). + * + * @return the size value. + */ + String size(); + + /** + * 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 sql property: SQL Settings definition. + * + * @return the sql value. + */ + FirewallPolicySql sql(); + + /** + * Gets the dnsSettings property: DNS Proxy Settings definition. + * + * @return the dnsSettings value. + */ + DnsSettings dnsSettings(); + + /** + * Gets the explicitProxy property: Explicit Proxy Settings definition. + * + * @return the explicitProxy value. + */ + ExplicitProxy explicitProxy(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithSql, DefinitionStages.WithDnsSettings, DefinitionStages.WithExplicitProxy, + 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 sql. + */ + interface WithSql { + /** + * Specifies the sql property: SQL Settings definition.. + * + * @param sql SQL Settings definition. + * @return the next definition stage. + */ + WithCreate withSql(FirewallPolicySql sql); + } + + /** + * 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 explicitProxy. + */ + interface WithExplicitProxy { + /** + * Specifies the explicitProxy property: Explicit Proxy Settings definition.. + * + * @param explicitProxy Explicit Proxy Settings definition. + * @return the next definition stage. + */ + WithCreate withExplicitProxy(ExplicitProxy explicitProxy); + } + + /** + * 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 { + /** + * 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); + } + } + + /** + * 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..426d30e4f8014 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyCertificateAuthority.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Trusted Root certificates properties for tls. + */ +@Fluent +public final class FirewallPolicyCertificateAuthority implements JsonSerializable { + /* + * Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. + */ + private String keyVaultSecretId; + + /* + * Name of the CA certificate. + */ + private String name; + + /** + * Creates an instance of FirewallPolicyCertificateAuthority class. + */ + public FirewallPolicyCertificateAuthority() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVaultSecretId", this.keyVaultSecretId); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyCertificateAuthority from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyCertificateAuthority if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyCertificateAuthority. + */ + public static FirewallPolicyCertificateAuthority fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyCertificateAuthority deserializedFirewallPolicyCertificateAuthority + = new FirewallPolicyCertificateAuthority(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyVaultSecretId".equals(fieldName)) { + deserializedFirewallPolicyCertificateAuthority.keyVaultSecretId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFirewallPolicyCertificateAuthority.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyCertificateAuthority; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDeployments.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDeployments.java new file mode 100644 index 0000000000000..a91bbca578645 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDeployments.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 FirewallPolicyDeployments. + */ +public interface FirewallPolicyDeployments { + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 deploy(String resourceGroupName, String firewallPolicyName); + + /** + * Deploys the firewall policy draft and child rule collection group drafts. + * + * @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 deploy(String resourceGroupName, String firewallPolicyName, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDraft.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDraft.java new file mode 100644 index 0000000000000..8031c9e74f3e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDraft.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyDraftInner; +import java.util.Map; + +/** + * An immutable client-side representation of FirewallPolicyDraft. + */ +public interface FirewallPolicyDraft { + /** + * 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the basePolicy property: The parent firewall policy from which rules are inherited. + * + * @return the basePolicy value. + */ + SubResource basePolicy(); + + /** + * 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 sql property: SQL Settings definition. + * + * @return the sql value. + */ + FirewallPolicySql sql(); + + /** + * Gets the dnsSettings property: DNS Proxy Settings definition. + * + * @return the dnsSettings value. + */ + DnsSettings dnsSettings(); + + /** + * Gets the explicitProxy property: Explicit Proxy Settings definition. + * + * @return the explicitProxy value. + */ + ExplicitProxy explicitProxy(); + + /** + * Gets the intrusionDetection property: The configuration for Intrusion detection. + * + * @return the intrusionDetection value. + */ + FirewallPolicyIntrusionDetection intrusionDetection(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyDraftInner object. + * + * @return the inner object. + */ + FirewallPolicyDraftInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDrafts.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDrafts.java new file mode 100644 index 0000000000000..cea27cb657f3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyDrafts.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.FirewallPolicyDraftInner; + +/** + * Resource collection API of FirewallPolicyDrafts. + */ +public interface FirewallPolicyDrafts { + /** + * Create or update a draft 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 Draft 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 along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters, Context context); + + /** + * Create or update a draft 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 Draft operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + FirewallPolicyDraft createOrUpdate(String resourceGroupName, String firewallPolicyName, + FirewallPolicyDraftInner parameters); + + /** + * Delete a draft 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 {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String firewallPolicyName, + Context context); + + /** + * Delete a draft 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); + + /** + * Get a draft 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 a draft Firewall Policy along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String firewallPolicyName, Context context); + + /** + * Get a draft 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 a draft Firewall Policy. + */ + FirewallPolicyDraft get(String resourceGroupName, String firewallPolicyName); +} 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..03cc8e5cb6b2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollection.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Firewall Policy Filter Rule Collection. + */ +@Fluent +public final class FirewallPolicyFilterRuleCollection extends FirewallPolicyRuleCollection { + /* + * The type of the rule collection. + */ + private FirewallPolicyRuleCollectionType ruleCollectionType + = FirewallPolicyRuleCollectionType.FIREWALL_POLICY_FILTER_RULE_COLLECTION; + + /* + * The action type of a Filter rule collection. + */ + private FirewallPolicyFilterRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + private List rules; + + /** + * Creates an instance of FirewallPolicyFilterRuleCollection class. + */ + public FirewallPolicyFilterRuleCollection() { + } + + /** + * Get the ruleCollectionType property: The type of the rule collection. + * + * @return the ruleCollectionType value. + */ + @Override + public FirewallPolicyRuleCollectionType ruleCollectionType() { + return this.ruleCollectionType; + } + + /** + * 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() { + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeNumberField("priority", priority()); + jsonWriter.writeStringField("ruleCollectionType", + this.ruleCollectionType == null ? null : this.ruleCollectionType.toString()); + jsonWriter.writeJsonField("action", this.action); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyFilterRuleCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyFilterRuleCollection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyFilterRuleCollection. + */ + public static FirewallPolicyFilterRuleCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyFilterRuleCollection deserializedFirewallPolicyFilterRuleCollection + = new FirewallPolicyFilterRuleCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFirewallPolicyFilterRuleCollection.withName(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedFirewallPolicyFilterRuleCollection.withPriority(reader.getNullable(JsonReader::getInt)); + } else if ("ruleCollectionType".equals(fieldName)) { + deserializedFirewallPolicyFilterRuleCollection.ruleCollectionType + = FirewallPolicyRuleCollectionType.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedFirewallPolicyFilterRuleCollection.action + = FirewallPolicyFilterRuleCollectionAction.fromJson(reader); + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> FirewallPolicyRule.fromJson(reader1)); + deserializedFirewallPolicyFilterRuleCollection.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyFilterRuleCollection; + }); + } +} 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..a255bfaa0b51f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionAction.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the FirewallPolicyFilterRuleCollectionAction. + */ +@Fluent +public final class FirewallPolicyFilterRuleCollectionAction + implements JsonSerializable { + /* + * The type of action. + */ + private FirewallPolicyFilterRuleCollectionActionType type; + + /** + * Creates an instance of FirewallPolicyFilterRuleCollectionAction class. + */ + public FirewallPolicyFilterRuleCollectionAction() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyFilterRuleCollectionAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyFilterRuleCollectionAction if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyFilterRuleCollectionAction. + */ + public static FirewallPolicyFilterRuleCollectionAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyFilterRuleCollectionAction deserializedFirewallPolicyFilterRuleCollectionAction + = new FirewallPolicyFilterRuleCollectionAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedFirewallPolicyFilterRuleCollectionAction.type + = FirewallPolicyFilterRuleCollectionActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyFilterRuleCollectionAction; + }); + } +} 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..a7a5614488768 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyFilterRuleCollectionActionType.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 java.util.Collection; + +/** + * The action type of a rule. + */ +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 a new instance of FirewallPolicyFilterRuleCollectionActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyFilterRuleCollectionActionType() { + } + + /** + * Creates or finds a FirewallPolicyFilterRuleCollectionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyFilterRuleCollectionActionType. + */ + public static FirewallPolicyFilterRuleCollectionActionType fromString(String name) { + return fromString(name, FirewallPolicyFilterRuleCollectionActionType.class); + } + + /** + * Gets known FirewallPolicyFilterRuleCollectionActionType values. + * + * @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/FirewallPolicyHttpHeaderToInsert.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyHttpHeaderToInsert.java new file mode 100644 index 0000000000000..d41f5a77e23bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyHttpHeaderToInsert.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * name and value of HTTP/S header to insert. + */ +@Fluent +public final class FirewallPolicyHttpHeaderToInsert implements JsonSerializable { + /* + * Contains the name of the header + */ + private String headerName; + + /* + * Contains the value of the header + */ + private String headerValue; + + /** + * Creates an instance of FirewallPolicyHttpHeaderToInsert class. + */ + public FirewallPolicyHttpHeaderToInsert() { + } + + /** + * Get the headerName property: Contains the name of the header. + * + * @return the headerName value. + */ + public String headerName() { + return this.headerName; + } + + /** + * Set the headerName property: Contains the name of the header. + * + * @param headerName the headerName value to set. + * @return the FirewallPolicyHttpHeaderToInsert object itself. + */ + public FirewallPolicyHttpHeaderToInsert withHeaderName(String headerName) { + this.headerName = headerName; + return this; + } + + /** + * Get the headerValue property: Contains the value of the header. + * + * @return the headerValue value. + */ + public String headerValue() { + return this.headerValue; + } + + /** + * Set the headerValue property: Contains the value of the header. + * + * @param headerValue the headerValue value to set. + * @return the FirewallPolicyHttpHeaderToInsert object itself. + */ + public FirewallPolicyHttpHeaderToInsert withHeaderValue(String headerValue) { + this.headerValue = headerValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("headerName", this.headerName); + jsonWriter.writeStringField("headerValue", this.headerValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyHttpHeaderToInsert from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyHttpHeaderToInsert if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyHttpHeaderToInsert. + */ + public static FirewallPolicyHttpHeaderToInsert fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyHttpHeaderToInsert deserializedFirewallPolicyHttpHeaderToInsert + = new FirewallPolicyHttpHeaderToInsert(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("headerName".equals(fieldName)) { + deserializedFirewallPolicyHttpHeaderToInsert.headerName = reader.getString(); + } else if ("headerValue".equals(fieldName)) { + deserializedFirewallPolicyHttpHeaderToInsert.headerValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyHttpHeaderToInsert; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsQuerySortOrder.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsQuerySortOrder.java new file mode 100644 index 0000000000000..63c001ead74e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsQuerySortOrder.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes if results should be in ascending/descending order. + */ +public final class FirewallPolicyIdpsQuerySortOrder extends ExpandableStringEnum { + /** + * Static value Ascending for FirewallPolicyIdpsQuerySortOrder. + */ + public static final FirewallPolicyIdpsQuerySortOrder ASCENDING = fromString("Ascending"); + + /** + * Static value Descending for FirewallPolicyIdpsQuerySortOrder. + */ + public static final FirewallPolicyIdpsQuerySortOrder DESCENDING = fromString("Descending"); + + /** + * Creates a new instance of FirewallPolicyIdpsQuerySortOrder value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyIdpsQuerySortOrder() { + } + + /** + * Creates or finds a FirewallPolicyIdpsQuerySortOrder from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIdpsQuerySortOrder. + */ + public static FirewallPolicyIdpsQuerySortOrder fromString(String name) { + return fromString(name, FirewallPolicyIdpsQuerySortOrder.class); + } + + /** + * Gets known FirewallPolicyIdpsQuerySortOrder values. + * + * @return known FirewallPolicyIdpsQuerySortOrder values. + */ + public static Collection values() { + return values(FirewallPolicyIdpsQuerySortOrder.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureDirection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureDirection.java new file mode 100644 index 0000000000000..638ba48f81b6a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureDirection.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; + +/** + * Describes in which direction signature is being enforced: 0 - OutBound, 1 - InBound, 2 - Any, 3 - Internal, 4 - + * InternalOutbound. + */ +public enum FirewallPolicyIdpsSignatureDirection { + /** + * Enum value 0. + */ + ZERO(0), + + /** + * Enum value 1. + */ + ONE(1), + + /** + * Enum value 2. + */ + TWO(2), + + /** + * Enum value 3. + */ + THREE(3), + + /** + * Enum value 4. + */ + FOUR(4); + + /** + * The actual serialized value for a FirewallPolicyIdpsSignatureDirection instance. + */ + private final int value; + + FirewallPolicyIdpsSignatureDirection(int value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallPolicyIdpsSignatureDirection instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallPolicyIdpsSignatureDirection object, or null if unable to parse. + */ + public static FirewallPolicyIdpsSignatureDirection fromInt(int value) { + FirewallPolicyIdpsSignatureDirection[] items = FirewallPolicyIdpsSignatureDirection.values(); + for (FirewallPolicyIdpsSignatureDirection item : items) { + if (item.toInt() == value) { + return item; + } + } + return null; + } + + /** + * De-serializes the instance to int value. + * + * @return the int value. + */ + public int toInt() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureMode.java new file mode 100644 index 0000000000000..329a86f7f4aec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureMode.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; + +/** + * The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny. + */ +public enum FirewallPolicyIdpsSignatureMode { + /** + * Enum value 0. + */ + ZERO(0), + + /** + * Enum value 1. + */ + ONE(1), + + /** + * Enum value 2. + */ + TWO(2); + + /** + * The actual serialized value for a FirewallPolicyIdpsSignatureMode instance. + */ + private final int value; + + FirewallPolicyIdpsSignatureMode(int value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallPolicyIdpsSignatureMode instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallPolicyIdpsSignatureMode object, or null if unable to parse. + */ + public static FirewallPolicyIdpsSignatureMode fromInt(int value) { + FirewallPolicyIdpsSignatureMode[] items = FirewallPolicyIdpsSignatureMode.values(); + for (FirewallPolicyIdpsSignatureMode item : items) { + if (item.toInt() == value) { + return item; + } + } + return null; + } + + /** + * De-serializes the instance to int value. + * + * @return the int value. + */ + public int toInt() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureSeverity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureSeverity.java new file mode 100644 index 0000000000000..11d7977e54cf3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatureSeverity.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; + +/** + * Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low. + */ +public enum FirewallPolicyIdpsSignatureSeverity { + /** + * Enum value 1. + */ + ONE(1), + + /** + * Enum value 2. + */ + TWO(2), + + /** + * Enum value 3. + */ + THREE(3); + + /** + * The actual serialized value for a FirewallPolicyIdpsSignatureSeverity instance. + */ + private final int value; + + FirewallPolicyIdpsSignatureSeverity(int value) { + this.value = value; + } + + /** + * Parses a serialized value to a FirewallPolicyIdpsSignatureSeverity instance. + * + * @param value the serialized value to parse. + * @return the parsed FirewallPolicyIdpsSignatureSeverity object, or null if unable to parse. + */ + public static FirewallPolicyIdpsSignatureSeverity fromInt(int value) { + FirewallPolicyIdpsSignatureSeverity[] items = FirewallPolicyIdpsSignatureSeverity.values(); + for (FirewallPolicyIdpsSignatureSeverity item : items) { + if (item.toInt() == value) { + return item; + } + } + return null; + } + + /** + * De-serializes the instance to int value. + * + * @return the int value. + */ + public int toInt() { + return this.value; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatures.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatures.java new file mode 100644 index 0000000000000..311d744248940 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignatures.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.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FirewallPolicyIdpsSignatures. + */ +public interface FirewallPolicyIdpsSignatures { + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query result along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String firewallPolicyName, + IdpsQueryObject parameters, Context context); + + /** + * Retrieves the current status of IDPS signatures for the relevant policy. Maximal amount of returned signatures is + * 1000. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return query result. + */ + QueryResults list(String resourceGroupName, String firewallPolicyName, IdpsQueryObject parameters); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesFilterValues.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesFilterValues.java new file mode 100644 index 0000000000000..6a3647dfb8623 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesFilterValues.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.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of FirewallPolicyIdpsSignaturesFilterValues. + */ +public interface FirewallPolicyIdpsSignaturesFilterValues { + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of all possible values for a specific filter value along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, + String firewallPolicyName, SignatureOverridesFilterValuesQuery parameters, Context context); + + /** + * Retrieves the current filter values for the signatures overrides. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes the list of all possible values for a specific filter value. + */ + SignatureOverridesFilterValuesResponse list(String resourceGroupName, String firewallPolicyName, + SignatureOverridesFilterValuesQuery parameters); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesOverrides.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesOverrides.java new file mode 100644 index 0000000000000..fcd13bb28d38c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIdpsSignaturesOverrides.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.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; + +/** + * Resource collection API of FirewallPolicyIdpsSignaturesOverrides. + */ +public interface FirewallPolicyIdpsSignaturesOverrides { + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + Response patchWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context); + + /** + * Will update the status of policy's signature overrides for IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS. + */ + SignaturesOverrides patch(String resourceGroupName, String firewallPolicyName, SignaturesOverridesInner parameters); + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + Response putWithResponse(String resourceGroupName, String firewallPolicyName, + SignaturesOverridesInner parameters, Context context); + + /** + * Will override/create a new signature overrides for the policy's IDPS. + * + * @param resourceGroupName The name of the resource group. + * @param firewallPolicyName The name of the Firewall Policy. + * @param parameters Will contain all properties of the object to put. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains all specific policy signatures overrides for the IDPS. + */ + SignaturesOverrides put(String resourceGroupName, String firewallPolicyName, SignaturesOverridesInner parameters); + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String firewallPolicyName, Context context); + + /** + * Returns all signatures overrides for a specific 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 contains all specific policy signatures overrides for the IDPS. + */ + SignaturesOverrides get(String resourceGroupName, String firewallPolicyName); + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String firewallPolicyName, + Context context); + + /** + * Returns all signatures overrides objects for a specific policy as a list containing a single value. + * + * @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 describes an object containing an array with a single item. + */ + SignaturesOverridesList list(String resourceGroupName, String firewallPolicyName); +} 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..32f370e5bcca3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyInsights.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Firewall Policy Insights. + */ +@Fluent +public final class FirewallPolicyInsights implements JsonSerializable { + /* + * A flag to indicate if the insights are enabled on the policy. + */ + private Boolean isEnabled; + + /* + * Number of days the insights should be enabled on the policy. + */ + private Integer retentionDays; + + /* + * Workspaces needed to configure the Firewall Policy Insights. + */ + private FirewallPolicyLogAnalyticsResources logAnalyticsResources; + + /** + * Creates an instance of FirewallPolicyInsights class. + */ + public FirewallPolicyInsights() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isEnabled", this.isEnabled); + jsonWriter.writeNumberField("retentionDays", this.retentionDays); + jsonWriter.writeJsonField("logAnalyticsResources", this.logAnalyticsResources); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyInsights from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyInsights if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyInsights. + */ + public static FirewallPolicyInsights fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyInsights deserializedFirewallPolicyInsights = new FirewallPolicyInsights(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isEnabled".equals(fieldName)) { + deserializedFirewallPolicyInsights.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("retentionDays".equals(fieldName)) { + deserializedFirewallPolicyInsights.retentionDays = reader.getNullable(JsonReader::getInt); + } else if ("logAnalyticsResources".equals(fieldName)) { + deserializedFirewallPolicyInsights.logAnalyticsResources + = FirewallPolicyLogAnalyticsResources.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyInsights; + }); + } +} 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..ef29c8a521edb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetection.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for intrusion detection mode and rules. + */ +@Fluent +public final class FirewallPolicyIntrusionDetection implements JsonSerializable { + /* + * Intrusion detection general state. When attached to a parent policy, the firewall's effective IDPS mode is the + * stricter mode of the two. + */ + private FirewallPolicyIntrusionDetectionStateType mode; + + /* + * IDPS profile name. When attached to a parent policy, the firewall's effective profile is the profile name of the + * parent policy. + */ + private FirewallPolicyIntrusionDetectionProfileType profile; + + /* + * Intrusion detection configuration properties. + */ + private FirewallPolicyIntrusionDetectionConfiguration configuration; + + /** + * Creates an instance of FirewallPolicyIntrusionDetection class. + */ + public FirewallPolicyIntrusionDetection() { + } + + /** + * Get the mode property: Intrusion detection general state. When attached to a parent policy, the firewall's + * effective IDPS mode is the stricter mode of the two. + * + * @return the mode value. + */ + public FirewallPolicyIntrusionDetectionStateType mode() { + return this.mode; + } + + /** + * Set the mode property: Intrusion detection general state. When attached to a parent policy, the firewall's + * effective IDPS mode is the stricter mode of the two. + * + * @param mode the mode value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withMode(FirewallPolicyIntrusionDetectionStateType mode) { + this.mode = mode; + return this; + } + + /** + * Get the profile property: IDPS profile name. When attached to a parent policy, the firewall's effective profile + * is the profile name of the parent policy. + * + * @return the profile value. + */ + public FirewallPolicyIntrusionDetectionProfileType profile() { + return this.profile; + } + + /** + * Set the profile property: IDPS profile name. When attached to a parent policy, the firewall's effective profile + * is the profile name of the parent policy. + * + * @param profile the profile value to set. + * @return the FirewallPolicyIntrusionDetection object itself. + */ + public FirewallPolicyIntrusionDetection withProfile(FirewallPolicyIntrusionDetectionProfileType profile) { + this.profile = profile; + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeStringField("profile", this.profile == null ? null : this.profile.toString()); + jsonWriter.writeJsonField("configuration", this.configuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyIntrusionDetection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyIntrusionDetection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyIntrusionDetection. + */ + public static FirewallPolicyIntrusionDetection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyIntrusionDetection deserializedFirewallPolicyIntrusionDetection + = new FirewallPolicyIntrusionDetection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetection.mode + = FirewallPolicyIntrusionDetectionStateType.fromString(reader.getString()); + } else if ("profile".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetection.profile + = FirewallPolicyIntrusionDetectionProfileType.fromString(reader.getString()); + } else if ("configuration".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetection.configuration + = FirewallPolicyIntrusionDetectionConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyIntrusionDetection; + }); + } +} 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..3eb64678a4356 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Intrusion detection bypass traffic specification. + */ +@Fluent +public final class FirewallPolicyIntrusionDetectionBypassTrafficSpecifications + implements JsonSerializable { + /* + * Name of the bypass traffic rule. + */ + private String name; + + /* + * Description of the bypass traffic rule. + */ + private String description; + + /* + * The rule bypass protocol. + */ + private FirewallPolicyIntrusionDetectionProtocol protocol; + + /* + * List of source IP addresses or ranges for this rule. + */ + private List sourceAddresses; + + /* + * List of destination IP addresses or ranges for this rule. + */ + private List destinationAddresses; + + /* + * List of destination ports or ranges. + */ + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + private List destinationIpGroups; + + /** + * Creates an instance of FirewallPolicyIntrusionDetectionBypassTrafficSpecifications class. + */ + public FirewallPolicyIntrusionDetectionBypassTrafficSpecifications() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationAddresses", this.destinationAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sourceIpGroups", this.sourceIpGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationIpGroups", this.destinationIpGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyIntrusionDetectionBypassTrafficSpecifications from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyIntrusionDetectionBypassTrafficSpecifications if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * FirewallPolicyIntrusionDetectionBypassTrafficSpecifications. + */ + public static FirewallPolicyIntrusionDetectionBypassTrafficSpecifications fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyIntrusionDetectionBypassTrafficSpecifications deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications + = new FirewallPolicyIntrusionDetectionBypassTrafficSpecifications(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.description + = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.protocol + = FirewallPolicyIntrusionDetectionProtocol.fromString(reader.getString()); + } else if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.sourceAddresses + = sourceAddresses; + } else if ("destinationAddresses".equals(fieldName)) { + List destinationAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.destinationAddresses + = destinationAddresses; + } else if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.destinationPorts + = destinationPorts; + } else if ("sourceIpGroups".equals(fieldName)) { + List sourceIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.sourceIpGroups + = sourceIpGroups; + } else if ("destinationIpGroups".equals(fieldName)) { + List destinationIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications.destinationIpGroups + = destinationIpGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyIntrusionDetectionBypassTrafficSpecifications; + }); + } +} 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..00bab95ebe684 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The operation for configuring intrusion detection. + */ +@Fluent +public final class FirewallPolicyIntrusionDetectionConfiguration + implements JsonSerializable { + /* + * List of specific signatures states. + */ + private List signatureOverrides; + + /* + * List of rules for traffic to bypass. + */ + private List bypassTrafficSettings; + + /* + * IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, + * only ranges defined by IANA RFC 1918 are considered private IP addresses. To modify default ranges, specify your + * Private IP address ranges with this property + */ + private List privateRanges; + + /** + * Creates an instance of FirewallPolicyIntrusionDetectionConfiguration class. + */ + public FirewallPolicyIntrusionDetectionConfiguration() { + } + + /** + * 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; + } + + /** + * Get the privateRanges property: IDPS Private IP address ranges are used to identify traffic direction (i.e. + * inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered private IP addresses. + * To modify default ranges, specify your Private IP address ranges with this property. + * + * @return the privateRanges value. + */ + public List privateRanges() { + return this.privateRanges; + } + + /** + * Set the privateRanges property: IDPS Private IP address ranges are used to identify traffic direction (i.e. + * inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered private IP addresses. + * To modify default ranges, specify your Private IP address ranges with this property. + * + * @param privateRanges the privateRanges value to set. + * @return the FirewallPolicyIntrusionDetectionConfiguration object itself. + */ + public FirewallPolicyIntrusionDetectionConfiguration withPrivateRanges(List privateRanges) { + this.privateRanges = privateRanges; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("signatureOverrides", this.signatureOverrides, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("bypassTrafficSettings", this.bypassTrafficSettings, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("privateRanges", this.privateRanges, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyIntrusionDetectionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyIntrusionDetectionConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyIntrusionDetectionConfiguration. + */ + public static FirewallPolicyIntrusionDetectionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyIntrusionDetectionConfiguration deserializedFirewallPolicyIntrusionDetectionConfiguration + = new FirewallPolicyIntrusionDetectionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("signatureOverrides".equals(fieldName)) { + List signatureOverrides = reader + .readArray(reader1 -> FirewallPolicyIntrusionDetectionSignatureSpecification.fromJson(reader1)); + deserializedFirewallPolicyIntrusionDetectionConfiguration.signatureOverrides = signatureOverrides; + } else if ("bypassTrafficSettings".equals(fieldName)) { + List bypassTrafficSettings + = reader.readArray( + reader1 -> FirewallPolicyIntrusionDetectionBypassTrafficSpecifications.fromJson(reader1)); + deserializedFirewallPolicyIntrusionDetectionConfiguration.bypassTrafficSettings + = bypassTrafficSettings; + } else if ("privateRanges".equals(fieldName)) { + List privateRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyIntrusionDetectionConfiguration.privateRanges = privateRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyIntrusionDetectionConfiguration; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProfileType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProfileType.java new file mode 100644 index 0000000000000..41dd345b3219a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProfileType.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible Intrusion Detection profile values. + */ +public final class FirewallPolicyIntrusionDetectionProfileType + extends ExpandableStringEnum { + /** + * Static value Basic for FirewallPolicyIntrusionDetectionProfileType. + */ + public static final FirewallPolicyIntrusionDetectionProfileType BASIC = fromString("Basic"); + + /** + * Static value Standard for FirewallPolicyIntrusionDetectionProfileType. + */ + public static final FirewallPolicyIntrusionDetectionProfileType STANDARD = fromString("Standard"); + + /** + * Static value Advanced for FirewallPolicyIntrusionDetectionProfileType. + */ + public static final FirewallPolicyIntrusionDetectionProfileType ADVANCED = fromString("Advanced"); + + /** + * Static value Extended for FirewallPolicyIntrusionDetectionProfileType. + */ + public static final FirewallPolicyIntrusionDetectionProfileType EXTENDED = fromString("Extended"); + + /** + * Creates a new instance of FirewallPolicyIntrusionDetectionProfileType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyIntrusionDetectionProfileType() { + } + + /** + * Creates or finds a FirewallPolicyIntrusionDetectionProfileType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIntrusionDetectionProfileType. + */ + public static FirewallPolicyIntrusionDetectionProfileType fromString(String name) { + return fromString(name, FirewallPolicyIntrusionDetectionProfileType.class); + } + + /** + * Gets known FirewallPolicyIntrusionDetectionProfileType values. + * + * @return known FirewallPolicyIntrusionDetectionProfileType values. + */ + public static Collection values() { + return values(FirewallPolicyIntrusionDetectionProfileType.class); + } +} 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..5e42304905ec1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionProtocol.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible intrusion detection bypass traffic protocols. + */ +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 a new instance of FirewallPolicyIntrusionDetectionProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyIntrusionDetectionProtocol() { + } + + /** + * Creates or finds a FirewallPolicyIntrusionDetectionProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIntrusionDetectionProtocol. + */ + public static FirewallPolicyIntrusionDetectionProtocol fromString(String name) { + return fromString(name, FirewallPolicyIntrusionDetectionProtocol.class); + } + + /** + * Gets known FirewallPolicyIntrusionDetectionProtocol values. + * + * @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..78db07d49fc11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionSignatureSpecification.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Intrusion detection signatures specification states. + */ +@Fluent +public final class FirewallPolicyIntrusionDetectionSignatureSpecification + implements JsonSerializable { + /* + * Signature id. + */ + private String id; + + /* + * The signature state. + */ + private FirewallPolicyIntrusionDetectionStateType mode; + + /** + * Creates an instance of FirewallPolicyIntrusionDetectionSignatureSpecification class. + */ + public FirewallPolicyIntrusionDetectionSignatureSpecification() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyIntrusionDetectionSignatureSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyIntrusionDetectionSignatureSpecification if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyIntrusionDetectionSignatureSpecification. + */ + public static FirewallPolicyIntrusionDetectionSignatureSpecification fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyIntrusionDetectionSignatureSpecification deserializedFirewallPolicyIntrusionDetectionSignatureSpecification + = new FirewallPolicyIntrusionDetectionSignatureSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetectionSignatureSpecification.id = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedFirewallPolicyIntrusionDetectionSignatureSpecification.mode + = FirewallPolicyIntrusionDetectionStateType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyIntrusionDetectionSignatureSpecification; + }); + } +} 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..63c7ec2e7d8ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyIntrusionDetectionStateType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible state values. + */ +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 a new instance of FirewallPolicyIntrusionDetectionStateType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyIntrusionDetectionStateType() { + } + + /** + * Creates or finds a FirewallPolicyIntrusionDetectionStateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyIntrusionDetectionStateType. + */ + public static FirewallPolicyIntrusionDetectionStateType fromString(String name) { + return fromString(name, FirewallPolicyIntrusionDetectionStateType.class); + } + + /** + * Gets known FirewallPolicyIntrusionDetectionStateType values. + * + * @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..94f44668d1ba1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListFirewallPolicies API service call. + */ +@Fluent +public final class FirewallPolicyListResult implements JsonSerializable { + /* + * List of Firewall Policies in a resource group. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of FirewallPolicyListResult class. + */ + public FirewallPolicyListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyListResult. + */ + public static FirewallPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyListResult deserializedFirewallPolicyListResult = new FirewallPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FirewallPolicyInner.fromJson(reader1)); + deserializedFirewallPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFirewallPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyListResult; + }); + } +} 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..9f60556d1037a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsResources.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Log Analytics Resources for Firewall Policy Insights. + */ +@Fluent +public final class FirewallPolicyLogAnalyticsResources + implements JsonSerializable { + /* + * List of workspaces for Firewall Policy Insights. + */ + private List workspaces; + + /* + * The default workspace Id for Firewall Policy Insights. + */ + private SubResource defaultWorkspaceId; + + /** + * Creates an instance of FirewallPolicyLogAnalyticsResources class. + */ + public FirewallPolicyLogAnalyticsResources() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("workspaces", this.workspaces, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("defaultWorkspaceId", this.defaultWorkspaceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyLogAnalyticsResources from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyLogAnalyticsResources if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyLogAnalyticsResources. + */ + public static FirewallPolicyLogAnalyticsResources fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyLogAnalyticsResources deserializedFirewallPolicyLogAnalyticsResources + = new FirewallPolicyLogAnalyticsResources(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("workspaces".equals(fieldName)) { + List workspaces + = reader.readArray(reader1 -> FirewallPolicyLogAnalyticsWorkspace.fromJson(reader1)); + deserializedFirewallPolicyLogAnalyticsResources.workspaces = workspaces; + } else if ("defaultWorkspaceId".equals(fieldName)) { + deserializedFirewallPolicyLogAnalyticsResources.defaultWorkspaceId = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyLogAnalyticsResources; + }); + } +} 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..5545a38cf5e0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyLogAnalyticsWorkspace.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Log Analytics Workspace for Firewall Policy Insights. + */ +@Fluent +public final class FirewallPolicyLogAnalyticsWorkspace + implements JsonSerializable { + /* + * Region to configure the Workspace. + */ + private String region; + + /* + * The workspace Id for Firewall Policy Insights. + */ + private SubResource workspaceId; + + /** + * Creates an instance of FirewallPolicyLogAnalyticsWorkspace class. + */ + public FirewallPolicyLogAnalyticsWorkspace() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeJsonField("workspaceId", this.workspaceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyLogAnalyticsWorkspace from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyLogAnalyticsWorkspace if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyLogAnalyticsWorkspace. + */ + public static FirewallPolicyLogAnalyticsWorkspace fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyLogAnalyticsWorkspace deserializedFirewallPolicyLogAnalyticsWorkspace + = new FirewallPolicyLogAnalyticsWorkspace(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("region".equals(fieldName)) { + deserializedFirewallPolicyLogAnalyticsWorkspace.region = reader.getString(); + } else if ("workspaceId".equals(fieldName)) { + deserializedFirewallPolicyLogAnalyticsWorkspace.workspaceId = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyLogAnalyticsWorkspace; + }); + } +} 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..8e8449e0730ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollection.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Firewall Policy NAT Rule Collection. + */ +@Fluent +public final class FirewallPolicyNatRuleCollection extends FirewallPolicyRuleCollection { + /* + * The type of the rule collection. + */ + private FirewallPolicyRuleCollectionType ruleCollectionType + = FirewallPolicyRuleCollectionType.FIREWALL_POLICY_NAT_RULE_COLLECTION; + + /* + * The action type of a Nat rule collection. + */ + private FirewallPolicyNatRuleCollectionAction action; + + /* + * List of rules included in a rule collection. + */ + private List rules; + + /** + * Creates an instance of FirewallPolicyNatRuleCollection class. + */ + public FirewallPolicyNatRuleCollection() { + } + + /** + * Get the ruleCollectionType property: The type of the rule collection. + * + * @return the ruleCollectionType value. + */ + @Override + public FirewallPolicyRuleCollectionType ruleCollectionType() { + return this.ruleCollectionType; + } + + /** + * 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() { + if (action() != null) { + action().validate(); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeNumberField("priority", priority()); + jsonWriter.writeStringField("ruleCollectionType", + this.ruleCollectionType == null ? null : this.ruleCollectionType.toString()); + jsonWriter.writeJsonField("action", this.action); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyNatRuleCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyNatRuleCollection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyNatRuleCollection. + */ + public static FirewallPolicyNatRuleCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyNatRuleCollection deserializedFirewallPolicyNatRuleCollection + = new FirewallPolicyNatRuleCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedFirewallPolicyNatRuleCollection.withName(reader.getString()); + } else if ("priority".equals(fieldName)) { + deserializedFirewallPolicyNatRuleCollection.withPriority(reader.getNullable(JsonReader::getInt)); + } else if ("ruleCollectionType".equals(fieldName)) { + deserializedFirewallPolicyNatRuleCollection.ruleCollectionType + = FirewallPolicyRuleCollectionType.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedFirewallPolicyNatRuleCollection.action + = FirewallPolicyNatRuleCollectionAction.fromJson(reader); + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> FirewallPolicyRule.fromJson(reader1)); + deserializedFirewallPolicyNatRuleCollection.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyNatRuleCollection; + }); + } +} 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..eb6a0ac064d61 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionAction.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the FirewallPolicyNatRuleCollectionAction. + */ +@Fluent +public final class FirewallPolicyNatRuleCollectionAction + implements JsonSerializable { + /* + * The type of action. + */ + private FirewallPolicyNatRuleCollectionActionType type; + + /** + * Creates an instance of FirewallPolicyNatRuleCollectionAction class. + */ + public FirewallPolicyNatRuleCollectionAction() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyNatRuleCollectionAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyNatRuleCollectionAction if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyNatRuleCollectionAction. + */ + public static FirewallPolicyNatRuleCollectionAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyNatRuleCollectionAction deserializedFirewallPolicyNatRuleCollectionAction + = new FirewallPolicyNatRuleCollectionAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedFirewallPolicyNatRuleCollectionAction.type + = FirewallPolicyNatRuleCollectionActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyNatRuleCollectionAction; + }); + } +} 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..f35547e46d264 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyNatRuleCollectionActionType.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 java.util.Collection; + +/** + * The action type of a rule. + */ +public final class FirewallPolicyNatRuleCollectionActionType + extends ExpandableStringEnum { + /** + * Static value DNAT for FirewallPolicyNatRuleCollectionActionType. + */ + public static final FirewallPolicyNatRuleCollectionActionType DNAT = fromString("DNAT"); + + /** + * Creates a new instance of FirewallPolicyNatRuleCollectionActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyNatRuleCollectionActionType() { + } + + /** + * Creates or finds a FirewallPolicyNatRuleCollectionActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyNatRuleCollectionActionType. + */ + public static FirewallPolicyNatRuleCollectionActionType fromString(String name) { + return fromString(name, FirewallPolicyNatRuleCollectionActionType.class); + } + + /** + * Gets known FirewallPolicyNatRuleCollectionActionType values. + * + * @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..3d0a728cb088f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRule.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of a rule. + */ +@Fluent +public class FirewallPolicyRule implements JsonSerializable { + /* + * Rule Type. + */ + private FirewallPolicyRuleType ruleType = FirewallPolicyRuleType.fromString("FirewallPolicyRule"); + + /* + * Name of the rule. + */ + private String name; + + /* + * Description of the rule. + */ + private String description; + + /** + * Creates an instance of FirewallPolicyRule class. + */ + public FirewallPolicyRule() { + } + + /** + * Get the ruleType property: Rule Type. + * + * @return the ruleType value. + */ + public FirewallPolicyRuleType ruleType() { + return this.ruleType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRule. + */ + public static FirewallPolicyRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("ruleType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("ApplicationRule".equals(discriminatorValue)) { + return ApplicationRule.fromJson(readerToUse.reset()); + } else if ("NatRule".equals(discriminatorValue)) { + return NatRule.fromJson(readerToUse.reset()); + } else if ("NetworkRule".equals(discriminatorValue)) { + return NetworkRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static FirewallPolicyRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRule deserializedFirewallPolicyRule = new FirewallPolicyRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleType".equals(fieldName)) { + deserializedFirewallPolicyRule.ruleType = FirewallPolicyRuleType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedFirewallPolicyRule.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedFirewallPolicyRule.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRule; + }); + } +} 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..f1ba7a579e542 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocol.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the application rule protocol. + */ +@Fluent +public final class FirewallPolicyRuleApplicationProtocol + implements JsonSerializable { + /* + * Protocol type. + */ + private FirewallPolicyRuleApplicationProtocolType protocolType; + + /* + * Port number for the protocol, cannot be greater than 64000. + */ + private Integer port; + + /** + * Creates an instance of FirewallPolicyRuleApplicationProtocol class. + */ + public FirewallPolicyRuleApplicationProtocol() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocolType", this.protocolType == null ? null : this.protocolType.toString()); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRuleApplicationProtocol from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRuleApplicationProtocol if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRuleApplicationProtocol. + */ + public static FirewallPolicyRuleApplicationProtocol fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRuleApplicationProtocol deserializedFirewallPolicyRuleApplicationProtocol + = new FirewallPolicyRuleApplicationProtocol(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocolType".equals(fieldName)) { + deserializedFirewallPolicyRuleApplicationProtocol.protocolType + = FirewallPolicyRuleApplicationProtocolType.fromString(reader.getString()); + } else if ("port".equals(fieldName)) { + deserializedFirewallPolicyRuleApplicationProtocol.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRuleApplicationProtocol; + }); + } +} 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..af1c193b60050 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleApplicationProtocolType.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 java.util.Collection; + +/** + * The application protocol type of a Rule. + */ +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 a new instance of FirewallPolicyRuleApplicationProtocolType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyRuleApplicationProtocolType() { + } + + /** + * Creates or finds a FirewallPolicyRuleApplicationProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleApplicationProtocolType. + */ + public static FirewallPolicyRuleApplicationProtocolType fromString(String name) { + return fromString(name, FirewallPolicyRuleApplicationProtocolType.class); + } + + /** + * Gets known FirewallPolicyRuleApplicationProtocolType values. + * + * @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..8b0e23a55c894 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollection.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the rule collection. + */ +@Fluent +public class FirewallPolicyRuleCollection implements JsonSerializable { + /* + * The type of the rule collection. + */ + private FirewallPolicyRuleCollectionType ruleCollectionType + = FirewallPolicyRuleCollectionType.fromString("FirewallPolicyRuleCollection"); + + /* + * The name of the rule collection. + */ + private String name; + + /* + * Priority of the Firewall Policy Rule Collection resource. + */ + private Integer priority; + + /** + * Creates an instance of FirewallPolicyRuleCollection class. + */ + public FirewallPolicyRuleCollection() { + } + + /** + * Get the ruleCollectionType property: The type of the rule collection. + * + * @return the ruleCollectionType value. + */ + public FirewallPolicyRuleCollectionType ruleCollectionType() { + return this.ruleCollectionType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleCollectionType", + this.ruleCollectionType == null ? null : this.ruleCollectionType.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("priority", this.priority); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRuleCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRuleCollection if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRuleCollection. + */ + public static FirewallPolicyRuleCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("ruleCollectionType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("FirewallPolicyNatRuleCollection".equals(discriminatorValue)) { + return FirewallPolicyNatRuleCollection.fromJson(readerToUse.reset()); + } else if ("FirewallPolicyFilterRuleCollection".equals(discriminatorValue)) { + return FirewallPolicyFilterRuleCollection.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static FirewallPolicyRuleCollection fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRuleCollection deserializedFirewallPolicyRuleCollection = new FirewallPolicyRuleCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleCollectionType".equals(fieldName)) { + deserializedFirewallPolicyRuleCollection.ruleCollectionType + = FirewallPolicyRuleCollectionType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedFirewallPolicyRuleCollection.name = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedFirewallPolicyRuleCollection.priority = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRuleCollection; + }); + } +} 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..0f79d0aba6a17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroup.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 size property: A read-only string that represents the size of the + * FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB). + * + * @return the size value. + */ + String size(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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/FirewallPolicyRuleCollectionGroupDraft.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupDraft.java new file mode 100644 index 0000000000000..d57aa92f6fdfe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupDraft.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.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner; +import java.util.List; + +/** + * An immutable client-side representation of FirewallPolicyRuleCollectionGroupDraft. + */ +public interface FirewallPolicyRuleCollectionGroupDraft { + /** + * 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: Rule Group type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the size property: A read-only string that represents the size of the + * FirewallPolicyRuleCollectionGroupProperties in MB. (ex 1.2MB). + * + * @return the size value. + */ + String size(); + + /** + * 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 inner + * com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner object. + * + * @return the inner object. + */ + FirewallPolicyRuleCollectionGroupDraftInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupDrafts.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupDrafts.java new file mode 100644 index 0000000000000..643bff5e7a4ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupDrafts.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.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner; + +/** + * Resource collection API of FirewallPolicyRuleCollectionGroupDrafts. + */ +public interface FirewallPolicyRuleCollectionGroupDrafts { + /** + * Delete Rule Collection Group Draft. + * + * @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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, Context context); + + /** + * Delete Rule Collection Group Draft. + * + * @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); + + /** + * Create or Update Rule Collection Group Draft. + * + * @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 along with {@link Response}. + */ + Response createOrUpdateWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, + FirewallPolicyRuleCollectionGroupDraftInner parameters, Context context); + + /** + * Create or Update Rule Collection Group Draft. + * + * @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. + */ + FirewallPolicyRuleCollectionGroupDraft createOrUpdate(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName, FirewallPolicyRuleCollectionGroupDraftInner parameters); + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, + String firewallPolicyName, String ruleCollectionGroupName, Context context); + + /** + * Get Rule Collection Group Draft. + * + * @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 rule Collection Group Draft. + */ + FirewallPolicyRuleCollectionGroupDraft get(String resourceGroupName, String firewallPolicyName, + String ruleCollectionGroupName); +} 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..d94b71e12a02a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroupListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListFirewallPolicyRuleCollectionGroups API service call. + */ +@Fluent +public final class FirewallPolicyRuleCollectionGroupListResult + implements JsonSerializable { + /* + * List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of FirewallPolicyRuleCollectionGroupListResult class. + */ + public FirewallPolicyRuleCollectionGroupListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyRuleCollectionGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyRuleCollectionGroupListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyRuleCollectionGroupListResult. + */ + public static FirewallPolicyRuleCollectionGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyRuleCollectionGroupListResult deserializedFirewallPolicyRuleCollectionGroupListResult + = new FirewallPolicyRuleCollectionGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FirewallPolicyRuleCollectionGroupInner.fromJson(reader1)); + deserializedFirewallPolicyRuleCollectionGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFirewallPolicyRuleCollectionGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyRuleCollectionGroupListResult; + }); + } +} 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..8a0a1c552abc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionGroups.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..45c48e52bed56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleCollectionType.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 java.util.Collection; + +/** + * The type of the rule collection. + */ +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 a new instance of FirewallPolicyRuleCollectionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyRuleCollectionType() { + } + + /** + * Creates or finds a FirewallPolicyRuleCollectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleCollectionType. + */ + public static FirewallPolicyRuleCollectionType fromString(String name) { + return fromString(name, FirewallPolicyRuleCollectionType.class); + } + + /** + * Gets known FirewallPolicyRuleCollectionType values. + * + * @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..a480126a4a9f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleNetworkProtocol.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 java.util.Collection; + +/** + * The Network protocol of a Rule. + */ +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 a new instance of FirewallPolicyRuleNetworkProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyRuleNetworkProtocol() { + } + + /** + * Creates or finds a FirewallPolicyRuleNetworkProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleNetworkProtocol. + */ + public static FirewallPolicyRuleNetworkProtocol fromString(String name) { + return fromString(name, FirewallPolicyRuleNetworkProtocol.class); + } + + /** + * Gets known FirewallPolicyRuleNetworkProtocol values. + * + * @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..dd8c96936bdfc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyRuleType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Rule Type. + */ +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 a new instance of FirewallPolicyRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicyRuleType() { + } + + /** + * Creates or finds a FirewallPolicyRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicyRuleType. + */ + public static FirewallPolicyRuleType fromString(String name) { + return fromString(name, FirewallPolicyRuleType.class); + } + + /** + * Gets known FirewallPolicyRuleType values. + * + * @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..ae3254609202d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySku.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU of Firewall policy. + */ +@Fluent +public final class FirewallPolicySku implements JsonSerializable { + /* + * Tier of Firewall Policy. + */ + private FirewallPolicySkuTier tier; + + /** + * Creates an instance of FirewallPolicySku class. + */ + public FirewallPolicySku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicySku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicySku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicySku. + */ + public static FirewallPolicySku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicySku deserializedFirewallPolicySku = new FirewallPolicySku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tier".equals(fieldName)) { + deserializedFirewallPolicySku.tier = FirewallPolicySkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicySku; + }); + } +} 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..4f491a2cce434 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySkuTier.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tier of Firewall Policy. + */ +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"); + + /** + * Static value Basic for FirewallPolicySkuTier. + */ + public static final FirewallPolicySkuTier BASIC = fromString("Basic"); + + /** + * Creates a new instance of FirewallPolicySkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallPolicySkuTier() { + } + + /** + * Creates or finds a FirewallPolicySkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallPolicySkuTier. + */ + public static FirewallPolicySkuTier fromString(String name) { + return fromString(name, FirewallPolicySkuTier.class); + } + + /** + * Gets known FirewallPolicySkuTier values. + * + * @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..d46fb7a2dd40a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySnat.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The private IP addresses/IP ranges to which traffic will not be SNAT. + */ +@Fluent +public final class FirewallPolicySnat implements JsonSerializable { + /* + * List of private IP addresses/IP address ranges to not be SNAT. + */ + private List privateRanges; + + /* + * The operation mode for automatically learning private ranges to not be SNAT + */ + private AutoLearnPrivateRangesMode autoLearnPrivateRanges; + + /** + * Creates an instance of FirewallPolicySnat class. + */ + public FirewallPolicySnat() { + } + + /** + * 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; + } + + /** + * Get the autoLearnPrivateRanges property: The operation mode for automatically learning private ranges to not be + * SNAT. + * + * @return the autoLearnPrivateRanges value. + */ + public AutoLearnPrivateRangesMode autoLearnPrivateRanges() { + return this.autoLearnPrivateRanges; + } + + /** + * Set the autoLearnPrivateRanges property: The operation mode for automatically learning private ranges to not be + * SNAT. + * + * @param autoLearnPrivateRanges the autoLearnPrivateRanges value to set. + * @return the FirewallPolicySnat object itself. + */ + public FirewallPolicySnat withAutoLearnPrivateRanges(AutoLearnPrivateRangesMode autoLearnPrivateRanges) { + this.autoLearnPrivateRanges = autoLearnPrivateRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("privateRanges", this.privateRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("autoLearnPrivateRanges", + this.autoLearnPrivateRanges == null ? null : this.autoLearnPrivateRanges.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicySnat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicySnat if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicySnat. + */ + public static FirewallPolicySnat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicySnat deserializedFirewallPolicySnat = new FirewallPolicySnat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateRanges".equals(fieldName)) { + List privateRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicySnat.privateRanges = privateRanges; + } else if ("autoLearnPrivateRanges".equals(fieldName)) { + deserializedFirewallPolicySnat.autoLearnPrivateRanges + = AutoLearnPrivateRangesMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicySnat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySql.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySql.java new file mode 100644 index 0000000000000..2f528a08210fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicySql.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SQL Settings in Firewall Policy. + */ +@Fluent +public final class FirewallPolicySql implements JsonSerializable { + /* + * A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on the flag requires no rule using port + * 11000-11999. + */ + private Boolean allowSqlRedirect; + + /** + * Creates an instance of FirewallPolicySql class. + */ + public FirewallPolicySql() { + } + + /** + * Get the allowSqlRedirect property: A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on + * the flag requires no rule using port 11000-11999. + * + * @return the allowSqlRedirect value. + */ + public Boolean allowSqlRedirect() { + return this.allowSqlRedirect; + } + + /** + * Set the allowSqlRedirect property: A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on + * the flag requires no rule using port 11000-11999. + * + * @param allowSqlRedirect the allowSqlRedirect value to set. + * @return the FirewallPolicySql object itself. + */ + public FirewallPolicySql withAllowSqlRedirect(Boolean allowSqlRedirect) { + this.allowSqlRedirect = allowSqlRedirect; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowSqlRedirect", this.allowSqlRedirect); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicySql from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicySql if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicySql. + */ + public static FirewallPolicySql fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicySql deserializedFirewallPolicySql = new FirewallPolicySql(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowSqlRedirect".equals(fieldName)) { + deserializedFirewallPolicySql.allowSqlRedirect = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicySql; + }); + } +} 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..089a8d43b4b45 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyThreatIntelWhitelist.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * ThreatIntel Whitelist for Firewall Policy. + */ +@Fluent +public final class FirewallPolicyThreatIntelWhitelist implements JsonSerializable { + /* + * List of IP addresses for the ThreatIntel Whitelist. + */ + private List ipAddresses; + + /* + * List of FQDNs for the ThreatIntel Whitelist. + */ + private List fqdns; + + /** + * Creates an instance of FirewallPolicyThreatIntelWhitelist class. + */ + public FirewallPolicyThreatIntelWhitelist() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipAddresses", this.ipAddresses, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("fqdns", this.fqdns, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyThreatIntelWhitelist from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyThreatIntelWhitelist if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyThreatIntelWhitelist. + */ + public static FirewallPolicyThreatIntelWhitelist fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyThreatIntelWhitelist deserializedFirewallPolicyThreatIntelWhitelist + = new FirewallPolicyThreatIntelWhitelist(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyThreatIntelWhitelist.ipAddresses = ipAddresses; + } else if ("fqdns".equals(fieldName)) { + List fqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedFirewallPolicyThreatIntelWhitelist.fqdns = fqdns; + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyThreatIntelWhitelist; + }); + } +} 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..447b4eb81132d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FirewallPolicyTransportSecurity.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration needed to perform TLS termination & initiation. + */ +@Fluent +public final class FirewallPolicyTransportSecurity implements JsonSerializable { + /* + * The CA used for intermediate CA generation. + */ + private FirewallPolicyCertificateAuthority certificateAuthority; + + /** + * Creates an instance of FirewallPolicyTransportSecurity class. + */ + public FirewallPolicyTransportSecurity() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("certificateAuthority", this.certificateAuthority); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FirewallPolicyTransportSecurity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FirewallPolicyTransportSecurity if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FirewallPolicyTransportSecurity. + */ + public static FirewallPolicyTransportSecurity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FirewallPolicyTransportSecurity deserializedFirewallPolicyTransportSecurity + = new FirewallPolicyTransportSecurity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateAuthority".equals(fieldName)) { + deserializedFirewallPolicyTransportSecurity.certificateAuthority + = FirewallPolicyCertificateAuthority.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFirewallPolicyTransportSecurity; + }); + } +} 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..9d1c11ddf2723 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLog.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.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 identity property: FlowLog resource Managed Identity. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, + * SrcPort, DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will + * be logged. + * + * @return the enabledFilteringCriteria value. + */ + String enabledFilteringCriteria(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithIdentity, DefinitionStages.WithTargetResourceId, + DefinitionStages.WithStorageId, DefinitionStages.WithEnabledFilteringCriteria, 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 identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: FlowLog resource Managed Identity. + * + * @param identity FlowLog resource Managed Identity. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * 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 enabledFilteringCriteria. + */ + interface WithEnabledFilteringCriteria { + /** + * Specifies the enabledFilteringCriteria property: Optional field to filter network traffic logs based on + * SrcIP, SrcPort, DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network + * traffic will be logged.. + * + * @param enabledFilteringCriteria Optional field to filter network traffic logs based on SrcIP, SrcPort, + * DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will be + * logged. + * @return the next definition stage. + */ + WithCreate withEnabledFilteringCriteria(String enabledFilteringCriteria); + } + + /** + * 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..ddbb366fd2458 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the flow log format. + */ +@Fluent +public final class FlowLogFormatParameters implements JsonSerializable { + /* + * The file type of flow log. + */ + private FlowLogFormatType type; + + /* + * The version (revision) of the flow log. + */ + private Integer version; + + /** + * Creates an instance of FlowLogFormatParameters class. + */ + public FlowLogFormatParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowLogFormatParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowLogFormatParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the FlowLogFormatParameters. + */ + public static FlowLogFormatParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowLogFormatParameters deserializedFlowLogFormatParameters = new FlowLogFormatParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedFlowLogFormatParameters.type = FlowLogFormatType.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedFlowLogFormatParameters.version = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowLogFormatParameters; + }); + } +} 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..216e1a6dc26bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogFormatType.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 java.util.Collection; + +/** + * The file type of flow log. + */ +public final class FlowLogFormatType extends ExpandableStringEnum { + /** + * Static value JSON for FlowLogFormatType. + */ + public static final FlowLogFormatType JSON = fromString("JSON"); + + /** + * Creates a new instance of FlowLogFormatType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FlowLogFormatType() { + } + + /** + * Creates or finds a FlowLogFormatType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FlowLogFormatType. + */ + public static FlowLogFormatType fromString(String name) { + return fromString(name, FlowLogFormatType.class); + } + + /** + * Gets known FlowLogFormatType values. + * + * @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..236eb1f3a81ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogInformation.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.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 identity property: FlowLog resource Managed Identity. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * 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 enabledFilteringCriteria property: Optional field to filter network traffic logs based on SrcIP, + * SrcPort, DstIP, DstPort, Protocol, Encryption, Direction and Action. If not specified, all network traffic will + * be logged. + * + * @return the enabledFilteringCriteria value. + */ + String enabledFilteringCriteria(); + + /** + * 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..6c26951d5ea47 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInner; +import java.io.IOException; +import java.util.List; + +/** + * List of flow logs. + */ +@Fluent +public final class FlowLogListResult implements JsonSerializable { + /* + * Information about flow log resource. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of FlowLogListResult class. + */ + public FlowLogListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowLogListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowLogListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FlowLogListResult. + */ + public static FlowLogListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowLogListResult deserializedFlowLogListResult = new FlowLogListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FlowLogInner.fromJson(reader1)); + deserializedFlowLogListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFlowLogListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowLogListResult; + }); + } +} 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..edb7af76255a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogStatusParameters.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define a resource to query flow log and traffic analytics (optional) status. + */ +@Fluent +public final class FlowLogStatusParameters implements JsonSerializable { + /* + * The target resource where getting the flow log and traffic analytics (optional) status. + */ + private String targetResourceId; + + /** + * Creates an instance of FlowLogStatusParameters class. + */ + public FlowLogStatusParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model FlowLogStatusParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowLogStatusParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowLogStatusParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowLogStatusParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlowLogStatusParameters. + */ + public static FlowLogStatusParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowLogStatusParameters deserializedFlowLogStatusParameters = new FlowLogStatusParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedFlowLogStatusParameters.targetResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowLogStatusParameters; + }); + } +} 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..fe3932bb0808e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FlowLogs.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkWatcherName, String flowLogName, + 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. + */ + FlowLog get(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..d82b766a1b0df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfiguration.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.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/FrontendIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..c709e3c392d57 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/FrontendIpConfigurationPropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of FrontendIpConfigurationPropertiesFormat. + */ +public interface FrontendIpConfigurationPropertiesFormat { + /** + * 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.FrontendIpConfigurationPropertiesFormatInner object. + * + * @return the inner object. + */ + FrontendIpConfigurationPropertiesFormatInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayCustomBgpIpAddressIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayCustomBgpIpAddressIpConfiguration.java new file mode 100644 index 0000000000000..63519106a2ab0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayCustomBgpIpAddressIpConfiguration.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * GatewayCustomBgpIpAddressIpConfiguration for a virtual network gateway connection. + */ +@Fluent +public final class GatewayCustomBgpIpAddressIpConfiguration + implements JsonSerializable { + /* + * The IpconfigurationId of ipconfiguration which belongs to gateway. + */ + private String ipConfigurationId; + + /* + * The custom BgpPeeringAddress which belongs to IpconfigurationId. + */ + private String customBgpIpAddress; + + /** + * Creates an instance of GatewayCustomBgpIpAddressIpConfiguration class. + */ + public GatewayCustomBgpIpAddressIpConfiguration() { + } + + /** + * Get the ipConfigurationId property: The IpconfigurationId of ipconfiguration which belongs to gateway. + * + * @return the ipConfigurationId value. + */ + public String ipConfigurationId() { + return this.ipConfigurationId; + } + + /** + * Set the ipConfigurationId property: The IpconfigurationId of ipconfiguration which belongs to gateway. + * + * @param ipConfigurationId the ipConfigurationId value to set. + * @return the GatewayCustomBgpIpAddressIpConfiguration object itself. + */ + public GatewayCustomBgpIpAddressIpConfiguration withIpConfigurationId(String ipConfigurationId) { + this.ipConfigurationId = ipConfigurationId; + return this; + } + + /** + * Get the customBgpIpAddress property: The custom BgpPeeringAddress which belongs to IpconfigurationId. + * + * @return the customBgpIpAddress value. + */ + public String customBgpIpAddress() { + return this.customBgpIpAddress; + } + + /** + * Set the customBgpIpAddress property: The custom BgpPeeringAddress which belongs to IpconfigurationId. + * + * @param customBgpIpAddress the customBgpIpAddress value to set. + * @return the GatewayCustomBgpIpAddressIpConfiguration object itself. + */ + public GatewayCustomBgpIpAddressIpConfiguration withCustomBgpIpAddress(String customBgpIpAddress) { + this.customBgpIpAddress = customBgpIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipConfigurationId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ipConfigurationId in model GatewayCustomBgpIpAddressIpConfiguration")); + } + if (customBgpIpAddress() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property customBgpIpAddress in model GatewayCustomBgpIpAddressIpConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GatewayCustomBgpIpAddressIpConfiguration.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipConfigurationId", this.ipConfigurationId); + jsonWriter.writeStringField("customBgpIpAddress", this.customBgpIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GatewayCustomBgpIpAddressIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GatewayCustomBgpIpAddressIpConfiguration if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GatewayCustomBgpIpAddressIpConfiguration. + */ + public static GatewayCustomBgpIpAddressIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GatewayCustomBgpIpAddressIpConfiguration deserializedGatewayCustomBgpIpAddressIpConfiguration + = new GatewayCustomBgpIpAddressIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfigurationId".equals(fieldName)) { + deserializedGatewayCustomBgpIpAddressIpConfiguration.ipConfigurationId = reader.getString(); + } else if ("customBgpIpAddress".equals(fieldName)) { + deserializedGatewayCustomBgpIpAddressIpConfiguration.customBgpIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGatewayCustomBgpIpAddressIpConfiguration; + }); + } +} 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..e94ed64973959 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterface.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gateway load balancer tunnel interface of a load balancer backend address pool. + */ +@Fluent +public final class GatewayLoadBalancerTunnelInterface implements JsonSerializable { + /* + * Port of gateway load balancer tunnel interface. + */ + private Integer port; + + /* + * Identifier of gateway load balancer tunnel interface. + */ + private Integer identifier; + + /* + * Protocol of gateway load balancer tunnel interface. + */ + private GatewayLoadBalancerTunnelProtocol protocol; + + /* + * Traffic type of gateway load balancer tunnel interface. + */ + private GatewayLoadBalancerTunnelInterfaceType type; + + /** + * Creates an instance of GatewayLoadBalancerTunnelInterface class. + */ + public GatewayLoadBalancerTunnelInterface() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("port", this.port); + jsonWriter.writeNumberField("identifier", this.identifier); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GatewayLoadBalancerTunnelInterface from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GatewayLoadBalancerTunnelInterface if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GatewayLoadBalancerTunnelInterface. + */ + public static GatewayLoadBalancerTunnelInterface fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GatewayLoadBalancerTunnelInterface deserializedGatewayLoadBalancerTunnelInterface + = new GatewayLoadBalancerTunnelInterface(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("port".equals(fieldName)) { + deserializedGatewayLoadBalancerTunnelInterface.port = reader.getNullable(JsonReader::getInt); + } else if ("identifier".equals(fieldName)) { + deserializedGatewayLoadBalancerTunnelInterface.identifier = reader.getNullable(JsonReader::getInt); + } else if ("protocol".equals(fieldName)) { + deserializedGatewayLoadBalancerTunnelInterface.protocol + = GatewayLoadBalancerTunnelProtocol.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedGatewayLoadBalancerTunnelInterface.type + = GatewayLoadBalancerTunnelInterfaceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGatewayLoadBalancerTunnelInterface; + }); + } +} 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..53b24c0430e8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelInterfaceType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Traffic type of gateway load balancer tunnel interface. + */ +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 a new instance of GatewayLoadBalancerTunnelInterfaceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GatewayLoadBalancerTunnelInterfaceType() { + } + + /** + * Creates or finds a GatewayLoadBalancerTunnelInterfaceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayLoadBalancerTunnelInterfaceType. + */ + public static GatewayLoadBalancerTunnelInterfaceType fromString(String name) { + return fromString(name, GatewayLoadBalancerTunnelInterfaceType.class); + } + + /** + * Gets known GatewayLoadBalancerTunnelInterfaceType values. + * + * @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..6061679467caf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayLoadBalancerTunnelProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol of gateway load balancer tunnel interface. + */ +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 a new instance of GatewayLoadBalancerTunnelProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GatewayLoadBalancerTunnelProtocol() { + } + + /** + * Creates or finds a GatewayLoadBalancerTunnelProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayLoadBalancerTunnelProtocol. + */ + public static GatewayLoadBalancerTunnelProtocol fromString(String name) { + return fromString(name, GatewayLoadBalancerTunnelProtocol.class); + } + + /** + * Gets known GatewayLoadBalancerTunnelProtocol values. + * + * @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..a919c592a6401 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRoute.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gateway routing details. + */ +@Immutable +public final class GatewayRoute implements JsonSerializable { + /* + * The gateway's local address. + */ + private String localAddress; + + /* + * The route's network prefix. + */ + private String network; + + /* + * The route's next hop. + */ + private String nextHop; + + /* + * The peer this route was learned from. + */ + private String sourcePeer; + + /* + * The source this route was learned from. + */ + private String origin; + + /* + * The route's AS path sequence. + */ + private String asPath; + + /* + * The route's weight. + */ + private Integer weight; + + /** + * Creates an instance of GatewayRoute class. + */ + public GatewayRoute() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GatewayRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GatewayRoute if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the GatewayRoute. + */ + public static GatewayRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GatewayRoute deserializedGatewayRoute = new GatewayRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("localAddress".equals(fieldName)) { + deserializedGatewayRoute.localAddress = reader.getString(); + } else if ("network".equals(fieldName)) { + deserializedGatewayRoute.network = reader.getString(); + } else if ("nextHop".equals(fieldName)) { + deserializedGatewayRoute.nextHop = reader.getString(); + } else if ("sourcePeer".equals(fieldName)) { + deserializedGatewayRoute.sourcePeer = reader.getString(); + } else if ("origin".equals(fieldName)) { + deserializedGatewayRoute.origin = reader.getString(); + } else if ("asPath".equals(fieldName)) { + deserializedGatewayRoute.asPath = reader.getString(); + } else if ("weight".equals(fieldName)) { + deserializedGatewayRoute.weight = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedGatewayRoute; + }); + } +} 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..94f26a9fd0d65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GatewayRouteListResult.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.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..116e50395b852 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaRequest.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The customer name to be printed on a letter of authorization. + */ +@Fluent +public final class GenerateExpressRoutePortsLoaRequest + implements JsonSerializable { + /* + * The customer name. + */ + private String customerName; + + /** + * Creates an instance of GenerateExpressRoutePortsLoaRequest class. + */ + public GenerateExpressRoutePortsLoaRequest() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property customerName in model GenerateExpressRoutePortsLoaRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateExpressRoutePortsLoaRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("customerName", this.customerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateExpressRoutePortsLoaRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateExpressRoutePortsLoaRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateExpressRoutePortsLoaRequest. + */ + public static GenerateExpressRoutePortsLoaRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateExpressRoutePortsLoaRequest deserializedGenerateExpressRoutePortsLoaRequest + = new GenerateExpressRoutePortsLoaRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customerName".equals(fieldName)) { + deserializedGenerateExpressRoutePortsLoaRequest.customerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateExpressRoutePortsLoaRequest; + }); + } +} 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..4f9d507ecb5ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GenerateExpressRoutePortsLoaResult.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.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/Geo.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Geo.java new file mode 100644 index 0000000000000..26268e25ba126 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Geo.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Geo for CIDR advertising. Should be an Geo code. + */ +public final class Geo extends ExpandableStringEnum { + /** + * Static value GLOBAL for Geo. + */ + public static final Geo GLOBAL = fromString("GLOBAL"); + + /** + * Static value AFRI for Geo. + */ + public static final Geo AFRI = fromString("AFRI"); + + /** + * Static value APAC for Geo. + */ + public static final Geo APAC = fromString("APAC"); + + /** + * Static value EURO for Geo. + */ + public static final Geo EURO = fromString("EURO"); + + /** + * Static value LATAM for Geo. + */ + public static final Geo LATAM = fromString("LATAM"); + + /** + * Static value NAM for Geo. + */ + public static final Geo NAM = fromString("NAM"); + + /** + * Static value ME for Geo. + */ + public static final Geo ME = fromString("ME"); + + /** + * Static value OCEANIA for Geo. + */ + public static final Geo OCEANIA = fromString("OCEANIA"); + + /** + * Static value AQ for Geo. + */ + public static final Geo AQ = fromString("AQ"); + + /** + * Creates a new instance of Geo value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Geo() { + } + + /** + * Creates or finds a Geo from its string representation. + * + * @param name a name to look for. + * @return the corresponding Geo. + */ + public static Geo fromString(String name) { + return fromString(name, Geo.class); + } + + /** + * Gets known Geo values. + * + * @return known Geo values. + */ + public static Collection values() { + return values(Geo.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetInboundRoutesParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetInboundRoutesParameters.java new file mode 100644 index 0000000000000..4a1486c862ded --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetInboundRoutesParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The parameters specifying the connection resource whose inbound routes are being requested. + */ +@Fluent +public final class GetInboundRoutesParameters implements JsonSerializable { + /* + * The connection resource whose inbound routes are being requested. + */ + private String resourceUri; + + /* + * The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, + * VpnConnection and P2SConnection. + */ + private String connectionType; + + /** + * Creates an instance of GetInboundRoutesParameters class. + */ + public GetInboundRoutesParameters() { + } + + /** + * Get the resourceUri property: The connection resource whose inbound routes are being requested. + * + * @return the resourceUri value. + */ + public String resourceUri() { + return this.resourceUri; + } + + /** + * Set the resourceUri property: The connection resource whose inbound routes are being requested. + * + * @param resourceUri the resourceUri value to set. + * @return the GetInboundRoutesParameters object itself. + */ + public GetInboundRoutesParameters withResourceUri(String resourceUri) { + this.resourceUri = resourceUri; + return this; + } + + /** + * Get the connectionType property: The type of the specified connection resource like ExpressRouteConnection, + * HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @return the connectionType value. + */ + public String connectionType() { + return this.connectionType; + } + + /** + * Set the connectionType property: The type of the specified connection resource like ExpressRouteConnection, + * HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @param connectionType the connectionType value to set. + * @return the GetInboundRoutesParameters object itself. + */ + public GetInboundRoutesParameters withConnectionType(String connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceUri", this.resourceUri); + jsonWriter.writeStringField("connectionType", this.connectionType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetInboundRoutesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetInboundRoutesParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetInboundRoutesParameters. + */ + public static GetInboundRoutesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetInboundRoutesParameters deserializedGetInboundRoutesParameters = new GetInboundRoutesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceUri".equals(fieldName)) { + deserializedGetInboundRoutesParameters.resourceUri = reader.getString(); + } else if ("connectionType".equals(fieldName)) { + deserializedGetInboundRoutesParameters.connectionType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetInboundRoutesParameters; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetOutboundRoutesParameters.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetOutboundRoutesParameters.java new file mode 100644 index 0000000000000..8280c00d9688f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetOutboundRoutesParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The parameters specifying the connection resource whose outbound routes are being requested. + */ +@Fluent +public final class GetOutboundRoutesParameters implements JsonSerializable { + /* + * The connection resource whose outbound routes are being requested. + */ + private String resourceUri; + + /* + * The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, + * VpnConnection and P2SConnection. + */ + private String connectionType; + + /** + * Creates an instance of GetOutboundRoutesParameters class. + */ + public GetOutboundRoutesParameters() { + } + + /** + * Get the resourceUri property: The connection resource whose outbound routes are being requested. + * + * @return the resourceUri value. + */ + public String resourceUri() { + return this.resourceUri; + } + + /** + * Set the resourceUri property: The connection resource whose outbound routes are being requested. + * + * @param resourceUri the resourceUri value to set. + * @return the GetOutboundRoutesParameters object itself. + */ + public GetOutboundRoutesParameters withResourceUri(String resourceUri) { + this.resourceUri = resourceUri; + return this; + } + + /** + * Get the connectionType property: The type of the specified connection resource like ExpressRouteConnection, + * HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @return the connectionType value. + */ + public String connectionType() { + return this.connectionType; + } + + /** + * Set the connectionType property: The type of the specified connection resource like ExpressRouteConnection, + * HubVirtualNetworkConnection, VpnConnection and P2SConnection. + * + * @param connectionType the connectionType value to set. + * @return the GetOutboundRoutesParameters object itself. + */ + public GetOutboundRoutesParameters withConnectionType(String connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceUri", this.resourceUri); + jsonWriter.writeStringField("connectionType", this.connectionType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetOutboundRoutesParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetOutboundRoutesParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetOutboundRoutesParameters. + */ + public static GetOutboundRoutesParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetOutboundRoutesParameters deserializedGetOutboundRoutesParameters = new GetOutboundRoutesParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceUri".equals(fieldName)) { + deserializedGetOutboundRoutesParameters.resourceUri = reader.getString(); + } else if ("connectionType".equals(fieldName)) { + deserializedGetOutboundRoutesParameters.connectionType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetOutboundRoutesParameters; + }); + } +} 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..48a5f84268f26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GetVpnSitesConfigurationRequest.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of Vpn-Sites. + */ +@Fluent +public final class GetVpnSitesConfigurationRequest implements JsonSerializable { + /* + * List of resource-ids of the vpn-sites for which config is to be downloaded. + */ + private List vpnSites; + + /* + * The sas-url to download the configurations for vpn-sites. + */ + private String outputBlobSasUrl; + + /** + * Creates an instance of GetVpnSitesConfigurationRequest class. + */ + public GetVpnSitesConfigurationRequest() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property outputBlobSasUrl in model GetVpnSitesConfigurationRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GetVpnSitesConfigurationRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("outputBlobSasUrl", this.outputBlobSasUrl); + jsonWriter.writeArrayField("vpnSites", this.vpnSites, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetVpnSitesConfigurationRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetVpnSitesConfigurationRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GetVpnSitesConfigurationRequest. + */ + public static GetVpnSitesConfigurationRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetVpnSitesConfigurationRequest deserializedGetVpnSitesConfigurationRequest + = new GetVpnSitesConfigurationRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("outputBlobSasUrl".equals(fieldName)) { + deserializedGetVpnSitesConfigurationRequest.outputBlobSasUrl = reader.getString(); + } else if ("vpnSites".equals(fieldName)) { + List vpnSites = reader.readArray(reader1 -> reader1.getString()); + deserializedGetVpnSitesConfigurationRequest.vpnSites = vpnSites; + } else { + reader.skipChildren(); + } + } + + return deserializedGetVpnSitesConfigurationRequest; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupByUserSession.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupByUserSession.java new file mode 100644 index 0000000000000..569a714e27bdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupByUserSession.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Define user session identifier group by clauses. + */ +@Fluent +public final class GroupByUserSession implements JsonSerializable { + /* + * List of group by clause variables. + */ + private List groupByVariables; + + /** + * Creates an instance of GroupByUserSession class. + */ + public GroupByUserSession() { + } + + /** + * Get the groupByVariables property: List of group by clause variables. + * + * @return the groupByVariables value. + */ + public List groupByVariables() { + return this.groupByVariables; + } + + /** + * Set the groupByVariables property: List of group by clause variables. + * + * @param groupByVariables the groupByVariables value to set. + * @return the GroupByUserSession object itself. + */ + public GroupByUserSession withGroupByVariables(List groupByVariables) { + this.groupByVariables = groupByVariables; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (groupByVariables() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property groupByVariables in model GroupByUserSession")); + } else { + groupByVariables().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GroupByUserSession.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("groupByVariables", this.groupByVariables, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupByUserSession from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupByUserSession if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GroupByUserSession. + */ + public static GroupByUserSession fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupByUserSession deserializedGroupByUserSession = new GroupByUserSession(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupByVariables".equals(fieldName)) { + List groupByVariables + = reader.readArray(reader1 -> GroupByVariable.fromJson(reader1)); + deserializedGroupByUserSession.groupByVariables = groupByVariables; + } else { + reader.skipChildren(); + } + } + + return deserializedGroupByUserSession; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupByVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupByVariable.java new file mode 100644 index 0000000000000..d033630e92ffc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupByVariable.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Define user session group by clause variables. + */ +@Fluent +public final class GroupByVariable implements JsonSerializable { + /* + * User Session clause variable. + */ + private ApplicationGatewayFirewallUserSessionVariable variableName; + + /** + * Creates an instance of GroupByVariable class. + */ + public GroupByVariable() { + } + + /** + * Get the variableName property: User Session clause variable. + * + * @return the variableName value. + */ + public ApplicationGatewayFirewallUserSessionVariable variableName() { + return this.variableName; + } + + /** + * Set the variableName property: User Session clause variable. + * + * @param variableName the variableName value to set. + * @return the GroupByVariable object itself. + */ + public GroupByVariable withVariableName(ApplicationGatewayFirewallUserSessionVariable variableName) { + this.variableName = variableName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (variableName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property variableName in model GroupByVariable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GroupByVariable.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("variableName", this.variableName == null ? null : this.variableName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupByVariable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupByVariable if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GroupByVariable. + */ + public static GroupByVariable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupByVariable deserializedGroupByVariable = new GroupByVariable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("variableName".equals(fieldName)) { + deserializedGroupByVariable.variableName + = ApplicationGatewayFirewallUserSessionVariable.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGroupByVariable; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupConnectivity.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupConnectivity.java new file mode 100644 index 0000000000000..c6323c9d28ec2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupConnectivity.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Group connectivity type. + */ +public final class GroupConnectivity extends ExpandableStringEnum { + /** + * Static value None for GroupConnectivity. + */ + public static final GroupConnectivity NONE = fromString("None"); + + /** + * Static value DirectlyConnected for GroupConnectivity. + */ + public static final GroupConnectivity DIRECTLY_CONNECTED = fromString("DirectlyConnected"); + + /** + * Creates a new instance of GroupConnectivity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GroupConnectivity() { + } + + /** + * Creates or finds a GroupConnectivity from its string representation. + * + * @param name a name to look for. + * @return the corresponding GroupConnectivity. + */ + public static GroupConnectivity fromString(String name) { + return fromString(name, GroupConnectivity.class); + } + + /** + * Gets known GroupConnectivity values. + * + * @return known GroupConnectivity values. + */ + public static Collection values() { + return values(GroupConnectivity.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupMemberType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupMemberType.java new file mode 100644 index 0000000000000..e4c1ff738340b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/GroupMemberType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network Group member type. + */ +public final class GroupMemberType extends ExpandableStringEnum { + /** + * Static value VirtualNetwork for GroupMemberType. + */ + public static final GroupMemberType VIRTUAL_NETWORK = fromString("VirtualNetwork"); + + /** + * Static value Subnet for GroupMemberType. + */ + public static final GroupMemberType SUBNET = fromString("Subnet"); + + /** + * Creates a new instance of GroupMemberType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GroupMemberType() { + } + + /** + * Creates or finds a GroupMemberType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GroupMemberType. + */ + public static GroupMemberType fromString(String name) { + return fromString(name, GroupMemberType.class); + } + + /** + * Gets known GroupMemberType values. + * + * @return known GroupMemberType values. + */ + public static Collection values() { + return values(GroupMemberType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HeaderValueMatcher.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HeaderValueMatcher.java new file mode 100644 index 0000000000000..2ae3599235f05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HeaderValueMatcher.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An optional field under "Rewrite Action". It lets you capture and modify the value(s) of a specific header when + * multiple headers with the same name exist. Currently supported for Set-Cookie Response header only. For more details, + * visit https://aka.ms/appgwheadercrud. + */ +@Fluent +public final class HeaderValueMatcher implements JsonSerializable { + /* + * The pattern, either fixed string or regular expression, that evaluates if a header value should be selected for + * rewrite. + */ + private String pattern; + + /* + * Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. + */ + private Boolean ignoreCase; + + /* + * Setting this value as truth will force to check the negation of the condition given by the user in the pattern + * field. + */ + private Boolean negate; + + /** + * Creates an instance of HeaderValueMatcher class. + */ + public HeaderValueMatcher() { + } + + /** + * Get the pattern property: The pattern, either fixed string or regular expression, that evaluates if a header + * value should be selected for rewrite. + * + * @return the pattern value. + */ + public String pattern() { + return this.pattern; + } + + /** + * Set the pattern property: The pattern, either fixed string or regular expression, that evaluates if a header + * value should be selected for rewrite. + * + * @param pattern the pattern value to set. + * @return the HeaderValueMatcher object itself. + */ + public HeaderValueMatcher 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 HeaderValueMatcher object itself. + */ + public HeaderValueMatcher 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 in the pattern field. + * + * @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 in the pattern field. + * + * @param negate the negate value to set. + * @return the HeaderValueMatcher object itself. + */ + public HeaderValueMatcher withNegate(Boolean negate) { + this.negate = negate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pattern", this.pattern); + jsonWriter.writeBooleanField("ignoreCase", this.ignoreCase); + jsonWriter.writeBooleanField("negate", this.negate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeaderValueMatcher from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeaderValueMatcher if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HeaderValueMatcher. + */ + public static HeaderValueMatcher fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HeaderValueMatcher deserializedHeaderValueMatcher = new HeaderValueMatcher(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pattern".equals(fieldName)) { + deserializedHeaderValueMatcher.pattern = reader.getString(); + } else if ("ignoreCase".equals(fieldName)) { + deserializedHeaderValueMatcher.ignoreCase = reader.getNullable(JsonReader::getBoolean); + } else if ("negate".equals(fieldName)) { + deserializedHeaderValueMatcher.negate = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedHeaderValueMatcher; + }); + } +} 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..c7dc5e6202de5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HopLink.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.HopLinkProperties; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Hop link. + */ +@Immutable +public final class HopLink implements JsonSerializable { + /* + * The ID of the next hop. + */ + private String nextHopId; + + /* + * Link type. + */ + private String linkType; + + /* + * Hop link properties. + */ + private HopLinkProperties innerProperties; + + /* + * List of issues. + */ + private List issues; + + /* + * Provides additional context on links. + */ + private Map context; + + /* + * Resource ID. + */ + private String resourceId; + + /** + * Creates an instance of HopLink class. + */ + public HopLink() { + } + + /** + * 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 innerProperties property: Hop link properties. + * + * @return the innerProperties value. + */ + private HopLinkProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().roundTripTimeMin(); + } + + /** + * Get the roundTripTimeAvg property: Average roundtrip time in milliseconds. + * + * @return the roundTripTimeAvg value. + */ + public Long roundTripTimeAvg() { + return this.innerProperties() == null ? null : this.innerProperties().roundTripTimeAvg(); + } + + /** + * Get the roundTripTimeMax property: Maximum roundtrip time in milliseconds. + * + * @return the roundTripTimeMax value. + */ + public Long roundTripTimeMax() { + return this.innerProperties() == null ? null : this.innerProperties().roundTripTimeMax(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (issues() != null) { + issues().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HopLink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HopLink if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the HopLink. + */ + public static HopLink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HopLink deserializedHopLink = new HopLink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextHopId".equals(fieldName)) { + deserializedHopLink.nextHopId = reader.getString(); + } else if ("linkType".equals(fieldName)) { + deserializedHopLink.linkType = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedHopLink.innerProperties = HopLinkProperties.fromJson(reader); + } else if ("issues".equals(fieldName)) { + List issues = reader.readArray(reader1 -> ConnectivityIssue.fromJson(reader1)); + deserializedHopLink.issues = issues; + } else if ("context".equals(fieldName)) { + Map context = reader.readMap(reader1 -> reader1.getString()); + deserializedHopLink.context = context; + } else if ("resourceId".equals(fieldName)) { + deserializedHopLink.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHopLink; + }); + } +} 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..6806bdaa2ec99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * HTTP configuration of the connectivity check. + */ +@Fluent +public final class HttpConfiguration implements JsonSerializable { + /* + * HTTP method. + */ + private HttpMethod method; + + /* + * List of HTTP headers. + */ + private List headers; + + /* + * Valid status codes. + */ + private List validStatusCodes; + + /** + * Creates an instance of HttpConfiguration class. + */ + public HttpConfiguration() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("method", this.method == null ? null : this.method.toString()); + jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("validStatusCodes", this.validStatusCodes, + (writer, element) -> writer.writeInt(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpConfiguration if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HttpConfiguration. + */ + public static HttpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpConfiguration deserializedHttpConfiguration = new HttpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("method".equals(fieldName)) { + deserializedHttpConfiguration.method = HttpMethod.fromString(reader.getString()); + } else if ("headers".equals(fieldName)) { + List headers = reader.readArray(reader1 -> HttpHeader.fromJson(reader1)); + deserializedHttpConfiguration.headers = headers; + } else if ("validStatusCodes".equals(fieldName)) { + List validStatusCodes = reader.readArray(reader1 -> reader1.getInt()); + deserializedHttpConfiguration.validStatusCodes = validStatusCodes; + } else { + reader.skipChildren(); + } + } + + return deserializedHttpConfiguration; + }); + } +} 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..5199b14ce6f4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpConfigurationMethod.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The HTTP method to use. + */ +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 a new instance of HttpConfigurationMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpConfigurationMethod() { + } + + /** + * Creates or finds a HttpConfigurationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpConfigurationMethod. + */ + public static HttpConfigurationMethod fromString(String name) { + return fromString(name, HttpConfigurationMethod.class); + } + + /** + * Gets known HttpConfigurationMethod values. + * + * @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..d04ce97c9514f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpHeader.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The HTTP header. + */ +@Fluent +public final class HttpHeader implements JsonSerializable { + /* + * The name in HTTP header. + */ + private String name; + + /* + * The value in HTTP header. + */ + private String value; + + /** + * Creates an instance of HttpHeader class. + */ + public HttpHeader() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HttpHeader from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HttpHeader if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the HttpHeader. + */ + public static HttpHeader fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HttpHeader deserializedHttpHeader = new HttpHeader(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedHttpHeader.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedHttpHeader.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHttpHeader; + }); + } +} 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..6229e44418faf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HttpMethod.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 java.util.Collection; + +/** + * HTTP method. + */ +public final class HttpMethod extends ExpandableStringEnum { + /** + * Static value Get for HttpMethod. + */ + public static final HttpMethod GET = fromString("Get"); + + /** + * Creates a new instance of HttpMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpMethod() { + } + + /** + * Creates or finds a HttpMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpMethod. + */ + public static HttpMethod fromString(String name) { + return fromString(name, HttpMethod.class); + } + + /** + * Gets known HttpMethod values. + * + * @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/Hub.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Hub.java new file mode 100644 index 0000000000000..7083092ca7e7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Hub.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Hub Item. + */ +@Fluent +public final class Hub implements JsonSerializable { + /* + * Resource Id. + */ + private String resourceId; + + /* + * Resource Type. + */ + private String resourceType; + + /** + * Creates an instance of Hub class. + */ + public Hub() { + } + + /** + * Get the resourceId property: Resource Id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id. + * + * @param resourceId the resourceId value to set. + * @return the Hub object itself. + */ + public Hub withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the resourceType property: Resource Type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Resource Type. + * + * @param resourceType the resourceType value to set. + * @return the Hub object itself. + */ + public Hub withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("resourceType", this.resourceType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Hub from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Hub if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Hub. + */ + public static Hub fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Hub deserializedHub = new Hub(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedHub.resourceId = reader.getString(); + } else if ("resourceType".equals(fieldName)) { + deserializedHub.resourceType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHub; + }); + } +} 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..e0d9de706799e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubBgpConnectionStatus.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 java.util.Collection; + +/** + * The current state of the VirtualHub to Peer. + */ +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 a new instance of HubBgpConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HubBgpConnectionStatus() { + } + + /** + * Creates or finds a HubBgpConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding HubBgpConnectionStatus. + */ + public static HubBgpConnectionStatus fromString(String name) { + return fromString(name, HubBgpConnectionStatus.class); + } + + /** + * Gets known HubBgpConnectionStatus values. + * + * @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..1a452e66a9521 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpAddresses.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IP addresses associated with azure firewall. + */ +@Fluent +public final class HubIpAddresses implements JsonSerializable { + /* + * Public IP addresses associated with azure firewall. + */ + private HubPublicIpAddresses publicIPs; + + /* + * Private IP Address associated with azure firewall. + */ + private String privateIpAddress; + + /** + * Creates an instance of HubIpAddresses class. + */ + public HubIpAddresses() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("publicIPs", this.publicIPs); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubIpAddresses from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubIpAddresses if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HubIpAddresses. + */ + public static HubIpAddresses fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubIpAddresses deserializedHubIpAddresses = new HubIpAddresses(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPs".equals(fieldName)) { + deserializedHubIpAddresses.publicIPs = HubPublicIpAddresses.fromJson(reader); + } else if ("privateIPAddress".equals(fieldName)) { + deserializedHubIpAddresses.privateIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHubIpAddresses; + }); + } +} 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..05a1390fe166c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfiguration.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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/HubIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..1e6076177a141 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubIpConfigurationPropertiesFormat.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.HubIpConfigurationPropertiesFormatInner; + +/** + * An immutable client-side representation of HubIpConfigurationPropertiesFormat. + */ +public interface HubIpConfigurationPropertiesFormat { + /** + * 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.HubIpConfigurationPropertiesFormatInner + * object. + * + * @return the inner object. + */ + HubIpConfigurationPropertiesFormatInner innerModel(); +} 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..d063a7a4d22d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubPublicIpAddresses.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Public IP addresses associated with azure firewall. + */ +@Fluent +public final class HubPublicIpAddresses implements JsonSerializable { + /* + * The list of Public IP addresses associated with azure firewall or IP addresses to be retained. + */ + private List addresses; + + /* + * The number of Public IP addresses associated with azure firewall. + */ + private Integer count; + + /** + * Creates an instance of HubPublicIpAddresses class. + */ + public HubPublicIpAddresses() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("addresses", this.addresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("count", this.count); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubPublicIpAddresses from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubPublicIpAddresses if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HubPublicIpAddresses. + */ + public static HubPublicIpAddresses fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubPublicIpAddresses deserializedHubPublicIpAddresses = new HubPublicIpAddresses(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addresses".equals(fieldName)) { + List addresses + = reader.readArray(reader1 -> AzureFirewallPublicIpAddress.fromJson(reader1)); + deserializedHubPublicIpAddresses.addresses = addresses; + } else if ("count".equals(fieldName)) { + deserializedHubPublicIpAddresses.count = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHubPublicIpAddresses; + }); + } +} 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..e3afc90c87f1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoute.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * RouteTable route. + */ +@Fluent +public final class HubRoute implements JsonSerializable { + /* + * The name of the Route that is unique within a RouteTable. This name can be used to access this route. + */ + private String name; + + /* + * The type of destinations (eg: CIDR, ResourceId, Service). + */ + private String destinationType; + + /* + * List of all destinations. + */ + private List destinations; + + /* + * The type of next hop (eg: ResourceId). + */ + private String nextHopType; + + /* + * NextHop resource ID. + */ + private String nextHop; + + /** + * Creates an instance of HubRoute class. + */ + public HubRoute() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property name in model HubRoute")); + } + if (destinationType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property destinationType in model HubRoute")); + } + if (destinations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property destinations in model HubRoute")); + } + if (nextHopType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property nextHopType in model HubRoute")); + } + if (nextHop() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property nextHop in model HubRoute")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HubRoute.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("destinationType", this.destinationType); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextHopType", this.nextHopType); + jsonWriter.writeStringField("nextHop", this.nextHop); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HubRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HubRoute if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HubRoute. + */ + public static HubRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HubRoute deserializedHubRoute = new HubRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedHubRoute.name = reader.getString(); + } else if ("destinationType".equals(fieldName)) { + deserializedHubRoute.destinationType = reader.getString(); + } else if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedHubRoute.destinations = destinations; + } else if ("nextHopType".equals(fieldName)) { + deserializedHubRoute.nextHopType = reader.getString(); + } else if ("nextHop".equals(fieldName)) { + deserializedHubRoute.nextHop = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedHubRoute; + }); + } +} 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..abd2eed6d7b56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTable.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.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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..5a39ad0b42492 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRouteTables.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualHubName, String routeTableName, + 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. + */ + HubRouteTable get(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/HubRoutingPreference.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoutingPreference.java new file mode 100644 index 0000000000000..62f094e68d6f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubRoutingPreference.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The hub routing preference gateway types. + */ +public final class HubRoutingPreference extends ExpandableStringEnum { + /** + * Static value ExpressRoute for HubRoutingPreference. + */ + public static final HubRoutingPreference EXPRESS_ROUTE = fromString("ExpressRoute"); + + /** + * Static value VpnGateway for HubRoutingPreference. + */ + public static final HubRoutingPreference VPN_GATEWAY = fromString("VpnGateway"); + + /** + * Static value ASPath for HubRoutingPreference. + */ + public static final HubRoutingPreference ASPATH = fromString("ASPath"); + + /** + * Creates a new instance of HubRoutingPreference value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HubRoutingPreference() { + } + + /** + * Creates or finds a HubRoutingPreference from its string representation. + * + * @param name a name to look for. + * @return the corresponding HubRoutingPreference. + */ + public static HubRoutingPreference fromString(String name) { + return fromString(name, HubRoutingPreference.class); + } + + /** + * Gets known HubRoutingPreference values. + * + * @return known HubRoutingPreference values. + */ + public static Collection values() { + return values(HubRoutingPreference.class); + } +} 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..f68d588810b53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnection.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.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..2e55e0f2f6314 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/HubVirtualNetworkConnections.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(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 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 as paginated + * response with {@link PagedIterable}. + */ + 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 as paginated + * response with {@link PagedIterable}. + */ + 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/IdpsQueryObject.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IdpsQueryObject.java new file mode 100644 index 0000000000000..6fac2e79b55c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IdpsQueryObject.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Will describe the query to run against the IDPS signatures DB. + */ +@Fluent +public final class IdpsQueryObject implements JsonSerializable { + /* + * Contain all filters names and values + */ + private List filters; + + /* + * Search term in all columns + */ + private String search; + + /* + * Column to sort response by + */ + private OrderBy orderBy; + + /* + * The number of the results to return in each page + */ + private Integer resultsPerPage; + + /* + * The number of records matching the filter to skip + */ + private Integer skip; + + /** + * Creates an instance of IdpsQueryObject class. + */ + public IdpsQueryObject() { + } + + /** + * Get the filters property: Contain all filters names and values. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: Contain all filters names and values. + * + * @param filters the filters value to set. + * @return the IdpsQueryObject object itself. + */ + public IdpsQueryObject withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the search property: Search term in all columns. + * + * @return the search value. + */ + public String search() { + return this.search; + } + + /** + * Set the search property: Search term in all columns. + * + * @param search the search value to set. + * @return the IdpsQueryObject object itself. + */ + public IdpsQueryObject withSearch(String search) { + this.search = search; + return this; + } + + /** + * Get the orderBy property: Column to sort response by. + * + * @return the orderBy value. + */ + public OrderBy orderBy() { + return this.orderBy; + } + + /** + * Set the orderBy property: Column to sort response by. + * + * @param orderBy the orderBy value to set. + * @return the IdpsQueryObject object itself. + */ + public IdpsQueryObject withOrderBy(OrderBy orderBy) { + this.orderBy = orderBy; + return this; + } + + /** + * Get the resultsPerPage property: The number of the results to return in each page. + * + * @return the resultsPerPage value. + */ + public Integer resultsPerPage() { + return this.resultsPerPage; + } + + /** + * Set the resultsPerPage property: The number of the results to return in each page. + * + * @param resultsPerPage the resultsPerPage value to set. + * @return the IdpsQueryObject object itself. + */ + public IdpsQueryObject withResultsPerPage(Integer resultsPerPage) { + this.resultsPerPage = resultsPerPage; + return this; + } + + /** + * Get the skip property: The number of records matching the filter to skip. + * + * @return the skip value. + */ + public Integer skip() { + return this.skip; + } + + /** + * Set the skip property: The number of records matching the filter to skip. + * + * @param skip the skip value to set. + * @return the IdpsQueryObject object itself. + */ + public IdpsQueryObject withSkip(Integer skip) { + this.skip = skip; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filters() != null) { + filters().forEach(e -> e.validate()); + } + if (orderBy() != null) { + orderBy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("filters", this.filters, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("search", this.search); + jsonWriter.writeJsonField("orderBy", this.orderBy); + jsonWriter.writeNumberField("resultsPerPage", this.resultsPerPage); + jsonWriter.writeNumberField("skip", this.skip); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdpsQueryObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdpsQueryObject if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IdpsQueryObject. + */ + public static IdpsQueryObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdpsQueryObject deserializedIdpsQueryObject = new IdpsQueryObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filters".equals(fieldName)) { + List filters = reader.readArray(reader1 -> FilterItems.fromJson(reader1)); + deserializedIdpsQueryObject.filters = filters; + } else if ("search".equals(fieldName)) { + deserializedIdpsQueryObject.search = reader.getString(); + } else if ("orderBy".equals(fieldName)) { + deserializedIdpsQueryObject.orderBy = OrderBy.fromJson(reader); + } else if ("resultsPerPage".equals(fieldName)) { + deserializedIdpsQueryObject.resultsPerPage = reader.getNullable(JsonReader::getInt); + } else if ("skip".equals(fieldName)) { + deserializedIdpsQueryObject.skip = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedIdpsQueryObject; + }); + } +} 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..c69a02a3d09db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeEncryption.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The IKE encryption algorithm (IKE phase 2). + */ +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 a new instance of IkeEncryption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IkeEncryption() { + } + + /** + * Creates or finds a IkeEncryption from its string representation. + * + * @param name a name to look for. + * @return the corresponding IkeEncryption. + */ + public static IkeEncryption fromString(String name) { + return fromString(name, IkeEncryption.class); + } + + /** + * Gets known IkeEncryption values. + * + * @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..6cbbbc1660275 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IkeIntegrity.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The IKE integrity algorithm (IKE phase 2). + */ +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 a new instance of IkeIntegrity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IkeIntegrity() { + } + + /** + * Creates or finds a IkeIntegrity from its string representation. + * + * @param name a name to look for. + * @return the corresponding IkeIntegrity. + */ + public static IkeIntegrity fromString(String name) { + return fromString(name, IkeIntegrity.class); + } + + /** + * Gets known IkeIntegrity values. + * + * @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..6a4f94a1303df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatPool.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatPoolPropertiesFormat; +import java.io.IOException; + +/** + * Inbound NAT pool of the load balancer. + */ +@Fluent +public final class InboundNatPool extends SubResource { + /* + * Properties of load balancer inbound nat pool. + */ + private InboundNatPoolPropertiesFormat innerProperties; + + /* + * 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. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Type of the resource. + */ + private String type; + + /** + * Creates an instance of InboundNatPool class. + */ + public InboundNatPool() { + } + + /** + * Get the innerProperties property: Properties of load balancer inbound nat pool. + * + * @return the innerProperties value. + */ + private InboundNatPoolPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public InboundNatPool withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the frontendIpConfiguration property: A reference to frontend IP addresses. + * + * @return the frontendIpConfiguration value. + */ + public SubResource frontendIpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withFrontendIpConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withProtocol(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withFrontendPortRangeStart(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withFrontendPortRangeEnd(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withBackendPort(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withIdleTimeoutInMinutes(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withEnableFloatingIp(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new InboundNatPoolPropertiesFormat(); + } + this.innerProperties().withEnableTcpReset(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundNatPool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundNatPool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundNatPool. + */ + public static InboundNatPool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundNatPool deserializedInboundNatPool = new InboundNatPool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedInboundNatPool.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedInboundNatPool.innerProperties = InboundNatPoolPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedInboundNatPool.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedInboundNatPool.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedInboundNatPool.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundNatPool; + }); + } +} 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..2cdd5a2dfd696 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRule.java @@ -0,0 +1,596 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 frontendPortRangeStart property: The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeStart value. + */ + Integer frontendPortRangeStart(); + + /** + * Gets the frontendPortRangeEnd property: The port range end for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeEnd value. + */ + Integer frontendPortRangeEnd(); + + /** + * Gets the backendAddressPool property: A reference to backendAddressPool resource. + * + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * Gets the provisioningState property: The provisioning state of the inbound NAT rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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, DefinitionStages.WithFrontendPortRangeStart, + DefinitionStages.WithFrontendPortRangeEnd, DefinitionStages.WithBackendAddressPool { + /** + * 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); + } + + /** + * The stage of the InboundNatRule definition allowing to specify frontendPortRangeStart. + */ + interface WithFrontendPortRangeStart { + /** + * Specifies the frontendPortRangeStart property: The port range start for the external endpoint. This + * property is used together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule + * port mappings will be created for each backend address from BackendAddressPool. Acceptable values range + * from 1 to 65534.. + * + * @param frontendPortRangeStart The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will + * be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * @return the next definition stage. + */ + WithCreate withFrontendPortRangeStart(Integer frontendPortRangeStart); + } + + /** + * The stage of the InboundNatRule definition allowing to specify frontendPortRangeEnd. + */ + interface WithFrontendPortRangeEnd { + /** + * Specifies the frontendPortRangeEnd property: The port range end for the external endpoint. This property + * is used together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port + * mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 + * to 65534.. + * + * @param frontendPortRangeEnd The port range end for the external endpoint. This property is used together + * with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * @return the next definition stage. + */ + WithCreate withFrontendPortRangeEnd(Integer frontendPortRangeEnd); + } + + /** + * The stage of the InboundNatRule definition allowing to specify backendAddressPool. + */ + interface WithBackendAddressPool { + /** + * Specifies the backendAddressPool property: A reference to backendAddressPool resource.. + * + * @param backendAddressPool A reference to backendAddressPool resource. + * @return the next definition stage. + */ + WithCreate withBackendAddressPool(SubResource backendAddressPool); + } + } + + /** + * 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, UpdateStages.WithFrontendPortRangeStart, + UpdateStages.WithFrontendPortRangeEnd, UpdateStages.WithBackendAddressPool { + /** + * 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); + } + + /** + * The stage of the InboundNatRule update allowing to specify frontendPortRangeStart. + */ + interface WithFrontendPortRangeStart { + /** + * Specifies the frontendPortRangeStart property: The port range start for the external endpoint. This + * property is used together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule + * port mappings will be created for each backend address from BackendAddressPool. Acceptable values range + * from 1 to 65534.. + * + * @param frontendPortRangeStart The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will + * be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * @return the next definition stage. + */ + Update withFrontendPortRangeStart(Integer frontendPortRangeStart); + } + + /** + * The stage of the InboundNatRule update allowing to specify frontendPortRangeEnd. + */ + interface WithFrontendPortRangeEnd { + /** + * Specifies the frontendPortRangeEnd property: The port range end for the external endpoint. This property + * is used together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port + * mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 + * to 65534.. + * + * @param frontendPortRangeEnd The port range end for the external endpoint. This property is used together + * with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * @return the next definition stage. + */ + Update withFrontendPortRangeEnd(Integer frontendPortRangeEnd); + } + + /** + * The stage of the InboundNatRule update allowing to specify backendAddressPool. + */ + interface WithBackendAddressPool { + /** + * Specifies the backendAddressPool property: A reference to backendAddressPool resource.. + * + * @param backendAddressPool A reference to backendAddressPool resource. + * @return the next definition stage. + */ + Update withBackendAddressPool(SubResource backendAddressPool); + } + } + + /** + * 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..7858212993b1a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRuleListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListInboundNatRule API service call. + */ +@Fluent +public final class InboundNatRuleListResult implements JsonSerializable { + /* + * A list of inbound NAT rules in a load balancer. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of InboundNatRuleListResult class. + */ + public InboundNatRuleListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundNatRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundNatRuleListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundNatRuleListResult. + */ + public static InboundNatRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundNatRuleListResult deserializedInboundNatRuleListResult = new InboundNatRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> InboundNatRuleInner.fromJson(reader1)); + deserializedInboundNatRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedInboundNatRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundNatRuleListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePortMapping.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePortMapping.java new file mode 100644 index 0000000000000..8afde073ca792 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePortMapping.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Individual port mappings for inbound NAT rule created for backend pool. + */ +@Immutable +public final class InboundNatRulePortMapping implements JsonSerializable { + /* + * Name of inbound NAT rule. + */ + private String inboundNatRuleName; + + /* + * The reference to the transport protocol used by the inbound NAT rule. + */ + private TransportProtocol protocol; + + /* + * Frontend port. + */ + private Integer frontendPort; + + /* + * Backend port. + */ + private Integer backendPort; + + /** + * Creates an instance of InboundNatRulePortMapping class. + */ + public InboundNatRulePortMapping() { + } + + /** + * Get the inboundNatRuleName property: Name of inbound NAT rule. + * + * @return the inboundNatRuleName value. + */ + public String inboundNatRuleName() { + return this.inboundNatRuleName; + } + + /** + * Get the protocol property: The reference to the transport protocol used by the inbound NAT rule. + * + * @return the protocol value. + */ + public TransportProtocol protocol() { + return this.protocol; + } + + /** + * Get the frontendPort property: Frontend port. + * + * @return the frontendPort value. + */ + public Integer frontendPort() { + return this.frontendPort; + } + + /** + * Get the backendPort property: Backend port. + * + * @return the backendPort value. + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundNatRulePortMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundNatRulePortMapping if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundNatRulePortMapping. + */ + public static InboundNatRulePortMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundNatRulePortMapping deserializedInboundNatRulePortMapping = new InboundNatRulePortMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inboundNatRuleName".equals(fieldName)) { + deserializedInboundNatRulePortMapping.inboundNatRuleName = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedInboundNatRulePortMapping.protocol = TransportProtocol.fromString(reader.getString()); + } else if ("frontendPort".equals(fieldName)) { + deserializedInboundNatRulePortMapping.frontendPort = reader.getNullable(JsonReader::getInt); + } else if ("backendPort".equals(fieldName)) { + deserializedInboundNatRulePortMapping.backendPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedInboundNatRulePortMapping; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePropertiesFormat.java new file mode 100644 index 0000000000000..e1174d80a3eaf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRulePropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.InboundNatRulePropertiesFormatInner; + +/** + * An immutable client-side representation of InboundNatRulePropertiesFormat. + */ +public interface InboundNatRulePropertiesFormat { + /** + * 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 frontendPortRangeStart property: The port range start for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeStart value. + */ + Integer frontendPortRangeStart(); + + /** + * Gets the frontendPortRangeEnd property: The port range end for the external endpoint. This property is used + * together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be + * created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. + * + * @return the frontendPortRangeEnd value. + */ + Integer frontendPortRangeEnd(); + + /** + * Gets the backendAddressPool property: A reference to backendAddressPool resource. + * + * @return the backendAddressPool value. + */ + SubResource backendAddressPool(); + + /** + * 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.InboundNatRulePropertiesFormatInner + * object. + * + * @return the inner object. + */ + InboundNatRulePropertiesFormatInner innerModel(); +} 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..5fd58a6199e46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundNatRules.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String inboundNatRuleName, String expand, 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 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..1283173b2ab69 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRule.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.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 ruleType property: Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only + * creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. + * + * @return the ruleType value. + */ + InboundSecurityRuleType ruleType(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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.WithRuleType, 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 ruleType. + */ + interface WithRuleType { + /** + * Specifies the ruleType property: Rule Type. This should be either AutoExpire or Permanent. Auto Expire + * Rule only creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule.. + * + * @param ruleType Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates + * NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. + * @return the next definition stage. + */ + WithCreate withRuleType(InboundSecurityRuleType ruleType); + } + + /** + * 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.WithRuleType, 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 ruleType. + */ + interface WithRuleType { + /** + * Specifies the ruleType property: Rule Type. This should be either AutoExpire or Permanent. Auto Expire + * Rule only creates NSG rules. Permanent Rule creates NSG rule and SLB LB Rule.. + * + * @param ruleType Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates + * NSG rules. Permanent Rule creates NSG rule and SLB LB Rule. + * @return the next definition stage. + */ + Update withRuleType(InboundSecurityRuleType ruleType); + } + + /** + * 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); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + InboundSecurityRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + InboundSecurityRule refresh(Context context); +} 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..f41b9b66d84a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleOperations.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.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of InboundSecurityRuleOperations. + */ +public interface InboundSecurityRuleOperations { + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkVirtualApplianceName, + String ruleCollectionName, Context context); + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + */ + InboundSecurityRule get(String resourceGroupName, String networkVirtualApplianceName, String ruleCollectionName); + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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 nVA Inbound Security Rule resource along with {@link Response}. + */ + InboundSecurityRule getById(String id); + + /** + * Retrieves the available specified Network Virtual Appliance Inbound Security Rules Collection. + * + * @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 nVA Inbound Security Rule resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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/InboundSecurityRuleType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleType.java new file mode 100644 index 0000000000000..4ea9481a88da7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRuleType.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 java.util.Collection; + +/** + * Rule Type. This should be either AutoExpire or Permanent. Auto Expire Rule only creates NSG rules. Permanent Rule + * creates NSG rule and SLB LB Rule. + */ +public final class InboundSecurityRuleType extends ExpandableStringEnum { + /** + * Static value AutoExpire for InboundSecurityRuleType. + */ + public static final InboundSecurityRuleType AUTO_EXPIRE = fromString("AutoExpire"); + + /** + * Static value Permanent for InboundSecurityRuleType. + */ + public static final InboundSecurityRuleType PERMANENT = fromString("Permanent"); + + /** + * Creates a new instance of InboundSecurityRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InboundSecurityRuleType() { + } + + /** + * Creates or finds a InboundSecurityRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding InboundSecurityRuleType. + */ + public static InboundSecurityRuleType fromString(String name) { + return fromString(name, InboundSecurityRuleType.class); + } + + /** + * Gets known InboundSecurityRuleType values. + * + * @return known InboundSecurityRuleType values. + */ + public static Collection values() { + return values(InboundSecurityRuleType.class); + } +} 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..219f5d3151ff3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRules.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the Inbound Security Rules resource. + */ +@Fluent +public final class InboundSecurityRules implements JsonSerializable { + /* + * Name of the rule. + */ + private String name; + + /* + * Protocol. This should be either TCP or UDP. + */ + private InboundSecurityRulesProtocol protocol; + + /* + * The CIDR or source IP range. + */ + private String sourceAddressPrefix; + + /* + * NVA port ranges to be opened up. One needs to provide specific ports. + */ + private Integer destinationPortRange; + + /* + * NVA port ranges to be opened up. One can provide a range of ports. Allowed port value between 0 and 65535. + */ + private List destinationPortRanges; + + /* + * Public IP name in case of Permanent Rule type & Interface Name in case of Auto Expire Rule type + */ + private List appliesOn; + + /** + * Creates an instance of InboundSecurityRules class. + */ + public InboundSecurityRules() { + } + + /** + * 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 InboundSecurityRules object itself. + */ + public InboundSecurityRules withName(String name) { + this.name = name; + return this; + } + + /** + * 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. + * + * @return the sourceAddressPrefix value. + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set the sourceAddressPrefix property: The CIDR or source IP range. + * + * @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; + } + + /** + * Get the destinationPortRanges property: NVA port ranges to be opened up. One can provide a range of ports. + * Allowed port value between 0 and 65535. + * + * @return the destinationPortRanges value. + */ + public List destinationPortRanges() { + return this.destinationPortRanges; + } + + /** + * Set the destinationPortRanges property: NVA port ranges to be opened up. One can provide a range of ports. + * Allowed port value between 0 and 65535. + * + * @param destinationPortRanges the destinationPortRanges value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withDestinationPortRanges(List destinationPortRanges) { + this.destinationPortRanges = destinationPortRanges; + return this; + } + + /** + * Get the appliesOn property: Public IP name in case of Permanent Rule type & Interface Name in case of Auto + * Expire Rule type. + * + * @return the appliesOn value. + */ + public List appliesOn() { + return this.appliesOn; + } + + /** + * Set the appliesOn property: Public IP name in case of Permanent Rule type & Interface Name in case of Auto + * Expire Rule type. + * + * @param appliesOn the appliesOn value to set. + * @return the InboundSecurityRules object itself. + */ + public InboundSecurityRules withAppliesOn(List appliesOn) { + this.appliesOn = appliesOn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("sourceAddressPrefix", this.sourceAddressPrefix); + jsonWriter.writeNumberField("destinationPortRange", this.destinationPortRange); + jsonWriter.writeArrayField("destinationPortRanges", this.destinationPortRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("appliesOn", this.appliesOn, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InboundSecurityRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InboundSecurityRules if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the InboundSecurityRules. + */ + public static InboundSecurityRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InboundSecurityRules deserializedInboundSecurityRules = new InboundSecurityRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedInboundSecurityRules.name = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedInboundSecurityRules.protocol + = InboundSecurityRulesProtocol.fromString(reader.getString()); + } else if ("sourceAddressPrefix".equals(fieldName)) { + deserializedInboundSecurityRules.sourceAddressPrefix = reader.getString(); + } else if ("destinationPortRange".equals(fieldName)) { + deserializedInboundSecurityRules.destinationPortRange = reader.getNullable(JsonReader::getInt); + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedInboundSecurityRules.destinationPortRanges = destinationPortRanges; + } else if ("appliesOn".equals(fieldName)) { + List appliesOn = reader.readArray(reader1 -> reader1.getString()); + deserializedInboundSecurityRules.appliesOn = appliesOn; + } else { + reader.skipChildren(); + } + } + + return deserializedInboundSecurityRules; + }); + } +} 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..6a91e0abf0085 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InboundSecurityRulesProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol. This should be either TCP or UDP. + */ +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 a new instance of InboundSecurityRulesProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InboundSecurityRulesProtocol() { + } + + /** + * Creates or finds a InboundSecurityRulesProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding InboundSecurityRulesProtocol. + */ + public static InboundSecurityRulesProtocol fromString(String name) { + return fromString(name, InboundSecurityRulesProtocol.class); + } + + /** + * Gets known InboundSecurityRulesProtocol values. + * + * @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/InternetIngressPublicIpsProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InternetIngressPublicIpsProperties.java new file mode 100644 index 0000000000000..c3b420b2c68b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/InternetIngressPublicIpsProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Internet Ingress Public Ip Properties + * + * Resource Uri of Public Ip for Standard Load Balancer Frontend End. + */ +@Fluent +public final class InternetIngressPublicIpsProperties implements JsonSerializable { + /* + * Resource Uri of Public Ip + */ + private String id; + + /** + * Creates an instance of InternetIngressPublicIpsProperties class. + */ + public InternetIngressPublicIpsProperties() { + } + + /** + * Get the id property: Resource Uri of Public Ip. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource Uri of Public Ip. + * + * @param id the id value to set. + * @return the InternetIngressPublicIpsProperties object itself. + */ + public InternetIngressPublicIpsProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InternetIngressPublicIpsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InternetIngressPublicIpsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InternetIngressPublicIpsProperties. + */ + public static InternetIngressPublicIpsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InternetIngressPublicIpsProperties deserializedInternetIngressPublicIpsProperties + = new InternetIngressPublicIpsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedInternetIngressPublicIpsProperties.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInternetIngressPublicIpsProperties; + }); + } +} 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..205ed772486c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAddressAvailabilityResult.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.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..175894c6c4541 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocation.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..a99242856d4c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.IpAllocationInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListIpAllocations API service call. + */ +@Fluent +public final class IpAllocationListResult implements JsonSerializable { + /* + * A list of IpAllocation resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of IpAllocationListResult class. + */ + public IpAllocationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAllocationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAllocationListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpAllocationListResult. + */ + public static IpAllocationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAllocationListResult deserializedIpAllocationListResult = new IpAllocationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> IpAllocationInner.fromJson(reader1)); + deserializedIpAllocationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIpAllocationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAllocationListResult; + }); + } +} 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..0b57a6d92bd48 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationMethod.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IP address allocation method. + */ +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 a new instance of IpAllocationMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpAllocationMethod() { + } + + /** + * Creates or finds a IpAllocationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationMethod. + */ + public static IpAllocationMethod fromString(String name) { + return fromString(name, IpAllocationMethod.class); + } + + /** + * Gets known IpAllocationMethod values. + * + * @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..f4d6e9bf69bb9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocationType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IpAllocation type. + */ +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 a new instance of IpAllocationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpAllocationType() { + } + + /** + * Creates or finds a IpAllocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAllocationType. + */ + public static IpAllocationType fromString(String name) { + return fromString(name, IpAllocationType.class); + } + + /** + * Gets known IpAllocationType values. + * + * @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..934a0de890036 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpAllocations.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String ipAllocationName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..21e7c8092fed8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfiguration.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.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..9a017be872d94 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationBgpPeeringAddress.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of IPConfigurationBgpPeeringAddress. + */ +@Fluent +public final class IpConfigurationBgpPeeringAddress implements JsonSerializable { + /* + * The ID of IP configuration which belongs to gateway. + */ + private String ipconfigurationId; + + /* + * The list of default BGP peering addresses which belong to IP configuration. + */ + private List defaultBgpIpAddresses; + + /* + * The list of custom BGP peering addresses which belong to IP configuration. + */ + private List customBgpIpAddresses; + + /* + * The list of tunnel public IP addresses which belong to IP configuration. + */ + private List tunnelIpAddresses; + + /** + * Creates an instance of IpConfigurationBgpPeeringAddress class. + */ + public IpConfigurationBgpPeeringAddress() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipconfigurationId", this.ipconfigurationId); + jsonWriter.writeArrayField("customBgpIpAddresses", this.customBgpIpAddresses, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpConfigurationBgpPeeringAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpConfigurationBgpPeeringAddress if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IpConfigurationBgpPeeringAddress. + */ + public static IpConfigurationBgpPeeringAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpConfigurationBgpPeeringAddress deserializedIpConfigurationBgpPeeringAddress + = new IpConfigurationBgpPeeringAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipconfigurationId".equals(fieldName)) { + deserializedIpConfigurationBgpPeeringAddress.ipconfigurationId = reader.getString(); + } else if ("defaultBgpIpAddresses".equals(fieldName)) { + List defaultBgpIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedIpConfigurationBgpPeeringAddress.defaultBgpIpAddresses = defaultBgpIpAddresses; + } else if ("customBgpIpAddresses".equals(fieldName)) { + List customBgpIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedIpConfigurationBgpPeeringAddress.customBgpIpAddresses = customBgpIpAddresses; + } else if ("tunnelIpAddresses".equals(fieldName)) { + List tunnelIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedIpConfigurationBgpPeeringAddress.tunnelIpAddresses = tunnelIpAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedIpConfigurationBgpPeeringAddress; + }); + } +} 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..d85f9505b7ab9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfile.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.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/IpConfigurationProfilePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfilePropertiesFormat.java new file mode 100644 index 0000000000000..44e4b374ed396 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationProfilePropertiesFormat.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.resourcemanager.network.generated.fluent.models.IpConfigurationProfilePropertiesFormatInner; + +/** + * An immutable client-side representation of IpConfigurationProfilePropertiesFormat. + */ +public interface IpConfigurationProfilePropertiesFormat { + /** + * 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.IpConfigurationProfilePropertiesFormatInner object. + * + * @return the inner object. + */ + IpConfigurationProfilePropertiesFormatInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..8f63463047cb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpConfigurationPropertiesFormat.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.IpConfigurationPropertiesFormatInner; + +/** + * An immutable client-side representation of IpConfigurationPropertiesFormat. + */ +public interface IpConfigurationPropertiesFormat { + /** + * 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.IpConfigurationPropertiesFormatInner + * object. + * + * @return the inner object. + */ + IpConfigurationPropertiesFormatInner 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..7d54df6045fc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpFlowProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol to be verified on. + */ +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 a new instance of IpFlowProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpFlowProtocol() { + } + + /** + * Creates or finds a IpFlowProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpFlowProtocol. + */ + public static IpFlowProtocol fromString(String name) { + return fromString(name, IpFlowProtocol.class); + } + + /** + * Gets known IpFlowProtocol values. + * + * @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..a3297bc806eb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroup.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..a286369317cf9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroupListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.IpGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListIpGroups API service call. + */ +@Fluent +public final class IpGroupListResult implements JsonSerializable { + /* + * The list of IpGroups information resources. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of IpGroupListResult class. + */ + public IpGroupListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpGroupListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IpGroupListResult. + */ + public static IpGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpGroupListResult deserializedIpGroupListResult = new IpGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> IpGroupInner.fromJson(reader1)); + deserializedIpGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIpGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpGroupListResult; + }); + } +} 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..dde1e11ac28ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpGroups.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String ipGroupsName, String expand, + Context context); + + /** + * 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/IpPrefixesList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpPrefixesList.java new file mode 100644 index 0000000000000..6f4bb16aea927 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpPrefixesList.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.IpPrefixesListInner; +import java.util.List; + +/** + * An immutable client-side representation of IpPrefixesList. + */ +public interface IpPrefixesList { + /** + * Gets the ipPrefixes property: IP Prefix value. + * + * @return the ipPrefixes value. + */ + List ipPrefixes(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.IpPrefixesListInner object. + * + * @return the inner object. + */ + IpPrefixesListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpRule.java new file mode 100644 index 0000000000000..2d59abd8c5504 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpRule.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The IpRule model. + */ +@Fluent +public final class IpRule implements JsonSerializable { + /* + * Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + */ + private String addressPrefix; + + /** + * Creates an instance of IpRule class. + */ + public IpRule() { + } + + /** + * Get the addressPrefix property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param addressPrefix the addressPrefix value to set. + * @return the IpRule object itself. + */ + public IpRule withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpRule if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the IpRule. + */ + public static IpRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpRule deserializedIpRule = new IpRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefix".equals(fieldName)) { + deserializedIpRule.addressPrefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpRule; + }); + } +} 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..ef935b8bfe9ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpTag.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains the IpTag associated with the object. + */ +@Fluent +public final class IpTag implements JsonSerializable { + /* + * The IP tag type. Example: FirstPartyUsage. + */ + private String ipTagType; + + /* + * The value of the IP tag associated with the public IP. Example: SQL. + */ + private String tag; + + /** + * Creates an instance of IpTag class. + */ + public IpTag() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipTagType", this.ipTagType); + jsonWriter.writeStringField("tag", this.tag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpTag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpTag if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the IpTag. + */ + public static IpTag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpTag deserializedIpTag = new IpTag(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipTagType".equals(fieldName)) { + deserializedIpTag.ipTagType = reader.getString(); + } else if ("tag".equals(fieldName)) { + deserializedIpTag.tag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpTag; + }); + } +} 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..3c32279f94cf4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpVersion.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * IP address version. + */ +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 a new instance of IpVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpVersion() { + } + + /** + * Creates or finds a IpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersion. + */ + public static IpVersion fromString(String name) { + return fromString(name, IpVersion.class); + } + + /** + * Gets known IpVersion values. + * + * @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..0a44a86a15641 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecEncryption.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The IPSec encryption algorithm (IKE phase 1). + */ +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 a new instance of IpsecEncryption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpsecEncryption() { + } + + /** + * Creates or finds a IpsecEncryption from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpsecEncryption. + */ + public static IpsecEncryption fromString(String name) { + return fromString(name, IpsecEncryption.class); + } + + /** + * Gets known IpsecEncryption values. + * + * @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..4a62dbba0a8ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecIntegrity.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The IPSec integrity algorithm (IKE phase 1). + */ +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 a new instance of IpsecIntegrity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpsecIntegrity() { + } + + /** + * Creates or finds a IpsecIntegrity from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpsecIntegrity. + */ + public static IpsecIntegrity fromString(String name) { + return fromString(name, IpsecIntegrity.class); + } + + /** + * Gets known IpsecIntegrity values. + * + * @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..e1f0bbf2dfc9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IpsecPolicy.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An IPSec Policy configuration for a virtual network gateway connection. + */ +@Fluent +public final class IpsecPolicy implements JsonSerializable { + /* + * The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN + * tunnel. + */ + 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. + */ + private int saDataSizeKilobytes; + + /* + * The IPSec encryption algorithm (IKE phase 1). + */ + private IpsecEncryption ipsecEncryption; + + /* + * The IPSec integrity algorithm (IKE phase 1). + */ + private IpsecIntegrity ipsecIntegrity; + + /* + * The IKE encryption algorithm (IKE phase 2). + */ + private IkeEncryption ikeEncryption; + + /* + * The IKE integrity algorithm (IKE phase 2). + */ + private IkeIntegrity ikeIntegrity; + + /* + * The DH Group used in IKE Phase 1 for initial SA. + */ + private DhGroup dhGroup; + + /* + * The Pfs Group used in IKE Phase 2 for new child SA. + */ + private PfsGroup pfsGroup; + + /** + * Creates an instance of IpsecPolicy class. + */ + public IpsecPolicy() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property ipsecEncryption in model IpsecPolicy")); + } + if (ipsecIntegrity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ipsecIntegrity in model IpsecPolicy")); + } + if (ikeEncryption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ikeEncryption in model IpsecPolicy")); + } + if (ikeIntegrity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ikeIntegrity in model IpsecPolicy")); + } + if (dhGroup() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property dhGroup in model IpsecPolicy")); + } + if (pfsGroup() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property pfsGroup in model IpsecPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpsecPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("saLifeTimeSeconds", this.saLifeTimeSeconds); + jsonWriter.writeIntField("saDataSizeKilobytes", this.saDataSizeKilobytes); + jsonWriter.writeStringField("ipsecEncryption", + this.ipsecEncryption == null ? null : this.ipsecEncryption.toString()); + jsonWriter.writeStringField("ipsecIntegrity", + this.ipsecIntegrity == null ? null : this.ipsecIntegrity.toString()); + jsonWriter.writeStringField("ikeEncryption", this.ikeEncryption == null ? null : this.ikeEncryption.toString()); + jsonWriter.writeStringField("ikeIntegrity", this.ikeIntegrity == null ? null : this.ikeIntegrity.toString()); + jsonWriter.writeStringField("dhGroup", this.dhGroup == null ? null : this.dhGroup.toString()); + jsonWriter.writeStringField("pfsGroup", this.pfsGroup == null ? null : this.pfsGroup.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpsecPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpsecPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpsecPolicy. + */ + public static IpsecPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpsecPolicy deserializedIpsecPolicy = new IpsecPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("saLifeTimeSeconds".equals(fieldName)) { + deserializedIpsecPolicy.saLifeTimeSeconds = reader.getInt(); + } else if ("saDataSizeKilobytes".equals(fieldName)) { + deserializedIpsecPolicy.saDataSizeKilobytes = reader.getInt(); + } else if ("ipsecEncryption".equals(fieldName)) { + deserializedIpsecPolicy.ipsecEncryption = IpsecEncryption.fromString(reader.getString()); + } else if ("ipsecIntegrity".equals(fieldName)) { + deserializedIpsecPolicy.ipsecIntegrity = IpsecIntegrity.fromString(reader.getString()); + } else if ("ikeEncryption".equals(fieldName)) { + deserializedIpsecPolicy.ikeEncryption = IkeEncryption.fromString(reader.getString()); + } else if ("ikeIntegrity".equals(fieldName)) { + deserializedIpsecPolicy.ikeIntegrity = IkeIntegrity.fromString(reader.getString()); + } else if ("dhGroup".equals(fieldName)) { + deserializedIpsecPolicy.dhGroup = DhGroup.fromString(reader.getString()); + } else if ("pfsGroup".equals(fieldName)) { + deserializedIpsecPolicy.pfsGroup = PfsGroup.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpsecPolicy; + }); + } +} 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..3d98eac9d2228 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6CircuitConnectionConfig.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IPv6 Circuit Connection properties for global reach. + */ +@Fluent +public final class Ipv6CircuitConnectionConfig implements JsonSerializable { + /* + * /125 IP address space to carve out customer addresses for global reach. + */ + private String addressPrefix; + + /* + * Express Route Circuit connection state. + */ + private CircuitConnectionStatus circuitConnectionStatus; + + /** + * Creates an instance of Ipv6CircuitConnectionConfig class. + */ + public Ipv6CircuitConnectionConfig() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressPrefix", this.addressPrefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ipv6CircuitConnectionConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ipv6CircuitConnectionConfig if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ipv6CircuitConnectionConfig. + */ + public static Ipv6CircuitConnectionConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ipv6CircuitConnectionConfig deserializedIpv6CircuitConnectionConfig = new Ipv6CircuitConnectionConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefix".equals(fieldName)) { + deserializedIpv6CircuitConnectionConfig.addressPrefix = reader.getString(); + } else if ("circuitConnectionStatus".equals(fieldName)) { + deserializedIpv6CircuitConnectionConfig.circuitConnectionStatus + = CircuitConnectionStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpv6CircuitConnectionConfig; + }); + } +} 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..c37b831e53fa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Ipv6ExpressRouteCircuitPeeringConfig.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains IPv6 peering config. + */ +@Fluent +public final class Ipv6ExpressRouteCircuitPeeringConfig + implements JsonSerializable { + /* + * The primary address prefix. + */ + private String primaryPeerAddressPrefix; + + /* + * The secondary address prefix. + */ + private String secondaryPeerAddressPrefix; + + /* + * The Microsoft peering configuration. + */ + private ExpressRouteCircuitPeeringConfig microsoftPeeringConfig; + + /* + * The reference to the RouteFilter resource. + */ + private SubResource routeFilter; + + /* + * The state of peering. + */ + private ExpressRouteCircuitPeeringState state; + + /** + * Creates an instance of Ipv6ExpressRouteCircuitPeeringConfig class. + */ + public Ipv6ExpressRouteCircuitPeeringConfig() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("primaryPeerAddressPrefix", this.primaryPeerAddressPrefix); + jsonWriter.writeStringField("secondaryPeerAddressPrefix", this.secondaryPeerAddressPrefix); + jsonWriter.writeJsonField("microsoftPeeringConfig", this.microsoftPeeringConfig); + jsonWriter.writeJsonField("routeFilter", this.routeFilter); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Ipv6ExpressRouteCircuitPeeringConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Ipv6ExpressRouteCircuitPeeringConfig if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Ipv6ExpressRouteCircuitPeeringConfig. + */ + public static Ipv6ExpressRouteCircuitPeeringConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Ipv6ExpressRouteCircuitPeeringConfig deserializedIpv6ExpressRouteCircuitPeeringConfig + = new Ipv6ExpressRouteCircuitPeeringConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primaryPeerAddressPrefix".equals(fieldName)) { + deserializedIpv6ExpressRouteCircuitPeeringConfig.primaryPeerAddressPrefix = reader.getString(); + } else if ("secondaryPeerAddressPrefix".equals(fieldName)) { + deserializedIpv6ExpressRouteCircuitPeeringConfig.secondaryPeerAddressPrefix = reader.getString(); + } else if ("microsoftPeeringConfig".equals(fieldName)) { + deserializedIpv6ExpressRouteCircuitPeeringConfig.microsoftPeeringConfig + = ExpressRouteCircuitPeeringConfig.fromJson(reader); + } else if ("routeFilter".equals(fieldName)) { + deserializedIpv6ExpressRouteCircuitPeeringConfig.routeFilter = SubResource.fromJson(reader); + } else if ("state".equals(fieldName)) { + deserializedIpv6ExpressRouteCircuitPeeringConfig.state + = ExpressRouteCircuitPeeringState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpv6ExpressRouteCircuitPeeringConfig; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsGlobal.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsGlobal.java new file mode 100644 index 0000000000000..b9d063aaf49b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsGlobal.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Flag if global mesh is supported. + */ +public final class IsGlobal extends ExpandableStringEnum { + /** + * Static value False for IsGlobal. + */ + public static final IsGlobal FALSE = fromString("False"); + + /** + * Static value True for IsGlobal. + */ + public static final IsGlobal TRUE = fromString("True"); + + /** + * Creates a new instance of IsGlobal value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsGlobal() { + } + + /** + * Creates or finds a IsGlobal from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsGlobal. + */ + public static IsGlobal fromString(String name) { + return fromString(name, IsGlobal.class); + } + + /** + * Gets known IsGlobal values. + * + * @return known IsGlobal values. + */ + public static Collection values() { + return values(IsGlobal.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsWorkloadProtected.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsWorkloadProtected.java new file mode 100644 index 0000000000000..28cc60662bc49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IsWorkloadProtected.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Value indicating whether the IP address is DDoS workload protected or not. + */ +public final class IsWorkloadProtected extends ExpandableStringEnum { + /** + * Static value False for IsWorkloadProtected. + */ + public static final IsWorkloadProtected FALSE = fromString("False"); + + /** + * Static value True for IsWorkloadProtected. + */ + public static final IsWorkloadProtected TRUE = fromString("True"); + + /** + * Creates a new instance of IsWorkloadProtected value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsWorkloadProtected() { + } + + /** + * Creates or finds a IsWorkloadProtected from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsWorkloadProtected. + */ + public static IsWorkloadProtected fromString(String name) { + return fromString(name, IsWorkloadProtected.class); + } + + /** + * Gets known IsWorkloadProtected values. + * + * @return known IsWorkloadProtected values. + */ + public static Collection values() { + return values(IsWorkloadProtected.class); + } +} 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..d1f86491cf83b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/IssueType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of issue. + */ +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 a new instance of IssueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IssueType() { + } + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * Gets known IssueType values. + * + * @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..bca3d1bb49b15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubRouteTablesResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.HubRouteTableInner; +import java.io.IOException; +import java.util.List; + +/** + * List of RouteTables and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListHubRouteTablesResult implements JsonSerializable { + /* + * List of RouteTables. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListHubRouteTablesResult class. + */ + public ListHubRouteTablesResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListHubRouteTablesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListHubRouteTablesResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListHubRouteTablesResult. + */ + public static ListHubRouteTablesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListHubRouteTablesResult deserializedListHubRouteTablesResult = new ListHubRouteTablesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> HubRouteTableInner.fromJson(reader1)); + deserializedListHubRouteTablesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListHubRouteTablesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListHubRouteTablesResult; + }); + } +} 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..c64441abf5cfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListHubVirtualNetworkConnectionsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of HubVirtualNetworkConnections and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListHubVirtualNetworkConnectionsResult + implements JsonSerializable { + /* + * List of HubVirtualNetworkConnections. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListHubVirtualNetworkConnectionsResult class. + */ + public ListHubVirtualNetworkConnectionsResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListHubVirtualNetworkConnectionsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListHubVirtualNetworkConnectionsResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListHubVirtualNetworkConnectionsResult. + */ + public static ListHubVirtualNetworkConnectionsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListHubVirtualNetworkConnectionsResult deserializedListHubVirtualNetworkConnectionsResult + = new ListHubVirtualNetworkConnectionsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HubVirtualNetworkConnectionInner.fromJson(reader1)); + deserializedListHubVirtualNetworkConnectionsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListHubVirtualNetworkConnectionsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListHubVirtualNetworkConnectionsResult; + }); + } +} 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..b78214d6ec9d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListP2SVpnGatewaysResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.P2SVpnGatewayInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of P2SVpnGateways. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListP2SVpnGatewaysResult class. + */ + public ListP2SVpnGatewaysResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListP2SVpnGatewaysResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListP2SVpnGatewaysResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListP2SVpnGatewaysResult. + */ + public static ListP2SVpnGatewaysResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListP2SVpnGatewaysResult deserializedListP2SVpnGatewaysResult = new ListP2SVpnGatewaysResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> P2SVpnGatewayInner.fromJson(reader1)); + deserializedListP2SVpnGatewaysResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListP2SVpnGatewaysResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListP2SVpnGatewaysResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRouteMapsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRouteMapsResult.java new file mode 100644 index 0000000000000..4ea9a85bb77c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRouteMapsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RouteMapInner; +import java.io.IOException; +import java.util.List; + +/** + * List of RouteMaps and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListRouteMapsResult implements JsonSerializable { + /* + * List of RouteMaps. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListRouteMapsResult class. + */ + public ListRouteMapsResult() { + } + + /** + * Get the value property: List of RouteMaps. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of RouteMaps. + * + * @param value the value value to set. + * @return the ListRouteMapsResult object itself. + */ + public ListRouteMapsResult 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 ListRouteMapsResult object itself. + */ + public ListRouteMapsResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListRouteMapsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListRouteMapsResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListRouteMapsResult. + */ + public static ListRouteMapsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListRouteMapsResult deserializedListRouteMapsResult = new ListRouteMapsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RouteMapInner.fromJson(reader1)); + deserializedListRouteMapsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListRouteMapsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListRouteMapsResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRoutingIntentResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRoutingIntentResult.java new file mode 100644 index 0000000000000..c07e13e13cd04 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListRoutingIntentResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner; +import java.io.IOException; +import java.util.List; + +/** + * List of the routing intent result and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListRoutingIntentResult implements JsonSerializable { + /* + * List of RoutingIntent resource. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListRoutingIntentResult class. + */ + public ListRoutingIntentResult() { + } + + /** + * Get the value property: List of RoutingIntent resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of RoutingIntent resource. + * + * @param value the value value to set. + * @return the ListRoutingIntentResult object itself. + */ + public ListRoutingIntentResult 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 ListRoutingIntentResult object itself. + */ + public ListRoutingIntentResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListRoutingIntentResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListRoutingIntentResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListRoutingIntentResult. + */ + public static ListRoutingIntentResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListRoutingIntentResult deserializedListRoutingIntentResult = new ListRoutingIntentResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RoutingIntentInner.fromJson(reader1)); + deserializedListRoutingIntentResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListRoutingIntentResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListRoutingIntentResult; + }); + } +} 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..a0fa53aab8fb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubBgpConnectionResults.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BgpConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * VirtualHubBgpConnections list. + */ +@Fluent +public final class ListVirtualHubBgpConnectionResults implements JsonSerializable { + /* + * The list of VirtualHubBgpConnections. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ListVirtualHubBgpConnectionResults class. + */ + public ListVirtualHubBgpConnectionResults() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVirtualHubBgpConnectionResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVirtualHubBgpConnectionResults if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVirtualHubBgpConnectionResults. + */ + public static ListVirtualHubBgpConnectionResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVirtualHubBgpConnectionResults deserializedListVirtualHubBgpConnectionResults + = new ListVirtualHubBgpConnectionResults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> BgpConnectionInner.fromJson(reader1)); + deserializedListVirtualHubBgpConnectionResults.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVirtualHubBgpConnectionResults.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVirtualHubBgpConnectionResults; + }); + } +} 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..6ab4c23be1722 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubIpConfigurationResults.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.HubIpConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * VirtualHubIpConfigurations list. + */ +@Fluent +public final class ListVirtualHubIpConfigurationResults + implements JsonSerializable { + /* + * The list of VirtualHubIpConfigurations. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ListVirtualHubIpConfigurationResults class. + */ + public ListVirtualHubIpConfigurationResults() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVirtualHubIpConfigurationResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVirtualHubIpConfigurationResults if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVirtualHubIpConfigurationResults. + */ + public static ListVirtualHubIpConfigurationResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVirtualHubIpConfigurationResults deserializedListVirtualHubIpConfigurationResults + = new ListVirtualHubIpConfigurationResults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> HubIpConfigurationInner.fromJson(reader1)); + deserializedListVirtualHubIpConfigurationResults.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVirtualHubIpConfigurationResults.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVirtualHubIpConfigurationResults; + }); + } +} 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..c62ae13c4be9c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubRouteTableV2SResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import java.io.IOException; +import java.util.List; + +/** + * List of VirtualHubRouteTableV2s and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVirtualHubRouteTableV2SResult implements JsonSerializable { + /* + * List of VirtualHubRouteTableV2s. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVirtualHubRouteTableV2SResult class. + */ + public ListVirtualHubRouteTableV2SResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVirtualHubRouteTableV2SResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVirtualHubRouteTableV2SResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVirtualHubRouteTableV2SResult. + */ + public static ListVirtualHubRouteTableV2SResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVirtualHubRouteTableV2SResult deserializedListVirtualHubRouteTableV2SResult + = new ListVirtualHubRouteTableV2SResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualHubRouteTableV2Inner.fromJson(reader1)); + deserializedListVirtualHubRouteTableV2SResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVirtualHubRouteTableV2SResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVirtualHubRouteTableV2SResult; + }); + } +} 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..a99a9220a5edb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualHubsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of VirtualHubs. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVirtualHubsResult class. + */ + public ListVirtualHubsResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVirtualHubsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVirtualHubsResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVirtualHubsResult. + */ + public static ListVirtualHubsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVirtualHubsResult deserializedListVirtualHubsResult = new ListVirtualHubsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VirtualHubInner.fromJson(reader1)); + deserializedListVirtualHubsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVirtualHubsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVirtualHubsResult; + }); + } +} 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..0eda7428ea04a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualNetworkGatewayNatRulesResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * List of Nat Rules. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVirtualNetworkGatewayNatRulesResult class. + */ + public ListVirtualNetworkGatewayNatRulesResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVirtualNetworkGatewayNatRulesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVirtualNetworkGatewayNatRulesResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVirtualNetworkGatewayNatRulesResult. + */ + public static ListVirtualNetworkGatewayNatRulesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVirtualNetworkGatewayNatRulesResult deserializedListVirtualNetworkGatewayNatRulesResult + = new ListVirtualNetworkGatewayNatRulesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkGatewayNatRuleInner.fromJson(reader1)); + deserializedListVirtualNetworkGatewayNatRulesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVirtualNetworkGatewayNatRulesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVirtualNetworkGatewayNatRulesResult; + }); + } +} 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..2408d844eb861 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVirtualWansResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualWanInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of VirtualWANs. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVirtualWansResult class. + */ + public ListVirtualWansResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVirtualWansResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVirtualWansResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVirtualWansResult. + */ + public static ListVirtualWansResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVirtualWansResult deserializedListVirtualWansResult = new ListVirtualWansResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VirtualWanInner.fromJson(reader1)); + deserializedListVirtualWansResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVirtualWansResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVirtualWansResult; + }); + } +} 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..0884c3cb8573f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnConnectionsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of Vpn Connections. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnConnectionsResult class. + */ + public ListVpnConnectionsResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnConnectionsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnConnectionsResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnConnectionsResult. + */ + public static ListVpnConnectionsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnConnectionsResult deserializedListVpnConnectionsResult = new ListVpnConnectionsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VpnConnectionInner.fromJson(reader1)); + deserializedListVpnConnectionsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnConnectionsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnConnectionsResult; + }); + } +} 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..b311048626d76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewayNatRulesResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of Nat Rules. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnGatewayNatRulesResult class. + */ + public ListVpnGatewayNatRulesResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnGatewayNatRulesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnGatewayNatRulesResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnGatewayNatRulesResult. + */ + public static ListVpnGatewayNatRulesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnGatewayNatRulesResult deserializedListVpnGatewayNatRulesResult = new ListVpnGatewayNatRulesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VpnGatewayNatRuleInner.fromJson(reader1)); + deserializedListVpnGatewayNatRulesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnGatewayNatRulesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnGatewayNatRulesResult; + }); + } +} 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..5461ed4355556 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnGatewaysResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of VpnGateways. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnGatewaysResult class. + */ + public ListVpnGatewaysResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnGatewaysResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnGatewaysResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnGatewaysResult. + */ + public static ListVpnGatewaysResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnGatewaysResult deserializedListVpnGatewaysResult = new ListVpnGatewaysResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VpnGatewayInner.fromJson(reader1)); + deserializedListVpnGatewaysResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnGatewaysResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnGatewaysResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationPolicyGroupsResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationPolicyGroupsResult.java new file mode 100644 index 0000000000000..e516c1203b50c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationPolicyGroupsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list VpnServerConfigurationPolicyGroups. It contains a list of + * VpnServerConfigurationPolicyGroups and a URL nextLink to get the next set of results. + */ +@Fluent +public final class ListVpnServerConfigurationPolicyGroupsResult + implements JsonSerializable { + /* + * List of VpnServerConfigurationPolicyGroups. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnServerConfigurationPolicyGroupsResult class. + */ + public ListVpnServerConfigurationPolicyGroupsResult() { + } + + /** + * Get the value property: List of VpnServerConfigurationPolicyGroups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of VpnServerConfigurationPolicyGroups. + * + * @param value the value value to set. + * @return the ListVpnServerConfigurationPolicyGroupsResult object itself. + */ + public ListVpnServerConfigurationPolicyGroupsResult 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 ListVpnServerConfigurationPolicyGroupsResult object itself. + */ + public ListVpnServerConfigurationPolicyGroupsResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnServerConfigurationPolicyGroupsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnServerConfigurationPolicyGroupsResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnServerConfigurationPolicyGroupsResult. + */ + public static ListVpnServerConfigurationPolicyGroupsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnServerConfigurationPolicyGroupsResult deserializedListVpnServerConfigurationPolicyGroupsResult + = new ListVpnServerConfigurationPolicyGroupsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VpnServerConfigurationPolicyGroupInner.fromJson(reader1)); + deserializedListVpnServerConfigurationPolicyGroupsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnServerConfigurationPolicyGroupsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnServerConfigurationPolicyGroupsResult; + }); + } +} 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..613776dcc8593 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnServerConfigurationsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of VpnServerConfigurations. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnServerConfigurationsResult class. + */ + public ListVpnServerConfigurationsResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnServerConfigurationsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnServerConfigurationsResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnServerConfigurationsResult. + */ + public static ListVpnServerConfigurationsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnServerConfigurationsResult deserializedListVpnServerConfigurationsResult + = new ListVpnServerConfigurationsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VpnServerConfigurationInner.fromJson(reader1)); + deserializedListVpnServerConfigurationsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnServerConfigurationsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnServerConfigurationsResult; + }); + } +} 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..b9f34c30b61a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinkConnectionsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of VpnSiteLinkConnections. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnSiteLinkConnectionsResult class. + */ + public ListVpnSiteLinkConnectionsResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnSiteLinkConnectionsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnSiteLinkConnectionsResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnSiteLinkConnectionsResult. + */ + public static ListVpnSiteLinkConnectionsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnSiteLinkConnectionsResult deserializedListVpnSiteLinkConnectionsResult + = new ListVpnSiteLinkConnectionsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VpnSiteLinkConnectionInner.fromJson(reader1)); + deserializedListVpnSiteLinkConnectionsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnSiteLinkConnectionsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnSiteLinkConnectionsResult; + }); + } +} 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..1b6559858035d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSiteLinksResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of VpnSitesLinks. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnSiteLinksResult class. + */ + public ListVpnSiteLinksResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnSiteLinksResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnSiteLinksResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnSiteLinksResult. + */ + public static ListVpnSiteLinksResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnSiteLinksResult deserializedListVpnSiteLinksResult = new ListVpnSiteLinksResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VpnSiteLinkInner.fromJson(reader1)); + deserializedListVpnSiteLinksResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnSiteLinksResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnSiteLinksResult; + }); + } +} 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..5b557bcfcc70b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ListVpnSitesResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of VpnSites. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of ListVpnSitesResult class. + */ + public ListVpnSitesResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListVpnSitesResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListVpnSitesResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListVpnSitesResult. + */ + public static ListVpnSitesResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListVpnSitesResult deserializedListVpnSitesResult = new ListVpnSitesResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VpnSiteInner.fromJson(reader1)); + deserializedListVpnSitesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListVpnSitesResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListVpnSitesResult; + }); + } +} 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..ae411ac73b3bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancer.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..b8d690328a5a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddress.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerBackendAddressPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * Load balancer backend addresses. + */ +@Fluent +public final class LoadBalancerBackendAddress implements JsonSerializable { + /* + * Properties of load balancer backend address pool. + */ + private LoadBalancerBackendAddressPropertiesFormat innerProperties; + + /* + * Name of the backend address. + */ + private String name; + + /** + * Creates an instance of LoadBalancerBackendAddress class. + */ + public LoadBalancerBackendAddress() { + } + + /** + * Get the innerProperties property: Properties of load balancer backend address pool. + * + * @return the innerProperties value. + */ + private LoadBalancerBackendAddressPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerBackendAddressPropertiesFormat(); + } + this.innerProperties().withVirtualNetwork(virtualNetwork); + return this; + } + + /** + * Get the subnet property: Reference to an existing subnet. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerBackendAddressPropertiesFormat(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the ipAddress property: IP Address belonging to the referenced virtual network. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerBackendAddressPropertiesFormat(); + } + this.innerProperties().withIpAddress(ipAddress); + return this; + } + + /** + * Get the networkInterfaceIpConfiguration property: Reference to IP address defined in network interfaces. + * + * @return the networkInterfaceIpConfiguration value. + */ + public SubResource networkInterfaceIpConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerBackendAddressPropertiesFormat(); + } + this.innerProperties().withLoadBalancerFrontendIpConfiguration(loadBalancerFrontendIpConfiguration); + return this; + } + + /** + * Get the inboundNatRulesPortMapping property: Collection of inbound NAT rule port mappings. + * + * @return the inboundNatRulesPortMapping value. + */ + public List inboundNatRulesPortMapping() { + return this.innerProperties() == null ? null : this.innerProperties().inboundNatRulesPortMapping(); + } + + /** + * Get the adminState property: A list of administrative states which once set can override health probe so that + * Load Balancer will always forward new connections to backend, or deny new connections and reset existing + * connections. + * + * @return the adminState value. + */ + public LoadBalancerBackendAddressAdminState adminState() { + return this.innerProperties() == null ? null : this.innerProperties().adminState(); + } + + /** + * Set the adminState property: A list of administrative states which once set can override health probe so that + * Load Balancer will always forward new connections to backend, or deny new connections and reset existing + * connections. + * + * @param adminState the adminState value to set. + * @return the LoadBalancerBackendAddress object itself. + */ + public LoadBalancerBackendAddress withAdminState(LoadBalancerBackendAddressAdminState adminState) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerBackendAddressPropertiesFormat(); + } + this.innerProperties().withAdminState(adminState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerBackendAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerBackendAddress if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerBackendAddress. + */ + public static LoadBalancerBackendAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerBackendAddress deserializedLoadBalancerBackendAddress = new LoadBalancerBackendAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedLoadBalancerBackendAddress.innerProperties + = LoadBalancerBackendAddressPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedLoadBalancerBackendAddress.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerBackendAddress; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressAdminState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressAdminState.java new file mode 100644 index 0000000000000..67e97caf74ea2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressAdminState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * A list of administrative states which once set can override health probe so that Load Balancer will always forward + * new connections to backend, or deny new connections and reset existing connections. + */ +public final class LoadBalancerBackendAddressAdminState + extends ExpandableStringEnum { + /** + * Static value None for LoadBalancerBackendAddressAdminState. + */ + public static final LoadBalancerBackendAddressAdminState NONE = fromString("None"); + + /** + * Static value Up for LoadBalancerBackendAddressAdminState. + */ + public static final LoadBalancerBackendAddressAdminState UP = fromString("Up"); + + /** + * Static value Down for LoadBalancerBackendAddressAdminState. + */ + public static final LoadBalancerBackendAddressAdminState DOWN = fromString("Down"); + + /** + * Creates a new instance of LoadBalancerBackendAddressAdminState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoadBalancerBackendAddressAdminState() { + } + + /** + * Creates or finds a LoadBalancerBackendAddressAdminState from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerBackendAddressAdminState. + */ + public static LoadBalancerBackendAddressAdminState fromString(String name) { + return fromString(name, LoadBalancerBackendAddressAdminState.class); + } + + /** + * Gets known LoadBalancerBackendAddressAdminState values. + * + * @return known LoadBalancerBackendAddressAdminState values. + */ + public static Collection values() { + return values(LoadBalancerBackendAddressAdminState.class); + } +} 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..182e28bbfe069 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPoolListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.BackendAddressPoolInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListBackendAddressPool API service call. + */ +@Fluent +public final class LoadBalancerBackendAddressPoolListResult + implements JsonSerializable { + /* + * A list of backend address pools in a load balancer. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LoadBalancerBackendAddressPoolListResult class. + */ + public LoadBalancerBackendAddressPoolListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerBackendAddressPoolListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerBackendAddressPoolListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerBackendAddressPoolListResult. + */ + public static LoadBalancerBackendAddressPoolListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerBackendAddressPoolListResult deserializedLoadBalancerBackendAddressPoolListResult + = new LoadBalancerBackendAddressPoolListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BackendAddressPoolInner.fromJson(reader1)); + deserializedLoadBalancerBackendAddressPoolListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLoadBalancerBackendAddressPoolListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerBackendAddressPoolListResult; + }); + } +} 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..5211367eb956c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerBackendAddressPools.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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String backendAddressPoolName, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..007ea12627158 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurationListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListFrontendIPConfiguration API service call. + */ +@Fluent +public final class LoadBalancerFrontendIpConfigurationListResult + implements JsonSerializable { + /* + * A list of frontend IP configurations in a load balancer. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LoadBalancerFrontendIpConfigurationListResult class. + */ + public LoadBalancerFrontendIpConfigurationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerFrontendIpConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerFrontendIpConfigurationListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerFrontendIpConfigurationListResult. + */ + public static LoadBalancerFrontendIpConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerFrontendIpConfigurationListResult deserializedLoadBalancerFrontendIpConfigurationListResult + = new LoadBalancerFrontendIpConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FrontendIpConfigurationInner.fromJson(reader1)); + deserializedLoadBalancerFrontendIpConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLoadBalancerFrontendIpConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerFrontendIpConfigurationListResult; + }); + } +} 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..bebf5fcda06e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerFrontendIpConfigurations.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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String frontendIpConfigurationName, 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); +} 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..c3d09081da1cf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListLoadBalancers API service call. + */ +@Fluent +public final class LoadBalancerListResult implements JsonSerializable { + /* + * A list of load balancers in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LoadBalancerListResult class. + */ + public LoadBalancerListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerListResult. + */ + public static LoadBalancerListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerListResult deserializedLoadBalancerListResult = new LoadBalancerListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LoadBalancerInner.fromJson(reader1)); + deserializedLoadBalancerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLoadBalancerListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerListResult; + }); + } +} 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..c5465134d985a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRuleListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancingRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListLoadBalancingRule API service call. + */ +@Fluent +public final class LoadBalancerLoadBalancingRuleListResult + implements JsonSerializable { + /* + * A list of load balancing rules in a load balancer. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LoadBalancerLoadBalancingRuleListResult class. + */ + public LoadBalancerLoadBalancingRuleListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerLoadBalancingRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerLoadBalancingRuleListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerLoadBalancingRuleListResult. + */ + public static LoadBalancerLoadBalancingRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerLoadBalancingRuleListResult deserializedLoadBalancerLoadBalancingRuleListResult + = new LoadBalancerLoadBalancingRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LoadBalancingRuleInner.fromJson(reader1)); + deserializedLoadBalancerLoadBalancingRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLoadBalancerLoadBalancingRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerLoadBalancingRuleListResult; + }); + } +} 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..ea5cc37e4a323 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerLoadBalancingRules.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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String loadBalancerName, + String loadBalancingRuleName, 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); +} 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..888d28eac4a2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerNetworkInterfaces.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..df9c907a02678 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.OutboundRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListOutboundRule API service call. + */ +@Fluent +public final class LoadBalancerOutboundRuleListResult implements JsonSerializable { + /* + * A list of outbound rules in a load balancer. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LoadBalancerOutboundRuleListResult class. + */ + public LoadBalancerOutboundRuleListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerOutboundRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerOutboundRuleListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerOutboundRuleListResult. + */ + public static LoadBalancerOutboundRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerOutboundRuleListResult deserializedLoadBalancerOutboundRuleListResult + = new LoadBalancerOutboundRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OutboundRuleInner.fromJson(reader1)); + deserializedLoadBalancerOutboundRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLoadBalancerOutboundRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerOutboundRuleListResult; + }); + } +} 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..3a51160d14544 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRuleProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol for the outbound rule in load balancer. + */ +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 a new instance of LoadBalancerOutboundRuleProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoadBalancerOutboundRuleProtocol() { + } + + /** + * Creates or finds a LoadBalancerOutboundRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerOutboundRuleProtocol. + */ + public static LoadBalancerOutboundRuleProtocol fromString(String name) { + return fromString(name, LoadBalancerOutboundRuleProtocol.class); + } + + /** + * Gets known LoadBalancerOutboundRuleProtocol values. + * + * @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..27fc39eb81402 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerOutboundRules.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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String loadBalancerName, String outboundRuleName, + 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); +} 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..b9e0a40a2e402 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbeListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ProbeInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListProbe API service call. + */ +@Fluent +public final class LoadBalancerProbeListResult implements JsonSerializable { + /* + * A list of probes in a load balancer. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LoadBalancerProbeListResult class. + */ + public LoadBalancerProbeListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerProbeListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerProbeListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerProbeListResult. + */ + public static LoadBalancerProbeListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerProbeListResult deserializedLoadBalancerProbeListResult = new LoadBalancerProbeListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ProbeInner.fromJson(reader1)); + deserializedLoadBalancerProbeListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLoadBalancerProbeListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerProbeListResult; + }); + } +} 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..e7939cb1ac901 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerProbes.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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String loadBalancerName, String probeName, + 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); +} 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..7553f2eef9f25 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSku.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU of a load balancer. + */ +@Fluent +public final class LoadBalancerSku implements JsonSerializable { + /* + * Name of a load balancer SKU. + */ + private LoadBalancerSkuName name; + + /* + * Tier of a load balancer SKU. + */ + private LoadBalancerSkuTier tier; + + /** + * Creates an instance of LoadBalancerSku class. + */ + public LoadBalancerSku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerSku. + */ + public static LoadBalancerSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerSku deserializedLoadBalancerSku = new LoadBalancerSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLoadBalancerSku.name = LoadBalancerSkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedLoadBalancerSku.tier = LoadBalancerSkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerSku; + }); + } +} 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..ebcc5b56dbd53 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuName.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of a load balancer SKU. + */ +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 a new instance of LoadBalancerSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoadBalancerSkuName() { + } + + /** + * Creates or finds a LoadBalancerSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSkuName. + */ + public static LoadBalancerSkuName fromString(String name) { + return fromString(name, LoadBalancerSkuName.class); + } + + /** + * Gets known LoadBalancerSkuName values. + * + * @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..62051b0a50a23 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerSkuTier.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tier of a load balancer SKU. + */ +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 a new instance of LoadBalancerSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoadBalancerSkuTier() { + } + + /** + * Creates or finds a LoadBalancerSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSkuTier. + */ + public static LoadBalancerSkuTier fromString(String name) { + return fromString(name, LoadBalancerSkuTier.class); + } + + /** + * Gets known LoadBalancerSkuTier values. + * + * @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..31394cc7eaf10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequest.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The request for a VIP swap. + */ +@Fluent +public final class LoadBalancerVipSwapRequest implements JsonSerializable { + /* + * A list of frontend IP configuration resources that should swap VIPs. + */ + private List frontendIpConfigurations; + + /** + * Creates an instance of LoadBalancerVipSwapRequest class. + */ + public LoadBalancerVipSwapRequest() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("frontendIPConfigurations", this.frontendIpConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerVipSwapRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerVipSwapRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerVipSwapRequest. + */ + public static LoadBalancerVipSwapRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerVipSwapRequest deserializedLoadBalancerVipSwapRequest = new LoadBalancerVipSwapRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frontendIPConfigurations".equals(fieldName)) { + List frontendIpConfigurations = reader + .readArray(reader1 -> LoadBalancerVipSwapRequestFrontendIpConfiguration.fromJson(reader1)); + deserializedLoadBalancerVipSwapRequest.frontendIpConfigurations = frontendIpConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerVipSwapRequest; + }); + } +} 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..f66646eeac9c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancerVipSwapRequestFrontendIpConfiguration.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerVipSwapRequestFrontendIpConfigurationProperties; +import java.io.IOException; + +/** + * VIP swap request's frontend IP configuration object. + */ +@Fluent +public final class LoadBalancerVipSwapRequestFrontendIpConfiguration + implements JsonSerializable { + /* + * The ID of frontend IP configuration resource. + */ + private String id; + + /* + * The properties of VIP swap request's frontend IP configuration object. + */ + private LoadBalancerVipSwapRequestFrontendIpConfigurationProperties innerProperties; + + /** + * Creates an instance of LoadBalancerVipSwapRequestFrontendIpConfiguration class. + */ + public LoadBalancerVipSwapRequestFrontendIpConfiguration() { + } + + /** + * 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 innerProperties property: The properties of VIP swap request's frontend IP configuration object. + * + * @return the innerProperties value. + */ + private LoadBalancerVipSwapRequestFrontendIpConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the publicIpAddress property: A reference to public IP address resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new LoadBalancerVipSwapRequestFrontendIpConfigurationProperties(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoadBalancerVipSwapRequestFrontendIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoadBalancerVipSwapRequestFrontendIpConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LoadBalancerVipSwapRequestFrontendIpConfiguration. + */ + public static LoadBalancerVipSwapRequestFrontendIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoadBalancerVipSwapRequestFrontendIpConfiguration deserializedLoadBalancerVipSwapRequestFrontendIpConfiguration + = new LoadBalancerVipSwapRequestFrontendIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLoadBalancerVipSwapRequestFrontendIpConfiguration.id = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLoadBalancerVipSwapRequestFrontendIpConfiguration.innerProperties + = LoadBalancerVipSwapRequestFrontendIpConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLoadBalancerVipSwapRequestFrontendIpConfiguration; + }); + } +} 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..9045494412d1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancers.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String loadBalancerName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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); + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API. + */ + BackendAddressInboundNatRulePortMappings listInboundNatRulePortMappings(String groupName, String loadBalancerName, + String backendPoolName, QueryInboundNatRulePortMappingRequest parameters); + + /** + * List of inbound NAT rule port mappings. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param backendPoolName The name of the load balancer backend address pool. + * @param parameters Query inbound NAT rule port mapping request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a QueryInboundNatRulePortMapping API. + */ + BackendAddressInboundNatRulePortMappings listInboundNatRulePortMappings(String groupName, String loadBalancerName, + String backendPoolName, QueryInboundNatRulePortMappingRequest parameters, Context context); + + /** + * Migrate load balancer to IP Based. + * + * @param groupName The name of the resource group. + * @param loadBalancerName The name of the load balancer. + * @param parameters Parameters supplied to the migrateToIpBased Api. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for a migrateToIpBased API along with {@link Response}. + */ + Response migrateToIpBasedWithResponse(String groupName, String loadBalancerName, + MigrateLoadBalancerToIpBasedRequest parameters, Context context); + + /** + * Migrate load balancer to IP Based. + * + * @param groupName 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 response for a migrateToIpBased API. + */ + MigratedPools migrateToIpBased(String groupName, String loadBalancerName); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..76fc917ca25bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadBalancingRule.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.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. + */ + int 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..daea4664bce5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LoadDistribution.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The load distribution policy for this rule. + */ +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 a new instance of LoadDistribution value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LoadDistribution() { + } + + /** + * Creates or finds a LoadDistribution from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadDistribution. + */ + public static LoadDistribution fromString(String name) { + return fromString(name, LoadDistribution.class); + } + + /** + * Gets known LoadDistribution values. + * + * @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..61bb6ae931594 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateway.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..860837bd1b1c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGatewayListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListLocalNetworkGateways API service call. + */ +@Fluent +public final class LocalNetworkGatewayListResult implements JsonSerializable { + /* + * A list of local network gateways that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of LocalNetworkGatewayListResult class. + */ + public LocalNetworkGatewayListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalNetworkGatewayListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalNetworkGatewayListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LocalNetworkGatewayListResult. + */ + public static LocalNetworkGatewayListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalNetworkGatewayListResult deserializedLocalNetworkGatewayListResult + = new LocalNetworkGatewayListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LocalNetworkGatewayInner.fromJson(reader1)); + deserializedLocalNetworkGatewayListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLocalNetworkGatewayListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalNetworkGatewayListResult; + }); + } +} 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..097c30a81ad33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LocalNetworkGateways.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String localNetworkGatewayName, 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. + */ + LocalNetworkGateway getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..7744d67bf8ca0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/LogSpecification.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Description of logging specification. + */ +@Fluent +public final class LogSpecification implements JsonSerializable { + /* + * The name of the specification. + */ + private String name; + + /* + * The display name of the specification. + */ + private String displayName; + + /* + * Duration of the blob. + */ + private String blobDuration; + + /** + * Creates an instance of LogSpecification class. + */ + public LogSpecification() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogSpecification. + */ + public static LogSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSpecification deserializedLogSpecification = new LogSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLogSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLogSpecification.displayName = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedLogSpecification.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogSpecification; + }); + } +} 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..8467292881b6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleEnabledState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of the managed rule. Defaults to Disabled if not specified. + */ +public final class ManagedRuleEnabledState extends ExpandableStringEnum { + /** + * Static value Disabled for ManagedRuleEnabledState. + */ + public static final ManagedRuleEnabledState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for ManagedRuleEnabledState. + */ + public static final ManagedRuleEnabledState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of ManagedRuleEnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedRuleEnabledState() { + } + + /** + * Creates or finds a ManagedRuleEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedRuleEnabledState. + */ + public static ManagedRuleEnabledState fromString(String name) { + return fromString(name, ManagedRuleEnabledState.class); + } + + /** + * Gets known ManagedRuleEnabledState values. + * + * @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..ffd59f3476e8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleGroupOverride.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines a managed rule group override setting. + */ +@Fluent +public final class ManagedRuleGroupOverride implements JsonSerializable { + /* + * The managed rule group to override. + */ + private String ruleGroupName; + + /* + * List of rules that will be disabled. If none specified, all rules in the group will be disabled. + */ + private List rules; + + /** + * Creates an instance of ManagedRuleGroupOverride class. + */ + public ManagedRuleGroupOverride() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property ruleGroupName in model ManagedRuleGroupOverride")); + } + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleGroupOverride.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleGroupName", this.ruleGroupName); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleGroupOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleGroupOverride if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRuleGroupOverride. + */ + public static ManagedRuleGroupOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleGroupOverride deserializedManagedRuleGroupOverride = new ManagedRuleGroupOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleGroupName".equals(fieldName)) { + deserializedManagedRuleGroupOverride.ruleGroupName = reader.getString(); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ManagedRuleOverride.fromJson(reader1)); + deserializedManagedRuleGroupOverride.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleGroupOverride; + }); + } +} 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..8a3fd99d7d88e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleOverride.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines a managed rule group override setting. + */ +@Fluent +public final class ManagedRuleOverride implements JsonSerializable { + /* + * Identifier for the managed rule. + */ + private String ruleId; + + /* + * The state of the managed rule. Defaults to Disabled if not specified. + */ + private ManagedRuleEnabledState state; + + /* + * Describes the override action to be applied when rule matches. + */ + private ActionType action; + + /* + * Describes the override sensitivity to be applied when rule matches. + */ + private SensitivityType sensitivity; + + /** + * Creates an instance of ManagedRuleOverride class. + */ + public ManagedRuleOverride() { + } + + /** + * 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; + } + + /** + * Get the action property: Describes the override action to be applied when rule matches. + * + * @return the action value. + */ + public ActionType action() { + return this.action; + } + + /** + * Set the action property: Describes the override action to be applied when rule matches. + * + * @param action the action value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withAction(ActionType action) { + this.action = action; + return this; + } + + /** + * Get the sensitivity property: Describes the override sensitivity to be applied when rule matches. + * + * @return the sensitivity value. + */ + public SensitivityType sensitivity() { + return this.sensitivity; + } + + /** + * Set the sensitivity property: Describes the override sensitivity to be applied when rule matches. + * + * @param sensitivity the sensitivity value to set. + * @return the ManagedRuleOverride object itself. + */ + public ManagedRuleOverride withSensitivity(SensitivityType sensitivity) { + this.sensitivity = sensitivity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleId in model ManagedRuleOverride")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleOverride.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleId", this.ruleId); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("sensitivity", this.sensitivity == null ? null : this.sensitivity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleOverride if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRuleOverride. + */ + public static ManagedRuleOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleOverride deserializedManagedRuleOverride = new ManagedRuleOverride(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleId".equals(fieldName)) { + deserializedManagedRuleOverride.ruleId = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedManagedRuleOverride.state = ManagedRuleEnabledState.fromString(reader.getString()); + } else if ("action".equals(fieldName)) { + deserializedManagedRuleOverride.action = ActionType.fromString(reader.getString()); + } else if ("sensitivity".equals(fieldName)) { + deserializedManagedRuleOverride.sensitivity = SensitivityType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleOverride; + }); + } +} 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..a09a6f98e2d00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRuleSet.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines a managed rule set. + */ +@Fluent +public final class ManagedRuleSet implements JsonSerializable { + /* + * Defines the rule set type to use. + */ + private String ruleSetType; + + /* + * Defines the version of the rule set to use. + */ + private String ruleSetVersion; + + /* + * Defines the rule group overrides to apply to the rule set. + */ + private List ruleGroupOverrides; + + /** + * Creates an instance of ManagedRuleSet class. + */ + public ManagedRuleSet() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property ruleSetType in model ManagedRuleSet")); + } + if (ruleSetVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ruleSetVersion in model ManagedRuleSet")); + } + if (ruleGroupOverrides() != null) { + ruleGroupOverrides().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRuleSet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleSetType", this.ruleSetType); + jsonWriter.writeStringField("ruleSetVersion", this.ruleSetVersion); + jsonWriter.writeArrayField("ruleGroupOverrides", this.ruleGroupOverrides, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRuleSet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRuleSet. + */ + public static ManagedRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRuleSet deserializedManagedRuleSet = new ManagedRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleSetType".equals(fieldName)) { + deserializedManagedRuleSet.ruleSetType = reader.getString(); + } else if ("ruleSetVersion".equals(fieldName)) { + deserializedManagedRuleSet.ruleSetVersion = reader.getString(); + } else if ("ruleGroupOverrides".equals(fieldName)) { + List ruleGroupOverrides + = reader.readArray(reader1 -> ManagedRuleGroupOverride.fromJson(reader1)); + deserializedManagedRuleSet.ruleGroupOverrides = ruleGroupOverrides; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRuleSet; + }); + } +} 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..51db9fa3d680a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedRulesDefinition.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Allow to exclude some variable satisfy the condition for the WAF check. + */ +@Fluent +public final class ManagedRulesDefinition implements JsonSerializable { + /* + * The exceptions that are applied on the policy. + */ + private List exceptions; + + /* + * The Exclusions that are applied on the policy. + */ + private List exclusions; + + /* + * The managed rule sets that are associated with the policy. + */ + private List managedRuleSets; + + /** + * Creates an instance of ManagedRulesDefinition class. + */ + public ManagedRulesDefinition() { + } + + /** + * Get the exceptions property: The exceptions that are applied on the policy. + * + * @return the exceptions value. + */ + public List exceptions() { + return this.exceptions; + } + + /** + * Set the exceptions property: The exceptions that are applied on the policy. + * + * @param exceptions the exceptions value to set. + * @return the ManagedRulesDefinition object itself. + */ + public ManagedRulesDefinition withExceptions(List exceptions) { + this.exceptions = exceptions; + return this; + } + + /** + * 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 (exceptions() != null) { + exceptions().forEach(e -> e.validate()); + } + if (exclusions() != null) { + exclusions().forEach(e -> e.validate()); + } + if (managedRuleSets() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property managedRuleSets in model ManagedRulesDefinition")); + } else { + managedRuleSets().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedRulesDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("managedRuleSets", this.managedRuleSets, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("exceptions", this.exceptions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("exclusions", this.exclusions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedRulesDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedRulesDefinition if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedRulesDefinition. + */ + public static ManagedRulesDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedRulesDefinition deserializedManagedRulesDefinition = new ManagedRulesDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managedRuleSets".equals(fieldName)) { + List managedRuleSets + = reader.readArray(reader1 -> ManagedRuleSet.fromJson(reader1)); + deserializedManagedRulesDefinition.managedRuleSets = managedRuleSets; + } else if ("exceptions".equals(fieldName)) { + List exceptions = reader.readArray(reader1 -> ExceptionEntry.fromJson(reader1)); + deserializedManagedRulesDefinition.exceptions = exceptions; + } else if ("exclusions".equals(fieldName)) { + List exclusions + = reader.readArray(reader1 -> OwaspCrsExclusionEntry.fromJson(reader1)); + deserializedManagedRulesDefinition.exclusions = exclusions; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedRulesDefinition; + }); + } +} 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..1a85cc5421dc2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentity.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Identity for the resource. + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The principal id of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private String principalId; + + /* + * The tenant id of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + 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. + */ + 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}'. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * 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(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ResourceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> ManagedServiceIdentityUserAssignedIdentities.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} 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..7544c6f981379 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagedServiceIdentityUserAssignedIdentities.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ManagedServiceIdentityUserAssignedIdentities model. + */ +@Immutable +public final class ManagedServiceIdentityUserAssignedIdentities + implements JsonSerializable { + /* + * The principal id of user assigned identity. + */ + private String principalId; + + /* + * The client id of user assigned identity. + */ + private String clientId; + + /** + * Creates an instance of ManagedServiceIdentityUserAssignedIdentities class. + */ + public ManagedServiceIdentityUserAssignedIdentities() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentityUserAssignedIdentities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentityUserAssignedIdentities if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedServiceIdentityUserAssignedIdentities. + */ + public static ManagedServiceIdentityUserAssignedIdentities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentityUserAssignedIdentities deserializedManagedServiceIdentityUserAssignedIdentities + = new ManagedServiceIdentityUserAssignedIdentities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentityUserAssignedIdentities.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedManagedServiceIdentityUserAssignedIdentities.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentityUserAssignedIdentities; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagementGroupNetworkManagerConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagementGroupNetworkManagerConnections.java new file mode 100644 index 0000000000000..378b015b842fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ManagementGroupNetworkManagerConnections.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; + +/** + * Resource collection API of ManagementGroupNetworkManagerConnections. + */ +public interface ManagementGroupNetworkManagerConnections { + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource along with {@link Response}. + */ + Response createOrUpdateWithResponse(String managementGroupId, + String networkManagerConnectionName, NetworkManagerConnectionInner parameters, Context context); + + /** + * Create a network manager connection on this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager connection. + * @param parameters Network manager connection to be created/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 the Network Manager Connection resource. + */ + NetworkManagerConnection createOrUpdate(String managementGroupId, String networkManagerConnectionName, + NetworkManagerConnectionInner parameters); + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group along with {@link Response}. + */ + Response getWithResponse(String managementGroupId, String networkManagerConnectionName, + Context context); + + /** + * Get a specified connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this management group. + */ + NetworkManagerConnection get(String managementGroupId, String networkManagerConnectionName); + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String managementGroupId, String networkManagerConnectionName, + Context context); + + /** + * Delete specified pending connection created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param networkManagerConnectionName Name for the network manager 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 managementGroupId, String networkManagerConnectionName); + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management 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 network manager connections as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String managementGroupId); + + /** + * List all network manager connections created by this management group. + * + * @param managementGroupId The management group Id which uniquely identify the Microsoft Azure management group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 network manager connections as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String managementGroupId, Integer top, String skipToken, + Context context); +} 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..066380d2192a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchCondition.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Define match conditions. + */ +@Fluent +public final class MatchCondition implements JsonSerializable { + /* + * List of match variables. + */ + private List matchVariables; + + /* + * The operator to be matched. + */ + private WebApplicationFirewallOperator operator; + + /* + * Whether this is negate condition or not. + */ + private Boolean negationConditon; + + /* + * Match value. + */ + private List matchValues; + + /* + * List of transforms. + */ + private List transforms; + + /** + * Creates an instance of MatchCondition class. + */ + public MatchCondition() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property matchVariables in model MatchCondition")); + } else { + matchVariables().forEach(e -> e.validate()); + } + if (operator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operator in model MatchCondition")); + } + if (matchValues() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property matchValues in model MatchCondition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MatchCondition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("matchVariables", this.matchVariables, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); + jsonWriter.writeArrayField("matchValues", this.matchValues, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("negationConditon", this.negationConditon); + jsonWriter.writeArrayField("transforms", this.transforms, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MatchCondition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MatchCondition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MatchCondition. + */ + public static MatchCondition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MatchCondition deserializedMatchCondition = new MatchCondition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchVariables".equals(fieldName)) { + List matchVariables = reader.readArray(reader1 -> MatchVariable.fromJson(reader1)); + deserializedMatchCondition.matchVariables = matchVariables; + } else if ("operator".equals(fieldName)) { + deserializedMatchCondition.operator = WebApplicationFirewallOperator.fromString(reader.getString()); + } else if ("matchValues".equals(fieldName)) { + List matchValues = reader.readArray(reader1 -> reader1.getString()); + deserializedMatchCondition.matchValues = matchValues; + } else if ("negationConditon".equals(fieldName)) { + deserializedMatchCondition.negationConditon = reader.getNullable(JsonReader::getBoolean); + } else if ("transforms".equals(fieldName)) { + List transforms + = reader.readArray(reader1 -> WebApplicationFirewallTransform.fromString(reader1.getString())); + deserializedMatchCondition.transforms = transforms; + } else { + reader.skipChildren(); + } + } + + return deserializedMatchCondition; + }); + } +} 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..4a1c8287372b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchVariable.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Define match variables. + */ +@Fluent +public final class MatchVariable implements JsonSerializable { + /* + * Match Variable. + */ + private WebApplicationFirewallMatchVariable variableName; + + /* + * The selector of match variable. + */ + private String selector; + + /** + * Creates an instance of MatchVariable class. + */ + public MatchVariable() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException("Missing required property variableName in model MatchVariable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MatchVariable.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("variableName", this.variableName == null ? null : this.variableName.toString()); + jsonWriter.writeStringField("selector", this.selector); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MatchVariable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MatchVariable if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MatchVariable. + */ + public static MatchVariable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MatchVariable deserializedMatchVariable = new MatchVariable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("variableName".equals(fieldName)) { + deserializedMatchVariable.variableName + = WebApplicationFirewallMatchVariable.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedMatchVariable.selector = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMatchVariable; + }); + } +} 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..4b445f5ff072f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MatchedRule.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Matched rule. + */ +@Fluent +public final class MatchedRule implements JsonSerializable { + /* + * Name of the matched network security rule. + */ + private String ruleName; + + /* + * The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. + */ + private String action; + + /** + * Creates an instance of MatchedRule class. + */ + public MatchedRule() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleName", this.ruleName); + jsonWriter.writeStringField("action", this.action); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MatchedRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MatchedRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MatchedRule. + */ + public static MatchedRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MatchedRule deserializedMatchedRule = new MatchedRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleName".equals(fieldName)) { + deserializedMatchedRule.ruleName = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedMatchedRule.action = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMatchedRule; + }); + } +} 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..3b7fd541f1267 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MetricSpecification.java @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Description of metrics specification. + */ +@Fluent +public final class MetricSpecification implements JsonSerializable { + /* + * The name of the metric. + */ + private String name; + + /* + * The display name of the metric. + */ + private String displayName; + + /* + * The description of the metric. + */ + private String displayDescription; + + /* + * Units the metric to be displayed in. + */ + private String unit; + + /* + * The aggregation type. + */ + private String aggregationType; + + /* + * List of availability. + */ + private List availabilities; + + /* + * Whether regional MDM account enabled. + */ + private Boolean enableRegionalMdmAccount; + + /* + * Whether gaps would be filled with zeros. + */ + private Boolean fillGapWithZero; + + /* + * Pattern for the filter of the metric. + */ + private String metricFilterPattern; + + /* + * List of dimensions. + */ + private List dimensions; + + /* + * Whether the metric is internal. + */ + private Boolean isInternal; + + /* + * The source MDM account. + */ + private String sourceMdmAccount; + + /* + * The source MDM namespace. + */ + private String sourceMdmNamespace; + + /* + * The resource Id dimension name override. + */ + private String resourceIdDimensionNameOverride; + + /** + * Creates an instance of MetricSpecification class. + */ + public MetricSpecification() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeStringField("aggregationType", this.aggregationType); + jsonWriter.writeArrayField("availabilities", this.availabilities, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enableRegionalMdmAccount", this.enableRegionalMdmAccount); + jsonWriter.writeBooleanField("fillGapWithZero", this.fillGapWithZero); + jsonWriter.writeStringField("metricFilterPattern", this.metricFilterPattern); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isInternal", this.isInternal); + jsonWriter.writeStringField("sourceMdmAccount", this.sourceMdmAccount); + jsonWriter.writeStringField("sourceMdmNamespace", this.sourceMdmNamespace); + jsonWriter.writeStringField("resourceIdDimensionNameOverride", this.resourceIdDimensionNameOverride); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricSpecification. + */ + public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricSpecification deserializedMetricSpecification = new MetricSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricSpecification.displayName = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedMetricSpecification.displayDescription = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricSpecification.unit = reader.getString(); + } else if ("aggregationType".equals(fieldName)) { + deserializedMetricSpecification.aggregationType = reader.getString(); + } else if ("availabilities".equals(fieldName)) { + List availabilities = reader.readArray(reader1 -> Availability.fromJson(reader1)); + deserializedMetricSpecification.availabilities = availabilities; + } else if ("enableRegionalMdmAccount".equals(fieldName)) { + deserializedMetricSpecification.enableRegionalMdmAccount + = reader.getNullable(JsonReader::getBoolean); + } else if ("fillGapWithZero".equals(fieldName)) { + deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); + } else if ("metricFilterPattern".equals(fieldName)) { + deserializedMetricSpecification.metricFilterPattern = reader.getString(); + } else if ("dimensions".equals(fieldName)) { + List dimensions = reader.readArray(reader1 -> Dimension.fromJson(reader1)); + deserializedMetricSpecification.dimensions = dimensions; + } else if ("isInternal".equals(fieldName)) { + deserializedMetricSpecification.isInternal = reader.getNullable(JsonReader::getBoolean); + } else if ("sourceMdmAccount".equals(fieldName)) { + deserializedMetricSpecification.sourceMdmAccount = reader.getString(); + } else if ("sourceMdmNamespace".equals(fieldName)) { + deserializedMetricSpecification.sourceMdmNamespace = reader.getString(); + } else if ("resourceIdDimensionNameOverride".equals(fieldName)) { + deserializedMetricSpecification.resourceIdDimensionNameOverride = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricSpecification; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MigrateLoadBalancerToIpBasedRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MigrateLoadBalancerToIpBasedRequest.java new file mode 100644 index 0000000000000..74b839370665d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MigrateLoadBalancerToIpBasedRequest.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The request for a migrateToIpBased API. + */ +@Fluent +public final class MigrateLoadBalancerToIpBasedRequest + implements JsonSerializable { + /* + * A list of pool names that should be migrated from Nic based to IP based pool + */ + private List pools; + + /** + * Creates an instance of MigrateLoadBalancerToIpBasedRequest class. + */ + public MigrateLoadBalancerToIpBasedRequest() { + } + + /** + * Get the pools property: A list of pool names that should be migrated from Nic based to IP based pool. + * + * @return the pools value. + */ + public List pools() { + return this.pools; + } + + /** + * Set the pools property: A list of pool names that should be migrated from Nic based to IP based pool. + * + * @param pools the pools value to set. + * @return the MigrateLoadBalancerToIpBasedRequest object itself. + */ + public MigrateLoadBalancerToIpBasedRequest withPools(List pools) { + this.pools = pools; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("pools", this.pools, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MigrateLoadBalancerToIpBasedRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MigrateLoadBalancerToIpBasedRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MigrateLoadBalancerToIpBasedRequest. + */ + public static MigrateLoadBalancerToIpBasedRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MigrateLoadBalancerToIpBasedRequest deserializedMigrateLoadBalancerToIpBasedRequest + = new MigrateLoadBalancerToIpBasedRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pools".equals(fieldName)) { + List pools = reader.readArray(reader1 -> reader1.getString()); + deserializedMigrateLoadBalancerToIpBasedRequest.pools = pools; + } else { + reader.skipChildren(); + } + } + + return deserializedMigrateLoadBalancerToIpBasedRequest; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MigratedPools.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MigratedPools.java new file mode 100644 index 0000000000000..c285fc1ae038c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/MigratedPools.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.MigratedPoolsInner; +import java.util.List; + +/** + * An immutable client-side representation of MigratedPools. + */ +public interface MigratedPools { + /** + * Gets the migratedPools property: A list of pools migrated from Nic based to IP based pool. + * + * @return the migratedPools value. + */ + List migratedPools(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.MigratedPoolsInner object. + * + * @return the inner object. + */ + MigratedPoolsInner innerModel(); +} 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..e1fe2c94d20a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateway.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..7da8e36494457 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewayListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NatGatewayInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListNatGateways API service call. + */ +@Fluent +public final class NatGatewayListResult implements JsonSerializable { + /* + * A list of Nat Gateways that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NatGatewayListResult class. + */ + public NatGatewayListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NatGatewayListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NatGatewayListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NatGatewayListResult. + */ + public static NatGatewayListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NatGatewayListResult deserializedNatGatewayListResult = new NatGatewayListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> NatGatewayInner.fromJson(reader1)); + deserializedNatGatewayListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNatGatewayListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNatGatewayListResult; + }); + } +} 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..a835ba882f382 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySku.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU of nat gateway. + */ +@Fluent +public final class NatGatewaySku implements JsonSerializable { + /* + * Name of Nat Gateway SKU. + */ + private NatGatewaySkuName name; + + /** + * Creates an instance of NatGatewaySku class. + */ + public NatGatewaySku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NatGatewaySku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NatGatewaySku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NatGatewaySku. + */ + public static NatGatewaySku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NatGatewaySku deserializedNatGatewaySku = new NatGatewaySku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNatGatewaySku.name = NatGatewaySkuName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNatGatewaySku; + }); + } +} 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..c8069303078f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGatewaySkuName.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 java.util.Collection; + +/** + * Name of Nat Gateway SKU. + */ +public final class NatGatewaySkuName extends ExpandableStringEnum { + /** + * Static value Standard for NatGatewaySkuName. + */ + public static final NatGatewaySkuName STANDARD = fromString("Standard"); + + /** + * Creates a new instance of NatGatewaySkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NatGatewaySkuName() { + } + + /** + * Creates or finds a NatGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding NatGatewaySkuName. + */ + public static NatGatewaySkuName fromString(String name) { + return fromString(name, NatGatewaySkuName.class); + } + + /** + * Gets known NatGatewaySkuName values. + * + * @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..f801f7fdbdeaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatGateways.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String natGatewayName, String expand, + 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..4b17e039e5bee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRule.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Rule of type nat. + */ +@Fluent +public final class NatRule extends FirewallPolicyRule { + /* + * Rule Type. + */ + private FirewallPolicyRuleType ruleType = FirewallPolicyRuleType.NAT_RULE; + + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + private List destinationAddresses; + + /* + * List of destination ports. + */ + private List destinationPorts; + + /* + * The translated address for this NAT rule. + */ + private String translatedAddress; + + /* + * The translated port for this NAT rule. + */ + private String translatedPort; + + /* + * List of source IpGroups for this rule. + */ + private List sourceIpGroups; + + /* + * The translated FQDN for this NAT rule. + */ + private String translatedFqdn; + + /** + * Creates an instance of NatRule class. + */ + public NatRule() { + } + + /** + * Get the ruleType property: Rule Type. + * + * @return the ruleType value. + */ + @Override + public FirewallPolicyRuleType ruleType() { + return this.ruleType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeArrayField("ipProtocols", this.ipProtocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationAddresses", this.destinationAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("translatedAddress", this.translatedAddress); + jsonWriter.writeStringField("translatedPort", this.translatedPort); + jsonWriter.writeArrayField("sourceIpGroups", this.sourceIpGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("translatedFqdn", this.translatedFqdn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NatRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NatRule if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the NatRule. + */ + public static NatRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NatRule deserializedNatRule = new NatRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNatRule.withName(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedNatRule.withDescription(reader.getString()); + } else if ("ruleType".equals(fieldName)) { + deserializedNatRule.ruleType = FirewallPolicyRuleType.fromString(reader.getString()); + } else if ("ipProtocols".equals(fieldName)) { + List ipProtocols = reader + .readArray(reader1 -> FirewallPolicyRuleNetworkProtocol.fromString(reader1.getString())); + deserializedNatRule.ipProtocols = ipProtocols; + } else if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedNatRule.sourceAddresses = sourceAddresses; + } else if ("destinationAddresses".equals(fieldName)) { + List destinationAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedNatRule.destinationAddresses = destinationAddresses; + } else if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> reader1.getString()); + deserializedNatRule.destinationPorts = destinationPorts; + } else if ("translatedAddress".equals(fieldName)) { + deserializedNatRule.translatedAddress = reader.getString(); + } else if ("translatedPort".equals(fieldName)) { + deserializedNatRule.translatedPort = reader.getString(); + } else if ("sourceIpGroups".equals(fieldName)) { + List sourceIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedNatRule.sourceIpGroups = sourceIpGroups; + } else if ("translatedFqdn".equals(fieldName)) { + deserializedNatRule.translatedFqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNatRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRulePortMapping.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRulePortMapping.java new file mode 100644 index 0000000000000..71d47ba4b177e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRulePortMapping.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Individual port mappings for inbound NAT rule created for backend pool. + */ +@Fluent +public final class NatRulePortMapping implements JsonSerializable { + /* + * Name of inbound NAT rule. + */ + private String inboundNatRuleName; + + /* + * Frontend port. + */ + private Integer frontendPort; + + /* + * Backend port. + */ + private Integer backendPort; + + /** + * Creates an instance of NatRulePortMapping class. + */ + public NatRulePortMapping() { + } + + /** + * Get the inboundNatRuleName property: Name of inbound NAT rule. + * + * @return the inboundNatRuleName value. + */ + public String inboundNatRuleName() { + return this.inboundNatRuleName; + } + + /** + * Set the inboundNatRuleName property: Name of inbound NAT rule. + * + * @param inboundNatRuleName the inboundNatRuleName value to set. + * @return the NatRulePortMapping object itself. + */ + public NatRulePortMapping withInboundNatRuleName(String inboundNatRuleName) { + this.inboundNatRuleName = inboundNatRuleName; + return this; + } + + /** + * Get the frontendPort property: Frontend port. + * + * @return the frontendPort value. + */ + public Integer frontendPort() { + return this.frontendPort; + } + + /** + * Set the frontendPort property: Frontend port. + * + * @param frontendPort the frontendPort value to set. + * @return the NatRulePortMapping object itself. + */ + public NatRulePortMapping withFrontendPort(Integer frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the backendPort property: Backend port. + * + * @return the backendPort value. + */ + public Integer backendPort() { + return this.backendPort; + } + + /** + * Set the backendPort property: Backend port. + * + * @param backendPort the backendPort value to set. + * @return the NatRulePortMapping object itself. + */ + public NatRulePortMapping withBackendPort(Integer backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("inboundNatRuleName", this.inboundNatRuleName); + jsonWriter.writeNumberField("frontendPort", this.frontendPort); + jsonWriter.writeNumberField("backendPort", this.backendPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NatRulePortMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NatRulePortMapping if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NatRulePortMapping. + */ + public static NatRulePortMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NatRulePortMapping deserializedNatRulePortMapping = new NatRulePortMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("inboundNatRuleName".equals(fieldName)) { + deserializedNatRulePortMapping.inboundNatRuleName = reader.getString(); + } else if ("frontendPort".equals(fieldName)) { + deserializedNatRulePortMapping.frontendPort = reader.getNullable(JsonReader::getInt); + } else if ("backendPort".equals(fieldName)) { + deserializedNatRulePortMapping.backendPort = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNatRulePortMapping; + }); + } +} 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..5ddf3d3bb4533 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NatRules.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String gatewayName, String natRuleName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..0a9349d1f502a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticParameters.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters to get network configuration diagnostic. + */ +@Fluent +public final class NetworkConfigurationDiagnosticParameters + implements JsonSerializable { + /* + * The ID of the target resource to perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + */ + private String targetResourceId; + + /* + * Verbosity level. + */ + private VerbosityLevel verbosityLevel; + + /* + * List of network configuration diagnostic profiles. + */ + private List profiles; + + /** + * Creates an instance of NetworkConfigurationDiagnosticParameters class. + */ + public NetworkConfigurationDiagnosticParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model NetworkConfigurationDiagnosticParameters")); + } + if (profiles() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property profiles in model NetworkConfigurationDiagnosticParameters")); + } else { + profiles().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkConfigurationDiagnosticParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeArrayField("profiles", this.profiles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("verbosityLevel", + this.verbosityLevel == null ? null : this.verbosityLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkConfigurationDiagnosticParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkConfigurationDiagnosticParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkConfigurationDiagnosticParameters. + */ + public static NetworkConfigurationDiagnosticParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkConfigurationDiagnosticParameters deserializedNetworkConfigurationDiagnosticParameters + = new NetworkConfigurationDiagnosticParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticParameters.targetResourceId = reader.getString(); + } else if ("profiles".equals(fieldName)) { + List profiles + = reader.readArray(reader1 -> NetworkConfigurationDiagnosticProfile.fromJson(reader1)); + deserializedNetworkConfigurationDiagnosticParameters.profiles = profiles; + } else if ("verbosityLevel".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticParameters.verbosityLevel + = VerbosityLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkConfigurationDiagnosticParameters; + }); + } +} 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..a451c3b656195 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticProfile.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to compare with network configuration. + */ +@Fluent +public final class NetworkConfigurationDiagnosticProfile + implements JsonSerializable { + /* + * The direction of the traffic. + */ + private Direction direction; + + /* + * Protocol to be verified on. Accepted values are '*', TCP, UDP. + */ + private String protocol; + + /* + * Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. + */ + private String source; + + /* + * Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. + */ + private String destination; + + /* + * Traffic destination port. Accepted values are '*' and a single port in the range (0 - 65535). + */ + private String destinationPort; + + /** + * Creates an instance of NetworkConfigurationDiagnosticProfile class. + */ + public NetworkConfigurationDiagnosticProfile() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property direction in model NetworkConfigurationDiagnosticProfile")); + } + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocol in model NetworkConfigurationDiagnosticProfile")); + } + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model NetworkConfigurationDiagnosticProfile")); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model NetworkConfigurationDiagnosticProfile")); + } + if (destinationPort() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationPort in model NetworkConfigurationDiagnosticProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkConfigurationDiagnosticProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("source", this.source); + jsonWriter.writeStringField("destination", this.destination); + jsonWriter.writeStringField("destinationPort", this.destinationPort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkConfigurationDiagnosticProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkConfigurationDiagnosticProfile if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkConfigurationDiagnosticProfile. + */ + public static NetworkConfigurationDiagnosticProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkConfigurationDiagnosticProfile deserializedNetworkConfigurationDiagnosticProfile + = new NetworkConfigurationDiagnosticProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticProfile.direction + = Direction.fromString(reader.getString()); + } else if ("protocol".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticProfile.protocol = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticProfile.source = reader.getString(); + } else if ("destination".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticProfile.destination = reader.getString(); + } else if ("destinationPort".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticProfile.destinationPort = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkConfigurationDiagnosticProfile; + }); + } +} 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..1a797cddf97fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResponse.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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..2dfb6b8fb26e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkConfigurationDiagnosticResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network configuration diagnostic result corresponded to provided traffic query. + */ +@Fluent +public final class NetworkConfigurationDiagnosticResult + implements JsonSerializable { + /* + * Network configuration diagnostic profile. + */ + private NetworkConfigurationDiagnosticProfile profile; + + /* + * Network security group result. + */ + private NetworkSecurityGroupResult networkSecurityGroupResult; + + /** + * Creates an instance of NetworkConfigurationDiagnosticResult class. + */ + public NetworkConfigurationDiagnosticResult() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("profile", this.profile); + jsonWriter.writeJsonField("networkSecurityGroupResult", this.networkSecurityGroupResult); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkConfigurationDiagnosticResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkConfigurationDiagnosticResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkConfigurationDiagnosticResult. + */ + public static NetworkConfigurationDiagnosticResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkConfigurationDiagnosticResult deserializedNetworkConfigurationDiagnosticResult + = new NetworkConfigurationDiagnosticResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profile".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticResult.profile + = NetworkConfigurationDiagnosticProfile.fromJson(reader); + } else if ("networkSecurityGroupResult".equals(fieldName)) { + deserializedNetworkConfigurationDiagnosticResult.networkSecurityGroupResult + = NetworkSecurityGroupResult.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkConfigurationDiagnosticResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroup.java new file mode 100644 index 0000000000000..44afcf30f94cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroup.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; + +/** + * An immutable client-side representation of NetworkGroup. + */ +public interface NetworkGroup { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the network group. + * + * @return the description value. + */ + String description(); + + /** + * Gets the memberType property: The type of the group member. + * + * @return the memberType value. + */ + GroupMemberType memberType(); + + /** + * Gets the provisioningState property: The provisioning state of the scope assignment resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner object. + * + * @return the inner object. + */ + NetworkGroupInner innerModel(); + + /** + * The entirety of the NetworkGroup definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The NetworkGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NetworkGroup definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the NetworkGroup definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @return the next definition stage. + */ + WithCreate withExistingNetworkManager(String resourceGroupName, String networkManagerName); + } + + /** + * The stage of the NetworkGroup 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.WithDescription, DefinitionStages.WithMemberType, DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkGroup create(Context context); + } + + /** + * The stage of the NetworkGroup definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the network group.. + * + * @param description A description of the network group. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the NetworkGroup definition allowing to specify memberType. + */ + interface WithMemberType { + /** + * Specifies the memberType property: The type of the group member.. + * + * @param memberType The type of the group member. + * @return the next definition stage. + */ + WithCreate withMemberType(GroupMemberType memberType); + } + + /** + * The stage of the NetworkGroup definition allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The ETag of the transformation. Omit this value to always overwrite the + * current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent + * changes.. + * + * @param ifMatch The ETag of the transformation. Omit this value to always overwrite the current resource. + * Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + + /** + * Begins update for the NetworkGroup resource. + * + * @return the stage of resource update. + */ + NetworkGroup.Update update(); + + /** + * The template for NetworkGroup update. + */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithMemberType, UpdateStages.WithIfMatch { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkGroup apply(Context context); + } + + /** + * The NetworkGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the NetworkGroup update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the network group.. + * + * @param description A description of the network group. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the NetworkGroup update allowing to specify memberType. + */ + interface WithMemberType { + /** + * Specifies the memberType property: The type of the group member.. + * + * @param memberType The type of the group member. + * @return the next definition stage. + */ + Update withMemberType(GroupMemberType memberType); + } + + /** + * The stage of the NetworkGroup update allowing to specify ifMatch. + */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: The ETag of the transformation. Omit this value to always overwrite the + * current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent + * changes.. + * + * @param ifMatch The ETag of the transformation. Omit this value to always overwrite the current resource. + * Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. + * @return the next definition stage. + */ + Update withIfMatch(String ifMatch); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupListResult.java new file mode 100644 index 0000000000000..8da49cafc9765 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list NetworkGroup. It contains a list of groups and a URL link to get the next set of + * results. + */ +@Fluent +public final class NetworkGroupListResult implements JsonSerializable { + /* + * Gets a page of NetworkGroup + */ + private List value; + + /* + * Gets the URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkGroupListResult class. + */ + public NetworkGroupListResult() { + } + + /** + * Get the value property: Gets a page of NetworkGroup. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of NetworkGroup. + * + * @param value the value value to set. + * @return the NetworkGroupListResult object itself. + */ + public NetworkGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkGroupListResult object itself. + */ + public NetworkGroupListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkGroupListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkGroupListResult. + */ + public static NetworkGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkGroupListResult deserializedNetworkGroupListResult = new NetworkGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> NetworkGroupInner.fromJson(reader1)); + deserializedNetworkGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkGroupListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroups.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroups.java new file mode 100644 index 0000000000000..6393ea20b4b03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroups.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 NetworkGroups. + */ +public interface NetworkGroups { + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 specified network group along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, String networkGroupName, + Context context); + + /** + * Gets the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 group. + */ + NetworkGroup get(String resourceGroupName, String networkManagerName, String networkGroupName); + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 networkManagerName, String networkGroupName); + + /** + * Deletes a network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String networkGroupName, Boolean force, + Context context); + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkGroup as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists the specified network group. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkGroup as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, String skipToken, + Context context); + + /** + * Gets the specified network 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 group along with {@link Response}. + */ + NetworkGroup getById(String id); + + /** + * Gets the specified network 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 group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a network 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 a network group. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new NetworkGroup resource. + * + * @param name resource name. + * @return the first stage of the new NetworkGroup definition. + */ + NetworkGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateHeaders.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..5509544c06bbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateHeaders.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The NetworkGroupsCreateOrUpdateHeaders model. + */ +@Fluent +public final class NetworkGroupsCreateOrUpdateHeaders { + /* + * The Etag property. + */ + private String etag; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of NetworkGroupsCreateOrUpdateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public NetworkGroupsCreateOrUpdateHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + + /** + * Get the etag property: The Etag property. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The Etag property. + * + * @param etag the etag value to set. + * @return the NetworkGroupsCreateOrUpdateHeaders object itself. + */ + public NetworkGroupsCreateOrUpdateHeaders withEtag(String etag) { + this.etag = etag; + 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/NetworkGroupsCreateOrUpdateResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..fa486766b40fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkGroupsCreateOrUpdateResponse.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.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkGroupInner; + +/** + * Contains all response data for the createOrUpdate operation. + */ +public final class NetworkGroupsCreateOrUpdateResponse + extends ResponseBase { + /** + * Creates an instance of NetworkGroupsCreateOrUpdateResponse. + * + * @param request the request which resulted in this NetworkGroupsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public NetworkGroupsCreateOrUpdateResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + NetworkGroupInner value, NetworkGroupsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public NetworkGroupInner getValue() { + return super.getValue(); + } +} 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..7fe7b62bc5bdc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicy.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Network Intent Policy resource. + */ +@Fluent +public final class NetworkIntentPolicy extends Resource { + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of NetworkIntentPolicy class. + */ + public NetworkIntentPolicy() { + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkIntentPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkIntentPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkIntentPolicy. + */ + public static NetworkIntentPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkIntentPolicy deserializedNetworkIntentPolicy = new NetworkIntentPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkIntentPolicy.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkIntentPolicy.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkIntentPolicy.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNetworkIntentPolicy.withTags(tags); + } else if ("etag".equals(fieldName)) { + deserializedNetworkIntentPolicy.etag = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedNetworkIntentPolicy.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkIntentPolicy; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyBasedService.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyBasedService.java new file mode 100644 index 0000000000000..4eee0cb6b4e4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyBasedService.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network intent policy based services. + */ +public final class NetworkIntentPolicyBasedService extends ExpandableStringEnum { + /** + * Static value None for NetworkIntentPolicyBasedService. + */ + public static final NetworkIntentPolicyBasedService NONE = fromString("None"); + + /** + * Static value All for NetworkIntentPolicyBasedService. + */ + public static final NetworkIntentPolicyBasedService ALL = fromString("All"); + + /** + * Static value AllowRulesOnly for NetworkIntentPolicyBasedService. + */ + public static final NetworkIntentPolicyBasedService ALLOW_RULES_ONLY = fromString("AllowRulesOnly"); + + /** + * Creates a new instance of NetworkIntentPolicyBasedService value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkIntentPolicyBasedService() { + } + + /** + * Creates or finds a NetworkIntentPolicyBasedService from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkIntentPolicyBasedService. + */ + public static NetworkIntentPolicyBasedService fromString(String name) { + return fromString(name, NetworkIntentPolicyBasedService.class); + } + + /** + * Gets known NetworkIntentPolicyBasedService values. + * + * @return known NetworkIntentPolicyBasedService values. + */ + public static Collection values() { + return values(NetworkIntentPolicyBasedService.class); + } +} 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..6bb3072577354 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkIntentPolicyConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. + */ +@Fluent +public final class NetworkIntentPolicyConfiguration implements JsonSerializable { + /* + * The name of the Network Intent Policy for storing in target subscription. + */ + private String networkIntentPolicyName; + + /* + * Source network intent policy. + */ + private NetworkIntentPolicy sourceNetworkIntentPolicy; + + /** + * Creates an instance of NetworkIntentPolicyConfiguration class. + */ + public NetworkIntentPolicyConfiguration() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkIntentPolicyName", this.networkIntentPolicyName); + jsonWriter.writeJsonField("sourceNetworkIntentPolicy", this.sourceNetworkIntentPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkIntentPolicyConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkIntentPolicyConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkIntentPolicyConfiguration. + */ + public static NetworkIntentPolicyConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkIntentPolicyConfiguration deserializedNetworkIntentPolicyConfiguration + = new NetworkIntentPolicyConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkIntentPolicyName".equals(fieldName)) { + deserializedNetworkIntentPolicyConfiguration.networkIntentPolicyName = reader.getString(); + } else if ("sourceNetworkIntentPolicy".equals(fieldName)) { + deserializedNetworkIntentPolicyConfiguration.sourceNetworkIntentPolicy + = NetworkIntentPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkIntentPolicyConfiguration; + }); + } +} 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..93b2c8eac114e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterface.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 vnetEncryptionSupported property: Whether the virtual machine this nic is attached to supports + * encryption. + * + * @return the vnetEncryptionSupported value. + */ + Boolean vnetEncryptionSupported(); + + /** + * Gets the enableAcceleratedNetworking property: If the network interface is configured for accelerated networking. + * Not applicable to VM sizes which require accelerated networking. + * + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * Gets the disableTcpStateTracking property: Indicates whether to disable tcp state tracking. + * + * @return the disableTcpStateTracking value. + */ + Boolean disableTcpStateTracking(); + + /** + * 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 auxiliaryMode property: Auxiliary mode of Network Interface resource. + * + * @return the auxiliaryMode value. + */ + NetworkInterfaceAuxiliaryMode auxiliaryMode(); + + /** + * Gets the auxiliarySku property: Auxiliary sku of Network Interface resource. + * + * @return the auxiliarySku value. + */ + NetworkInterfaceAuxiliarySku auxiliarySku(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithDisableTcpStateTracking, DefinitionStages.WithEnableIpForwarding, + DefinitionStages.WithWorkloadType, DefinitionStages.WithNicType, DefinitionStages.WithPrivateLinkService, + DefinitionStages.WithMigrationPhase, DefinitionStages.WithAuxiliaryMode, DefinitionStages.WithAuxiliarySku { + /** + * 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 configured for + * accelerated networking. Not applicable to VM sizes which require accelerated networking.. + * + * @param enableAcceleratedNetworking If the network interface is configured for accelerated networking. Not + * applicable to VM sizes which require accelerated networking. + * @return the next definition stage. + */ + WithCreate withEnableAcceleratedNetworking(Boolean enableAcceleratedNetworking); + } + + /** + * The stage of the NetworkInterface definition allowing to specify disableTcpStateTracking. + */ + interface WithDisableTcpStateTracking { + /** + * Specifies the disableTcpStateTracking property: Indicates whether to disable tcp state tracking.. + * + * @param disableTcpStateTracking Indicates whether to disable tcp state tracking. + * @return the next definition stage. + */ + WithCreate withDisableTcpStateTracking(Boolean disableTcpStateTracking); + } + + /** + * 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); + } + + /** + * The stage of the NetworkInterface definition allowing to specify auxiliaryMode. + */ + interface WithAuxiliaryMode { + /** + * Specifies the auxiliaryMode property: Auxiliary mode of Network Interface resource.. + * + * @param auxiliaryMode Auxiliary mode of Network Interface resource. + * @return the next definition stage. + */ + WithCreate withAuxiliaryMode(NetworkInterfaceAuxiliaryMode auxiliaryMode); + } + + /** + * The stage of the NetworkInterface definition allowing to specify auxiliarySku. + */ + interface WithAuxiliarySku { + /** + * Specifies the auxiliarySku property: Auxiliary sku of Network Interface resource.. + * + * @param auxiliarySku Auxiliary sku of Network Interface resource. + * @return the next definition stage. + */ + WithCreate withAuxiliarySku(NetworkInterfaceAuxiliarySku auxiliarySku); + } + } + + /** + * 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..e1833f4bf547e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAssociation.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Network interface and its custom security rules. + */ +@Fluent +public final class NetworkInterfaceAssociation implements JsonSerializable { + /* + * Network interface ID. + */ + private String id; + + /* + * Collection of custom security rules. + */ + private List securityRules; + + /** + * Creates an instance of NetworkInterfaceAssociation class. + */ + public NetworkInterfaceAssociation() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("securityRules", this.securityRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceAssociation if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceAssociation. + */ + public static NetworkInterfaceAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceAssociation deserializedNetworkInterfaceAssociation = new NetworkInterfaceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkInterfaceAssociation.id = reader.getString(); + } else if ("securityRules".equals(fieldName)) { + List securityRules + = reader.readArray(reader1 -> SecurityRuleInner.fromJson(reader1)); + deserializedNetworkInterfaceAssociation.securityRules = securityRules; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceAssociation; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliaryMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliaryMode.java new file mode 100644 index 0000000000000..41a35c6a48c18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliaryMode.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 java.util.Collection; + +/** + * Auxiliary mode of Network Interface resource. + */ +public final class NetworkInterfaceAuxiliaryMode extends ExpandableStringEnum { + /** + * Static value None for NetworkInterfaceAuxiliaryMode. + */ + public static final NetworkInterfaceAuxiliaryMode NONE = fromString("None"); + + /** + * Static value MaxConnections for NetworkInterfaceAuxiliaryMode. + */ + public static final NetworkInterfaceAuxiliaryMode MAX_CONNECTIONS = fromString("MaxConnections"); + + /** + * Static value Floating for NetworkInterfaceAuxiliaryMode. + */ + public static final NetworkInterfaceAuxiliaryMode FLOATING = fromString("Floating"); + + /** + * Static value AcceleratedConnections for NetworkInterfaceAuxiliaryMode. + */ + public static final NetworkInterfaceAuxiliaryMode ACCELERATED_CONNECTIONS = fromString("AcceleratedConnections"); + + /** + * Creates a new instance of NetworkInterfaceAuxiliaryMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceAuxiliaryMode() { + } + + /** + * Creates or finds a NetworkInterfaceAuxiliaryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceAuxiliaryMode. + */ + public static NetworkInterfaceAuxiliaryMode fromString(String name) { + return fromString(name, NetworkInterfaceAuxiliaryMode.class); + } + + /** + * Gets known NetworkInterfaceAuxiliaryMode values. + * + * @return known NetworkInterfaceAuxiliaryMode values. + */ + public static Collection values() { + return values(NetworkInterfaceAuxiliaryMode.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliarySku.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliarySku.java new file mode 100644 index 0000000000000..3832983cfcfd1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceAuxiliarySku.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Auxiliary sku of Network Interface resource. + */ +public final class NetworkInterfaceAuxiliarySku extends ExpandableStringEnum { + /** + * Static value None for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku NONE = fromString("None"); + + /** + * Static value A1 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A1 = fromString("A1"); + + /** + * Static value A2 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A2 = fromString("A2"); + + /** + * Static value A4 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A4 = fromString("A4"); + + /** + * Static value A8 for NetworkInterfaceAuxiliarySku. + */ + public static final NetworkInterfaceAuxiliarySku A8 = fromString("A8"); + + /** + * Creates a new instance of NetworkInterfaceAuxiliarySku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceAuxiliarySku() { + } + + /** + * Creates or finds a NetworkInterfaceAuxiliarySku from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceAuxiliarySku. + */ + public static NetworkInterfaceAuxiliarySku fromString(String name) { + return fromString(name, NetworkInterfaceAuxiliarySku.class); + } + + /** + * Gets known NetworkInterfaceAuxiliarySku values. + * + * @return known NetworkInterfaceAuxiliarySku values. + */ + public static Collection values() { + return values(NetworkInterfaceAuxiliarySku.class); + } +} 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..769a09e8fc2de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceDnsSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * DNS settings of a network interface. + */ +@Fluent +public final class NetworkInterfaceDnsSettings implements JsonSerializable { + /* + * 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. + */ + 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. + */ + private List appliedDnsServers; + + /* + * Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. + */ + private String internalDnsNameLabel; + + /* + * Fully qualified DNS name supporting internal communications between VMs in the same virtual network. + */ + 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. + */ + private String internalDomainNameSuffix; + + /** + * Creates an instance of NetworkInterfaceDnsSettings class. + */ + public NetworkInterfaceDnsSettings() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("dnsServers", this.dnsServers, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("internalDnsNameLabel", this.internalDnsNameLabel); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceDnsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceDnsSettings if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceDnsSettings. + */ + public static NetworkInterfaceDnsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceDnsSettings deserializedNetworkInterfaceDnsSettings = new NetworkInterfaceDnsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dnsServers".equals(fieldName)) { + List dnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkInterfaceDnsSettings.dnsServers = dnsServers; + } else if ("appliedDnsServers".equals(fieldName)) { + List appliedDnsServers = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkInterfaceDnsSettings.appliedDnsServers = appliedDnsServers; + } else if ("internalDnsNameLabel".equals(fieldName)) { + deserializedNetworkInterfaceDnsSettings.internalDnsNameLabel = reader.getString(); + } else if ("internalFqdn".equals(fieldName)) { + deserializedNetworkInterfaceDnsSettings.internalFqdn = reader.getString(); + } else if ("internalDomainNameSuffix".equals(fieldName)) { + deserializedNetworkInterfaceDnsSettings.internalDomainNameSuffix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceDnsSettings; + }); + } +} 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..46d346731c949 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfiguration.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.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. It can be a single IP address or + * a CIDR block in the format <address>/<prefix-length>. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAddressPrefixLength property: The private IP address prefix length. If specified and the + * allocation method is dynamic, the service will allocate a CIDR block instead of a single IP address. + * + * @return the privateIpAddressPrefixLength value. + */ + Integer privateIpAddressPrefixLength(); + + /** + * 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..ca909d0fc32ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for list ip configurations API service call. + */ +@Fluent +public final class NetworkInterfaceIpConfigurationListResult + implements JsonSerializable { + /* + * A list of ip configurations. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkInterfaceIpConfigurationListResult class. + */ + public NetworkInterfaceIpConfigurationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceIpConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceIpConfigurationListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceIpConfigurationListResult. + */ + public static NetworkInterfaceIpConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceIpConfigurationListResult deserializedNetworkInterfaceIpConfigurationListResult + = new NetworkInterfaceIpConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkInterfaceIpConfigurationInner.fromJson(reader1)); + deserializedNetworkInterfaceIpConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceIpConfigurationListResult; + }); + } +} 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..24dc9be691bfb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * PrivateLinkConnection properties for the network interface. + */ +@Immutable +public final class NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties + implements JsonSerializable { + /* + * The group ID for current private link connection. + */ + private String groupId; + + /* + * The required member name for current private link connection. + */ + private String requiredMemberName; + + /* + * List of FQDNs for current private link connection. + */ + private List fqdns; + + /** + * Creates an instance of NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties class. + */ + public NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties if the JsonReader was + * pointing to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties. + */ + public static NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties deserializedNetworkInterfaceIpConfigurationPrivateLinkConnectionProperties + = new NetworkInterfaceIpConfigurationPrivateLinkConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.groupId + = reader.getString(); + } else if ("requiredMemberName".equals(fieldName)) { + deserializedNetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.requiredMemberName + = reader.getString(); + } else if ("fqdns".equals(fieldName)) { + List fqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkInterfaceIpConfigurationPrivateLinkConnectionProperties.fqdns = fqdns; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceIpConfigurationPrivateLinkConnectionProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..20aec5f2461a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurationPropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkInterfaceIpConfigurationPropertiesFormat. + */ +public interface NetworkInterfaceIpConfigurationPropertiesFormat { + /** + * 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. It can be a single IP address or + * a CIDR block in the format <address>/<prefix-length>. + * + * @return the privateIpAddress value. + */ + String privateIpAddress(); + + /** + * Gets the privateIpAddressPrefixLength property: The private IP address prefix length. If specified and the + * allocation method is dynamic, the service will allocate a CIDR block instead of a single IP address. + * + * @return the privateIpAddressPrefixLength value. + */ + Integer privateIpAddressPrefixLength(); + + /** + * 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.NetworkInterfaceIpConfigurationPropertiesFormatInner + * object. + * + * @return the inner object. + */ + NetworkInterfaceIpConfigurationPropertiesFormatInner innerModel(); +} 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..7324208d5c21d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceIpConfigurations.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkInterfaceName, + String ipConfigurationName, 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); +} 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..85861d686641a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListNetworkInterface API service call. + */ +@Fluent +public final class NetworkInterfaceListResult implements JsonSerializable { + /* + * A list of network interfaces in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkInterfaceListResult class. + */ + public NetworkInterfaceListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceListResult. + */ + public static NetworkInterfaceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceListResult deserializedNetworkInterfaceListResult = new NetworkInterfaceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkInterfaceInner.fromJson(reader1)); + deserializedNetworkInterfaceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkInterfaceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceListResult; + }); + } +} 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..5f08b28fe5afb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancerListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.LoadBalancerInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for list ip configurations API service call. + */ +@Fluent +public final class NetworkInterfaceLoadBalancerListResult + implements JsonSerializable { + /* + * A list of load balancers. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkInterfaceLoadBalancerListResult class. + */ + public NetworkInterfaceLoadBalancerListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceLoadBalancerListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceLoadBalancerListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceLoadBalancerListResult. + */ + public static NetworkInterfaceLoadBalancerListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceLoadBalancerListResult deserializedNetworkInterfaceLoadBalancerListResult + = new NetworkInterfaceLoadBalancerListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LoadBalancerInner.fromJson(reader1)); + deserializedNetworkInterfaceLoadBalancerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkInterfaceLoadBalancerListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceLoadBalancerListResult; + }); + } +} 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..ea436b2b954c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceLoadBalancers.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.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..0f2ba61f5ad9b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceMigrationPhase.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration phase of Network Interface resource. + */ +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 a new instance of NetworkInterfaceMigrationPhase value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceMigrationPhase() { + } + + /** + * Creates or finds a NetworkInterfaceMigrationPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceMigrationPhase. + */ + public static NetworkInterfaceMigrationPhase fromString(String name) { + return fromString(name, NetworkInterfaceMigrationPhase.class); + } + + /** + * Gets known NetworkInterfaceMigrationPhase values. + * + * @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..e500a63908dc6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceNicType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of Network Interface resource. + */ +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 a new instance of NetworkInterfaceNicType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkInterfaceNicType() { + } + + /** + * Creates or finds a NetworkInterfaceNicType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkInterfaceNicType. + */ + public static NetworkInterfaceNicType fromString(String name) { + return fromString(name, NetworkInterfaceNicType.class); + } + + /** + * Gets known NetworkInterfaceNicType values. + * + * @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/NetworkInterfacePropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfacePropertiesFormat.java new file mode 100644 index 0000000000000..290bbd1c00eee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfacePropertiesFormat.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.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfacePropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkInterfacePropertiesFormat. + */ +public interface NetworkInterfacePropertiesFormat { + /** + * 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 vnetEncryptionSupported property: Whether the virtual machine this nic is attached to supports + * encryption. + * + * @return the vnetEncryptionSupported value. + */ + Boolean vnetEncryptionSupported(); + + /** + * Gets the enableAcceleratedNetworking property: If the network interface is configured for accelerated networking. + * Not applicable to VM sizes which require accelerated networking. + * + * @return the enableAcceleratedNetworking value. + */ + Boolean enableAcceleratedNetworking(); + + /** + * Gets the disableTcpStateTracking property: Indicates whether to disable tcp state tracking. + * + * @return the disableTcpStateTracking value. + */ + Boolean disableTcpStateTracking(); + + /** + * 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 auxiliaryMode property: Auxiliary mode of Network Interface resource. + * + * @return the auxiliaryMode value. + */ + NetworkInterfaceAuxiliaryMode auxiliaryMode(); + + /** + * Gets the auxiliarySku property: Auxiliary sku of Network Interface resource. + * + * @return the auxiliarySku value. + */ + NetworkInterfaceAuxiliarySku auxiliarySku(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfacePropertiesFormatInner + * object. + * + * @return the inner object. + */ + NetworkInterfacePropertiesFormatInner innerModel(); +} 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..38d43cb2c3a52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfiguration.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.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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..91c51ee0a1201 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for list tap configurations API service call. + */ +@Fluent +public final class NetworkInterfaceTapConfigurationListResult + implements JsonSerializable { + /* + * A list of tap configurations. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkInterfaceTapConfigurationListResult class. + */ + public NetworkInterfaceTapConfigurationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkInterfaceTapConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkInterfaceTapConfigurationListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkInterfaceTapConfigurationListResult. + */ + public static NetworkInterfaceTapConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkInterfaceTapConfigurationListResult deserializedNetworkInterfaceTapConfigurationListResult + = new NetworkInterfaceTapConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkInterfaceTapConfigurationInner.fromJson(reader1)); + deserializedNetworkInterfaceTapConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkInterfaceTapConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkInterfaceTapConfigurationListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationPropertiesFormat.java new file mode 100644 index 0000000000000..cc9e7cb32b63c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurationPropertiesFormat.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.resourcemanager.network.generated.fluent.models.NetworkInterfaceTapConfigurationPropertiesFormatInner; + +/** + * An immutable client-side representation of NetworkInterfaceTapConfigurationPropertiesFormat. + */ +public interface NetworkInterfaceTapConfigurationPropertiesFormat { + /** + * 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.NetworkInterfaceTapConfigurationPropertiesFormatInner + * object. + * + * @return the inner object. + */ + NetworkInterfaceTapConfigurationPropertiesFormatInner innerModel(); +} 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..7b935e70822fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaceTapConfigurations.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..f2e38876fb2cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkInterfaces.java @@ -0,0 +1,466 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getCloudServiceNetworkInterfaceWithResponse(String resourceGroupName, + String cloudServiceName, String roleInstanceName, String networkInterfaceName, String expand, 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); + + /** + * 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String networkInterfaceName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated + * response with {@link PagedIterable}. + */ + 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 as paginated + * response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getVirtualMachineScaleSetNetworkInterfaceWithResponse(String resourceGroupName, + String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand, + 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 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 as paginated response + * with {@link PagedIterable}. + */ + 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 as paginated response + * with {@link PagedIterable}. + */ + 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. + * @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 along with + * {@link Response}. + */ + Response getVirtualMachineScaleSetIpConfigurationWithResponse( + String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, + String networkInterfaceName, String ipConfigurationName, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/NetworkManager.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManager.java new file mode 100644 index 0000000000000..849605e2469c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManager.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of NetworkManager. + */ +public interface NetworkManager { + /** + * 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 systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the description property: A description of the network manager. + * + * @return the description value. + */ + String description(); + + /** + * Gets the networkManagerScopes property: Scope of Network Manager. + * + * @return the networkManagerScopes value. + */ + NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes(); + + /** + * Gets the networkManagerScopeAccesses property: Scope Access. + * + * @return the networkManagerScopeAccesses value. + */ + List networkManagerScopeAccesses(); + + /** + * Gets the provisioningState property: The provisioning state of the network manager resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerInner object. + * + * @return the inner object. + */ + NetworkManagerInner innerModel(); + + /** + * The entirety of the NetworkManager definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The NetworkManager definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NetworkManager definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the NetworkManager 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 NetworkManager 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 NetworkManager 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.WithDescription, + DefinitionStages.WithNetworkManagerScopes, DefinitionStages.WithNetworkManagerScopeAccesses { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkManager create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkManager create(Context context); + } + + /** + * The stage of the NetworkManager 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 NetworkManager definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the network manager.. + * + * @param description A description of the network manager. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the NetworkManager definition allowing to specify networkManagerScopes. + */ + interface WithNetworkManagerScopes { + /** + * Specifies the networkManagerScopes property: Scope of Network Manager.. + * + * @param networkManagerScopes Scope of Network Manager. + * @return the next definition stage. + */ + WithCreate withNetworkManagerScopes(NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes); + } + + /** + * The stage of the NetworkManager definition allowing to specify networkManagerScopeAccesses. + */ + interface WithNetworkManagerScopeAccesses { + /** + * Specifies the networkManagerScopeAccesses property: Scope Access.. + * + * @param networkManagerScopeAccesses Scope Access. + * @return the next definition stage. + */ + WithCreate withNetworkManagerScopeAccesses(List networkManagerScopeAccesses); + } + } + + /** + * Begins update for the NetworkManager resource. + * + * @return the stage of resource update. + */ + NetworkManager.Update update(); + + /** + * The template for NetworkManager update. + */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkManager apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkManager apply(Context context); + } + + /** + * The NetworkManager update stages. + */ + interface UpdateStages { + /** + * The stage of the NetworkManager 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. + */ + NetworkManager refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkManager refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommit.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommit.java new file mode 100644 index 0000000000000..e0e093746fd55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommit.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.models; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkManagerCommit. + */ +public interface NetworkManagerCommit { + /** + * Gets the commitId property: Commit Id. + * + * @return the commitId value. + */ + String commitId(); + + /** + * Gets the targetLocations property: List of target locations. + * + * @return the targetLocations value. + */ + List targetLocations(); + + /** + * Gets the configurationIds property: List of configuration ids. + * + * @return the configurationIds value. + */ + List configurationIds(); + + /** + * Gets the commitType property: Commit Type. + * + * @return the commitType value. + */ + ConfigurationType commitType(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner object. + * + * @return the inner object. + */ + NetworkManagerCommitInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommits.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommits.java new file mode 100644 index 0000000000000..13cba681c4c2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerCommits.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.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner; + +/** + * Resource collection API of NetworkManagerCommits. + */ +public interface NetworkManagerCommits { + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Manager Commit. + */ + NetworkManagerCommit post(String resourceGroupName, String networkManagerName, + NetworkManagerCommitInner parameters); + + /** + * Post a Network Manager Commit. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network commit is. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Manager Commit. + */ + NetworkManagerCommit post(String resourceGroupName, String networkManagerName, NetworkManagerCommitInner parameters, + Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnection.java new file mode 100644 index 0000000000000..ce5a8779acb39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnection.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.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; + +/** + * An immutable client-side representation of NetworkManagerConnection. + */ +public interface NetworkManagerConnection { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the networkManagerId property: Network Manager Id. + * + * @return the networkManagerId value. + */ + String networkManagerId(); + + /** + * Gets the connectionState property: Connection state. + * + * @return the connectionState value. + */ + ScopeConnectionState connectionState(); + + /** + * Gets the description property: A description of the network manager connection. + * + * @return the description value. + */ + String description(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner object. + * + * @return the inner object. + */ + NetworkManagerConnectionInner innerModel(); + + /** + * The entirety of the NetworkManagerConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { + } + + /** + * The NetworkManagerConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NetworkManagerConnection definition. + */ + interface Blank extends WithCreate { + } + + /** + * The stage of the NetworkManagerConnection 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.WithNetworkManagerId, DefinitionStages.WithDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkManagerConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkManagerConnection create(Context context); + } + + /** + * The stage of the NetworkManagerConnection definition allowing to specify networkManagerId. + */ + interface WithNetworkManagerId { + /** + * Specifies the networkManagerId property: Network Manager Id.. + * + * @param networkManagerId Network Manager Id. + * @return the next definition stage. + */ + WithCreate withNetworkManagerId(String networkManagerId); + } + + /** + * The stage of the NetworkManagerConnection definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the network manager connection.. + * + * @param description A description of the network manager connection. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + } + + /** + * Begins update for the NetworkManagerConnection resource. + * + * @return the stage of resource update. + */ + NetworkManagerConnection.Update update(); + + /** + * The template for NetworkManagerConnection update. + */ + interface Update extends UpdateStages.WithNetworkManagerId, UpdateStages.WithDescription { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkManagerConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkManagerConnection apply(Context context); + } + + /** + * The NetworkManagerConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the NetworkManagerConnection update allowing to specify networkManagerId. + */ + interface WithNetworkManagerId { + /** + * Specifies the networkManagerId property: Network Manager Id.. + * + * @param networkManagerId Network Manager Id. + * @return the next definition stage. + */ + Update withNetworkManagerId(String networkManagerId); + } + + /** + * The stage of the NetworkManagerConnection update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the network manager connection.. + * + * @param description A description of the network manager connection. + * @return the next definition stage. + */ + Update withDescription(String description); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkManagerConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkManagerConnection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnectionListResult.java new file mode 100644 index 0000000000000..783a988b57530 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerConnectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of network manager connections. + */ +@Fluent +public final class NetworkManagerConnectionListResult implements JsonSerializable { + /* + * List of network manager connections. + */ + private List value; + + /* + * Gets the URL to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkManagerConnectionListResult class. + */ + public NetworkManagerConnectionListResult() { + } + + /** + * Get the value property: List of network manager connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of network manager connections. + * + * @param value the value value to set. + * @return the NetworkManagerConnectionListResult object itself. + */ + public NetworkManagerConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkManagerConnectionListResult object itself. + */ + public NetworkManagerConnectionListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerConnectionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerConnectionListResult. + */ + public static NetworkManagerConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerConnectionListResult deserializedNetworkManagerConnectionListResult + = new NetworkManagerConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkManagerConnectionInner.fromJson(reader1)); + deserializedNetworkManagerConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkManagerConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerConnectionListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatus.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatus.java new file mode 100644 index 0000000000000..c64abd3a12af4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatus.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Network Manager Deployment Status. + */ +@Fluent +public final class NetworkManagerDeploymentStatus implements JsonSerializable { + /* + * Commit Time. + */ + private OffsetDateTime commitTime; + + /* + * Region Name. + */ + private String region; + + /* + * Deployment Status. + */ + private DeploymentStatus deploymentStatus; + + /* + * List of configuration ids. + */ + private List configurationIds; + + /* + * Configuration Deployment Type. + */ + private ConfigurationType deploymentType; + + /* + * Error Message. + */ + private String errorMessage; + + /** + * Creates an instance of NetworkManagerDeploymentStatus class. + */ + public NetworkManagerDeploymentStatus() { + } + + /** + * Get the commitTime property: Commit Time. + * + * @return the commitTime value. + */ + public OffsetDateTime commitTime() { + return this.commitTime; + } + + /** + * Set the commitTime property: Commit Time. + * + * @param commitTime the commitTime value to set. + * @return the NetworkManagerDeploymentStatus object itself. + */ + public NetworkManagerDeploymentStatus withCommitTime(OffsetDateTime commitTime) { + this.commitTime = commitTime; + return this; + } + + /** + * Get the region property: Region Name. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region Name. + * + * @param region the region value to set. + * @return the NetworkManagerDeploymentStatus object itself. + */ + public NetworkManagerDeploymentStatus withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the deploymentStatus property: Deployment Status. + * + * @return the deploymentStatus value. + */ + public DeploymentStatus deploymentStatus() { + return this.deploymentStatus; + } + + /** + * Set the deploymentStatus property: Deployment Status. + * + * @param deploymentStatus the deploymentStatus value to set. + * @return the NetworkManagerDeploymentStatus object itself. + */ + public NetworkManagerDeploymentStatus withDeploymentStatus(DeploymentStatus deploymentStatus) { + this.deploymentStatus = deploymentStatus; + return this; + } + + /** + * Get the configurationIds property: List of configuration ids. + * + * @return the configurationIds value. + */ + public List configurationIds() { + return this.configurationIds; + } + + /** + * Set the configurationIds property: List of configuration ids. + * + * @param configurationIds the configurationIds value to set. + * @return the NetworkManagerDeploymentStatus object itself. + */ + public NetworkManagerDeploymentStatus withConfigurationIds(List configurationIds) { + this.configurationIds = configurationIds; + return this; + } + + /** + * Get the deploymentType property: Configuration Deployment Type. + * + * @return the deploymentType value. + */ + public ConfigurationType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: Configuration Deployment Type. + * + * @param deploymentType the deploymentType value to set. + * @return the NetworkManagerDeploymentStatus object itself. + */ + public NetworkManagerDeploymentStatus withDeploymentType(ConfigurationType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the errorMessage property: Error Message. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: Error Message. + * + * @param errorMessage the errorMessage value to set. + * @return the NetworkManagerDeploymentStatus object itself. + */ + public NetworkManagerDeploymentStatus withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("commitTime", + this.commitTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.commitTime)); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("deploymentStatus", + this.deploymentStatus == null ? null : this.deploymentStatus.toString()); + jsonWriter.writeArrayField("configurationIds", this.configurationIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeStringField("errorMessage", this.errorMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerDeploymentStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerDeploymentStatus if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerDeploymentStatus. + */ + public static NetworkManagerDeploymentStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerDeploymentStatus deserializedNetworkManagerDeploymentStatus + = new NetworkManagerDeploymentStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("commitTime".equals(fieldName)) { + deserializedNetworkManagerDeploymentStatus.commitTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("region".equals(fieldName)) { + deserializedNetworkManagerDeploymentStatus.region = reader.getString(); + } else if ("deploymentStatus".equals(fieldName)) { + deserializedNetworkManagerDeploymentStatus.deploymentStatus + = DeploymentStatus.fromString(reader.getString()); + } else if ("configurationIds".equals(fieldName)) { + List configurationIds = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkManagerDeploymentStatus.configurationIds = configurationIds; + } else if ("deploymentType".equals(fieldName)) { + deserializedNetworkManagerDeploymentStatus.deploymentType + = ConfigurationType.fromString(reader.getString()); + } else if ("errorMessage".equals(fieldName)) { + deserializedNetworkManagerDeploymentStatus.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerDeploymentStatus; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusListResult.java new file mode 100644 index 0000000000000..5a863c76f26f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusListResult.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.resourcemanager.network.generated.fluent.models.NetworkManagerDeploymentStatusListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkManagerDeploymentStatusListResult. + */ +public interface NetworkManagerDeploymentStatusListResult { + /** + * Gets the value property: Gets a page of Network Manager Deployment Status. + * + * @return the value value. + */ + List value(); + + /** + * Gets the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + String skipToken(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerDeploymentStatusListResultInner object. + * + * @return the inner object. + */ + NetworkManagerDeploymentStatusListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusOperations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusOperations.java new file mode 100644 index 0000000000000..380477e837f05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusOperations.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.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of NetworkManagerDeploymentStatusOperations. + */ +public interface NetworkManagerDeploymentStatusOperations { + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Network Manager Deployment Status along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, + String networkManagerName, NetworkManagerDeploymentStatusParameter parameters, Integer top, Context context); + + /** + * Post to List of Network Manager Deployment Status. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Parameters supplied to specify which Managed Network deployment status is. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Network Manager Deployment Status. + */ + NetworkManagerDeploymentStatusListResult list(String resourceGroupName, String networkManagerName, + NetworkManagerDeploymentStatusParameter parameters); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusParameter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusParameter.java new file mode 100644 index 0000000000000..c63b911a52284 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerDeploymentStatusParameter.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network Manager Deployment Status Parameter. + */ +@Fluent +public final class NetworkManagerDeploymentStatusParameter + implements JsonSerializable { + /* + * List of locations. + */ + private List regions; + + /* + * List of deployment types. + */ + private List deploymentTypes; + + /* + * Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. + */ + private String skipToken; + + /** + * Creates an instance of NetworkManagerDeploymentStatusParameter class. + */ + public NetworkManagerDeploymentStatusParameter() { + } + + /** + * Get the regions property: List of locations. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: List of locations. + * + * @param regions the regions value to set. + * @return the NetworkManagerDeploymentStatusParameter object itself. + */ + public NetworkManagerDeploymentStatusParameter withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the deploymentTypes property: List of deployment types. + * + * @return the deploymentTypes value. + */ + public List deploymentTypes() { + return this.deploymentTypes; + } + + /** + * Set the deploymentTypes property: List of deployment types. + * + * @param deploymentTypes the deploymentTypes value to set. + * @return the NetworkManagerDeploymentStatusParameter object itself. + */ + public NetworkManagerDeploymentStatusParameter withDeploymentTypes(List deploymentTypes) { + this.deploymentTypes = deploymentTypes; + return this; + } + + /** + * Get the skipToken property: Continuation token for pagination, capturing the next page size and offset, as well + * as the context of the query. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: Continuation token for pagination, capturing the next page size and offset, as well + * as the context of the query. + * + * @param skipToken the skipToken value to set. + * @return the NetworkManagerDeploymentStatusParameter object itself. + */ + public NetworkManagerDeploymentStatusParameter withSkipToken(String skipToken) { + this.skipToken = skipToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("deploymentTypes", this.deploymentTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerDeploymentStatusParameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerDeploymentStatusParameter if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerDeploymentStatusParameter. + */ + public static NetworkManagerDeploymentStatusParameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerDeploymentStatusParameter deserializedNetworkManagerDeploymentStatusParameter + = new NetworkManagerDeploymentStatusParameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("regions".equals(fieldName)) { + List regions = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkManagerDeploymentStatusParameter.regions = regions; + } else if ("deploymentTypes".equals(fieldName)) { + List deploymentTypes + = reader.readArray(reader1 -> ConfigurationType.fromString(reader1.getString())); + deserializedNetworkManagerDeploymentStatusParameter.deploymentTypes = deploymentTypes; + } else if ("skipToken".equals(fieldName)) { + deserializedNetworkManagerDeploymentStatusParameter.skipToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerDeploymentStatusParameter; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveConnectivityConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveConnectivityConfigurationListResult.java new file mode 100644 index 0000000000000..4de758a3053f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveConnectivityConfigurationListResult.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.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveConnectivityConfigurationListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkManagerEffectiveConnectivityConfigurationListResult. + */ +public interface NetworkManagerEffectiveConnectivityConfigurationListResult { + /** + * Gets the value property: Gets a page of NetworkManagerEffectiveConnectivityConfiguration. + * + * @return the value value. + */ + List value(); + + /** + * Gets the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + String skipToken(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveConnectivityConfigurationListResultInner + * object. + * + * @return the inner object. + */ + NetworkManagerEffectiveConnectivityConfigurationListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveSecurityAdminRulesListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveSecurityAdminRulesListResult.java new file mode 100644 index 0000000000000..531010bbff237 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerEffectiveSecurityAdminRulesListResult.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.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveSecurityAdminRulesListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkManagerEffectiveSecurityAdminRulesListResult. + */ +public interface NetworkManagerEffectiveSecurityAdminRulesListResult { + /** + * Gets the value property: Gets a page of NetworkManagerEffectiveSecurityAdminRules. + * + * @return the value value. + */ + List value(); + + /** + * Gets the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + String skipToken(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerEffectiveSecurityAdminRulesListResultInner + * object. + * + * @return the inner object. + */ + NetworkManagerEffectiveSecurityAdminRulesListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerListResult.java new file mode 100644 index 0000000000000..b8d92cad2e870 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list NetworkManager. It contains a list of network managers and a URL link to get the next + * set of results. + */ +@Fluent +public final class NetworkManagerListResult implements JsonSerializable { + /* + * Gets a page of NetworkManager + */ + private List value; + + /* + * Gets the URL to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkManagerListResult class. + */ + public NetworkManagerListResult() { + } + + /** + * Get the value property: Gets a page of NetworkManager. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of NetworkManager. + * + * @param value the value value to set. + * @return the NetworkManagerListResult object itself. + */ + public NetworkManagerListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkManagerListResult object itself. + */ + public NetworkManagerListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerListResult. + */ + public static NetworkManagerListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerListResult deserializedNetworkManagerListResult = new NetworkManagerListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkManagerInner.fromJson(reader1)); + deserializedNetworkManagerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkManagerListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerPropertiesNetworkManagerScopes.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerPropertiesNetworkManagerScopes.java new file mode 100644 index 0000000000000..49c2194f1de1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerPropertiesNetworkManagerScopes.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Scope of Network Manager. + */ +@Fluent +public final class NetworkManagerPropertiesNetworkManagerScopes + implements JsonSerializable { + /* + * List of management groups. + */ + private List managementGroups; + + /* + * List of subscriptions. + */ + private List subscriptions; + + /* + * List of cross tenant scopes. + */ + private List crossTenantScopes; + + /** + * Creates an instance of NetworkManagerPropertiesNetworkManagerScopes class. + */ + public NetworkManagerPropertiesNetworkManagerScopes() { + } + + /** + * Get the managementGroups property: List of management groups. + * + * @return the managementGroups value. + */ + public List managementGroups() { + return this.managementGroups; + } + + /** + * Set the managementGroups property: List of management groups. + * + * @param managementGroups the managementGroups value to set. + * @return the NetworkManagerPropertiesNetworkManagerScopes object itself. + */ + public NetworkManagerPropertiesNetworkManagerScopes withManagementGroups(List managementGroups) { + this.managementGroups = managementGroups; + return this; + } + + /** + * Get the subscriptions property: List of subscriptions. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: List of subscriptions. + * + * @param subscriptions the subscriptions value to set. + * @return the NetworkManagerPropertiesNetworkManagerScopes object itself. + */ + public NetworkManagerPropertiesNetworkManagerScopes withSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Get the crossTenantScopes property: List of cross tenant scopes. + * + * @return the crossTenantScopes value. + */ + public List crossTenantScopes() { + return this.crossTenantScopes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (crossTenantScopes() != null) { + crossTenantScopes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("managementGroups", this.managementGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerPropertiesNetworkManagerScopes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerPropertiesNetworkManagerScopes if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerPropertiesNetworkManagerScopes. + */ + public static NetworkManagerPropertiesNetworkManagerScopes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerPropertiesNetworkManagerScopes deserializedNetworkManagerPropertiesNetworkManagerScopes + = new NetworkManagerPropertiesNetworkManagerScopes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managementGroups".equals(fieldName)) { + List managementGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkManagerPropertiesNetworkManagerScopes.managementGroups = managementGroups; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkManagerPropertiesNetworkManagerScopes.subscriptions = subscriptions; + } else if ("crossTenantScopes".equals(fieldName)) { + List crossTenantScopes + = reader.readArray(reader1 -> CrossTenantScopes.fromJson(reader1)); + deserializedNetworkManagerPropertiesNetworkManagerScopes.crossTenantScopes = crossTenantScopes; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerPropertiesNetworkManagerScopes; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfiguration.java new file mode 100644 index 0000000000000..a195f1cfa4970 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfiguration.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerRoutingConfigurationInner; + +/** + * An immutable client-side representation of NetworkManagerRoutingConfiguration. + */ +public interface NetworkManagerRoutingConfiguration { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the routing configuration. + * + * @return the description value. + */ + String description(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerRoutingConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkManagerRoutingConfigurationInner innerModel(); + + /** + * The entirety of the NetworkManagerRoutingConfiguration definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The NetworkManagerRoutingConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NetworkManagerRoutingConfiguration definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the NetworkManagerRoutingConfiguration definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @return the next definition stage. + */ + WithCreate withExistingNetworkManager(String resourceGroupName, String networkManagerName); + } + + /** + * The stage of the NetworkManagerRoutingConfiguration 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.WithDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + NetworkManagerRoutingConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NetworkManagerRoutingConfiguration create(Context context); + } + + /** + * The stage of the NetworkManagerRoutingConfiguration definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the routing configuration.. + * + * @param description A description of the routing configuration. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + } + + /** + * Begins update for the NetworkManagerRoutingConfiguration resource. + * + * @return the stage of resource update. + */ + NetworkManagerRoutingConfiguration.Update update(); + + /** + * The template for NetworkManagerRoutingConfiguration update. + */ + interface Update extends UpdateStages.WithDescription { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NetworkManagerRoutingConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NetworkManagerRoutingConfiguration apply(Context context); + } + + /** + * The NetworkManagerRoutingConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the NetworkManagerRoutingConfiguration update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the routing configuration.. + * + * @param description A description of the routing configuration. + * @return the next definition stage. + */ + Update withDescription(String description); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NetworkManagerRoutingConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NetworkManagerRoutingConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurationListResult.java new file mode 100644 index 0000000000000..a6dda396ed873 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerRoutingConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of network manager routing configurations. + */ +@Fluent +public final class NetworkManagerRoutingConfigurationListResult + implements JsonSerializable { + /* + * Gets a page of routing configurations + */ + private List value; + + /* + * Gets the URL to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkManagerRoutingConfigurationListResult class. + */ + public NetworkManagerRoutingConfigurationListResult() { + } + + /** + * Get the value property: Gets a page of routing configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of routing configurations. + * + * @param value the value value to set. + * @return the NetworkManagerRoutingConfigurationListResult object itself. + */ + public NetworkManagerRoutingConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkManagerRoutingConfigurationListResult object itself. + */ + public NetworkManagerRoutingConfigurationListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerRoutingConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerRoutingConfigurationListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkManagerRoutingConfigurationListResult. + */ + public static NetworkManagerRoutingConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerRoutingConfigurationListResult deserializedNetworkManagerRoutingConfigurationListResult + = new NetworkManagerRoutingConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkManagerRoutingConfigurationInner.fromJson(reader1)); + deserializedNetworkManagerRoutingConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkManagerRoutingConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerRoutingConfigurationListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurations.java new file mode 100644 index 0000000000000..53e4240c6c1ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingConfigurations.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 NetworkManagerRoutingConfigurations. + */ +public interface NetworkManagerRoutingConfigurations { + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager routing configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager routing configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager routing configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, + Integer top, String skipToken, Context context); + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context); + + /** + * Retrieves a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 defines the routing configuration. + */ + NetworkManagerRoutingConfiguration get(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager routing configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, Boolean force, + Context context); + + /** + * Retrieves a network manager routing 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 defines the routing configuration along with {@link Response}. + */ + NetworkManagerRoutingConfiguration getById(String id); + + /** + * Retrieves a network manager routing 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 defines the routing configuration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a network manager routing 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 network manager routing configuration. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new NetworkManagerRoutingConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new NetworkManagerRoutingConfiguration definition. + */ + NetworkManagerRoutingConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingGroupItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingGroupItem.java new file mode 100644 index 0000000000000..12c47c0358d9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerRoutingGroupItem.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network manager routing group item. + */ +@Fluent +public final class NetworkManagerRoutingGroupItem implements JsonSerializable { + /* + * Network manager group Id. + */ + private String networkGroupId; + + /** + * Creates an instance of NetworkManagerRoutingGroupItem class. + */ + public NetworkManagerRoutingGroupItem() { + } + + /** + * Get the networkGroupId property: Network manager group Id. + * + * @return the networkGroupId value. + */ + public String networkGroupId() { + return this.networkGroupId; + } + + /** + * Set the networkGroupId property: Network manager group Id. + * + * @param networkGroupId the networkGroupId value to set. + * @return the NetworkManagerRoutingGroupItem object itself. + */ + public NetworkManagerRoutingGroupItem withNetworkGroupId(String networkGroupId) { + this.networkGroupId = networkGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkGroupId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkGroupId in model NetworkManagerRoutingGroupItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerRoutingGroupItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkGroupId", this.networkGroupId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerRoutingGroupItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerRoutingGroupItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkManagerRoutingGroupItem. + */ + public static NetworkManagerRoutingGroupItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerRoutingGroupItem deserializedNetworkManagerRoutingGroupItem + = new NetworkManagerRoutingGroupItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkGroupId".equals(fieldName)) { + deserializedNetworkManagerRoutingGroupItem.networkGroupId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerRoutingGroupItem; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerSecurityGroupItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerSecurityGroupItem.java new file mode 100644 index 0000000000000..b109c80d45f9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagerSecurityGroupItem.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network manager security group item. + */ +@Fluent +public final class NetworkManagerSecurityGroupItem implements JsonSerializable { + /* + * Network manager group Id. + */ + private String networkGroupId; + + /** + * Creates an instance of NetworkManagerSecurityGroupItem class. + */ + public NetworkManagerSecurityGroupItem() { + } + + /** + * Get the networkGroupId property: Network manager group Id. + * + * @return the networkGroupId value. + */ + public String networkGroupId() { + return this.networkGroupId; + } + + /** + * Set the networkGroupId property: Network manager group Id. + * + * @param networkGroupId the networkGroupId value to set. + * @return the NetworkManagerSecurityGroupItem object itself. + */ + public NetworkManagerSecurityGroupItem withNetworkGroupId(String networkGroupId) { + this.networkGroupId = networkGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkGroupId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkGroupId in model NetworkManagerSecurityGroupItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkManagerSecurityGroupItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkGroupId", this.networkGroupId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkManagerSecurityGroupItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkManagerSecurityGroupItem if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkManagerSecurityGroupItem. + */ + public static NetworkManagerSecurityGroupItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkManagerSecurityGroupItem deserializedNetworkManagerSecurityGroupItem + = new NetworkManagerSecurityGroupItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkGroupId".equals(fieldName)) { + deserializedNetworkManagerSecurityGroupItem.networkGroupId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkManagerSecurityGroupItem; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagers.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagers.java new file mode 100644 index 0000000000000..90170ee16ef07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkManagers.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.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 NetworkManagers. + */ +public interface NetworkManagers { + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Manager along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String networkManagerName, + Context context); + + /** + * Gets the specified Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 Manager. + */ + NetworkManager getByResourceGroup(String resourceGroupName, String networkManagerName); + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName); + + /** + * Deletes a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, Boolean force, Context context); + + /** + * List all network managers 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 NetworkManager as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all network managers in a subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkManager as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Integer top, String skipToken, Context context); + + /** + * List network managers 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 result of the request to list NetworkManager as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List network managers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 NetworkManager as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Integer top, String skipToken, + Context context); + + /** + * Gets the specified Network Manager. + * + * @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 Manager along with {@link Response}. + */ + NetworkManager getById(String id); + + /** + * Gets the specified Network Manager. + * + * @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 Manager along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a network manager. + * + * @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 network manager. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new NetworkManager resource. + * + * @param name resource name. + * @return the first stage of the new NetworkManager definition. + */ + NetworkManager.DefinitionStages.Blank define(String name); +} 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..5fc95105b25ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfile.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..106fd0c160502 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfileListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkProfileInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListNetworkProfiles API service call. + */ +@Fluent +public final class NetworkProfileListResult implements JsonSerializable { + /* + * A list of network profiles that exist in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkProfileListResult class. + */ + public NetworkProfileListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkProfileListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkProfileListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkProfileListResult. + */ + public static NetworkProfileListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkProfileListResult deserializedNetworkProfileListResult = new NetworkProfileListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkProfileInner.fromJson(reader1)); + deserializedNetworkProfileListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkProfileListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkProfileListResult; + }); + } +} 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..7fe1942b27c9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkProfiles.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String networkProfileName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..9f19164d7a457 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkRule.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Rule of type network. + */ +@Fluent +public final class NetworkRule extends FirewallPolicyRule { + /* + * Rule Type. + */ + private FirewallPolicyRuleType ruleType = FirewallPolicyRuleType.NETWORK_RULE; + + /* + * Array of FirewallPolicyRuleNetworkProtocols. + */ + private List ipProtocols; + + /* + * List of source IP addresses for this rule. + */ + private List sourceAddresses; + + /* + * List of destination IP addresses or Service Tags. + */ + private List destinationAddresses; + + /* + * List of destination ports. + */ + private List destinationPorts; + + /* + * List of source IpGroups for this rule. + */ + private List sourceIpGroups; + + /* + * List of destination IpGroups for this rule. + */ + private List destinationIpGroups; + + /* + * List of destination FQDNs. + */ + private List destinationFqdns; + + /** + * Creates an instance of NetworkRule class. + */ + public NetworkRule() { + } + + /** + * Get the ruleType property: Rule Type. + * + * @return the ruleType value. + */ + @Override + public FirewallPolicyRuleType ruleType() { + return this.ruleType; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeArrayField("ipProtocols", this.ipProtocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationAddresses", this.destinationAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("sourceIpGroups", this.sourceIpGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationIpGroups", this.destinationIpGroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationFqdns", this.destinationFqdns, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkRule. + */ + public static NetworkRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkRule deserializedNetworkRule = new NetworkRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkRule.withName(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedNetworkRule.withDescription(reader.getString()); + } else if ("ruleType".equals(fieldName)) { + deserializedNetworkRule.ruleType = FirewallPolicyRuleType.fromString(reader.getString()); + } else if ("ipProtocols".equals(fieldName)) { + List ipProtocols = reader + .readArray(reader1 -> FirewallPolicyRuleNetworkProtocol.fromString(reader1.getString())); + deserializedNetworkRule.ipProtocols = ipProtocols; + } else if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkRule.sourceAddresses = sourceAddresses; + } else if ("destinationAddresses".equals(fieldName)) { + List destinationAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkRule.destinationAddresses = destinationAddresses; + } else if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkRule.destinationPorts = destinationPorts; + } else if ("sourceIpGroups".equals(fieldName)) { + List sourceIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkRule.sourceIpGroups = sourceIpGroups; + } else if ("destinationIpGroups".equals(fieldName)) { + List destinationIpGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkRule.destinationIpGroups = destinationIpGroups; + } else if ("destinationFqdns".equals(fieldName)) { + List destinationFqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkRule.destinationFqdns = destinationFqdns; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkRule; + }); + } +} 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..0f9597d4d5086 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroup.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the flushConnection property: When enabled, flows created from Network Security Group connections will be + * re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + * + * @return the flushConnection value. + */ + Boolean flushConnection(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithFlushConnection, + 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 flushConnection. + */ + interface WithFlushConnection { + /** + * Specifies the flushConnection property: When enabled, flows created from Network Security Group + * connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation.. + * + * @param flushConnection When enabled, flows created from Network Security Group connections will be + * re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + * @return the next definition stage. + */ + WithCreate withFlushConnection(Boolean flushConnection); + } + + /** + * 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..674dc415be3e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkSecurityGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListNetworkSecurityGroups API service call. + */ +@Fluent +public final class NetworkSecurityGroupListResult implements JsonSerializable { + /* + * A list of NetworkSecurityGroup resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkSecurityGroupListResult class. + */ + public NetworkSecurityGroupListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityGroupListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityGroupListResult. + */ + public static NetworkSecurityGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityGroupListResult deserializedNetworkSecurityGroupListResult + = new NetworkSecurityGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkSecurityGroupInner.fromJson(reader1)); + deserializedNetworkSecurityGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkSecurityGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityGroupListResult; + }); + } +} 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..dbf70fba93743 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroupResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network configuration diagnostic result corresponded provided traffic query. + */ +@Fluent +public final class NetworkSecurityGroupResult implements JsonSerializable { + /* + * The network traffic is allowed or denied. + */ + private SecurityRuleAccess securityRuleAccessResult; + + /* + * List of results network security groups diagnostic. + */ + private List evaluatedNetworkSecurityGroups; + + /** + * Creates an instance of NetworkSecurityGroupResult class. + */ + public NetworkSecurityGroupResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("securityRuleAccessResult", + this.securityRuleAccessResult == null ? null : this.securityRuleAccessResult.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityGroupResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityGroupResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityGroupResult. + */ + public static NetworkSecurityGroupResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityGroupResult deserializedNetworkSecurityGroupResult = new NetworkSecurityGroupResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityRuleAccessResult".equals(fieldName)) { + deserializedNetworkSecurityGroupResult.securityRuleAccessResult + = SecurityRuleAccess.fromString(reader.getString()); + } else if ("evaluatedNetworkSecurityGroups".equals(fieldName)) { + List evaluatedNetworkSecurityGroups + = reader.readArray(reader1 -> EvaluatedNetworkSecurityGroup.fromJson(reader1)); + deserializedNetworkSecurityGroupResult.evaluatedNetworkSecurityGroups + = evaluatedNetworkSecurityGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityGroupResult; + }); + } +} 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..7f66a1b55f125 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityGroups.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String networkSecurityGroupName, String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..4e7b8d5d251a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkSecurityRulesEvaluationResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network security rules evaluation result. + */ +@Fluent +public final class NetworkSecurityRulesEvaluationResult + implements JsonSerializable { + /* + * Name of the network security rule. + */ + private String name; + + /* + * Value indicating whether protocol is matched. + */ + private Boolean protocolMatched; + + /* + * Value indicating whether source is matched. + */ + private Boolean sourceMatched; + + /* + * Value indicating whether source port is matched. + */ + private Boolean sourcePortMatched; + + /* + * Value indicating whether destination is matched. + */ + private Boolean destinationMatched; + + /* + * Value indicating whether destination port is matched. + */ + private Boolean destinationPortMatched; + + /** + * Creates an instance of NetworkSecurityRulesEvaluationResult class. + */ + public NetworkSecurityRulesEvaluationResult() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("protocolMatched", this.protocolMatched); + jsonWriter.writeBooleanField("sourceMatched", this.sourceMatched); + jsonWriter.writeBooleanField("sourcePortMatched", this.sourcePortMatched); + jsonWriter.writeBooleanField("destinationMatched", this.destinationMatched); + jsonWriter.writeBooleanField("destinationPortMatched", this.destinationPortMatched); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityRulesEvaluationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityRulesEvaluationResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityRulesEvaluationResult. + */ + public static NetworkSecurityRulesEvaluationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityRulesEvaluationResult deserializedNetworkSecurityRulesEvaluationResult + = new NetworkSecurityRulesEvaluationResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityRulesEvaluationResult.name = reader.getString(); + } else if ("protocolMatched".equals(fieldName)) { + deserializedNetworkSecurityRulesEvaluationResult.protocolMatched + = reader.getNullable(JsonReader::getBoolean); + } else if ("sourceMatched".equals(fieldName)) { + deserializedNetworkSecurityRulesEvaluationResult.sourceMatched + = reader.getNullable(JsonReader::getBoolean); + } else if ("sourcePortMatched".equals(fieldName)) { + deserializedNetworkSecurityRulesEvaluationResult.sourcePortMatched + = reader.getNullable(JsonReader::getBoolean); + } else if ("destinationMatched".equals(fieldName)) { + deserializedNetworkSecurityRulesEvaluationResult.destinationMatched + = reader.getNullable(JsonReader::getBoolean); + } else if ("destinationPortMatched".equals(fieldName)) { + deserializedNetworkSecurityRulesEvaluationResult.destinationPortMatched + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityRulesEvaluationResult; + }); + } +} 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..7f59a6f67a4f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliance.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.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 com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInstanceIdsInner; +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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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. Microsoft private, public and IANA reserved ASN are + * not supported. + * + * @return the virtualApplianceAsn value. + */ + Long virtualApplianceAsn(); + + /** + * Gets the sshPublicKey property: Public key for SSH login. + * + * @return the sshPublicKey value. + */ + String sshPublicKey(); + + /** + * Gets the virtualApplianceNics property: List of Virtual Appliance Network Interfaces. + * + * @return the virtualApplianceNics value. + */ + List virtualApplianceNics(); + + /** + * Gets the networkProfile property: Network Profile containing configurations for Public and Private NIC. + * + * @return the networkProfile value. + */ + NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile(); + + /** + * Gets the additionalNics property: Details required for Additional Network Interface. + * + * @return the additionalNics value. + */ + List additionalNics(); + + /** + * Gets the internetIngressPublicIps property: List of Resource Uri of Public IPs for Internet Ingress Scenario. + * + * @return the internetIngressPublicIps value. + */ + List internetIngressPublicIps(); + + /** + * Gets the virtualApplianceSites property: List of references to VirtualApplianceSite. + * + * @return the virtualApplianceSites value. + */ + List virtualApplianceSites(); + + /** + * Gets the virtualApplianceConnections property: List of references to VirtualApplianceConnections. + * + * @return the virtualApplianceConnections value. + */ + List virtualApplianceConnections(); + + /** + * 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 deploymentType property: The deployment type. PartnerManaged for the SaaS NVA. + * + * @return the deploymentType value. + */ + String deploymentType(); + + /** + * Gets the delegation property: The delegation for the Virtual Appliance. + * + * @return the delegation value. + */ + DelegationProperties delegation(); + + /** + * Gets the partnerManagedResource property: The delegation for the Virtual Appliance. + * + * @return the partnerManagedResource value. + */ + PartnerManagedResourceProperties partnerManagedResource(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithSshPublicKey, DefinitionStages.WithNetworkProfile, DefinitionStages.WithAdditionalNics, + DefinitionStages.WithInternetIngressPublicIps, DefinitionStages.WithDelegation, + DefinitionStages.WithPartnerManagedResource { + /** + * 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. Microsoft private, public and IANA + * reserved ASN are not supported.. + * + * @param virtualApplianceAsn VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not + * supported. + * @return the next definition stage. + */ + WithCreate withVirtualApplianceAsn(Long virtualApplianceAsn); + } + + /** + * The stage of the NetworkVirtualAppliance definition allowing to specify sshPublicKey. + */ + interface WithSshPublicKey { + /** + * Specifies the sshPublicKey property: Public key for SSH login.. + * + * @param sshPublicKey Public key for SSH login. + * @return the next definition stage. + */ + WithCreate withSshPublicKey(String sshPublicKey); + } + + /** + * The stage of the NetworkVirtualAppliance definition allowing to specify networkProfile. + */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Network Profile containing configurations for Public and Private + * NIC.. + * + * @param networkProfile Network Profile containing configurations for Public and Private NIC. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(NetworkVirtualAppliancePropertiesFormatNetworkProfile networkProfile); + } + + /** + * The stage of the NetworkVirtualAppliance definition allowing to specify additionalNics. + */ + interface WithAdditionalNics { + /** + * Specifies the additionalNics property: Details required for Additional Network Interface.. + * + * @param additionalNics Details required for Additional Network Interface. + * @return the next definition stage. + */ + WithCreate withAdditionalNics(List additionalNics); + } + + /** + * The stage of the NetworkVirtualAppliance definition allowing to specify internetIngressPublicIps. + */ + interface WithInternetIngressPublicIps { + /** + * Specifies the internetIngressPublicIps property: List of Resource Uri of Public IPs for Internet Ingress + * Scenario.. + * + * @param internetIngressPublicIps List of Resource Uri of Public IPs for Internet Ingress Scenario. + * @return the next definition stage. + */ + WithCreate withInternetIngressPublicIps(List internetIngressPublicIps); + } + + /** + * The stage of the NetworkVirtualAppliance definition allowing to specify delegation. + */ + interface WithDelegation { + /** + * Specifies the delegation property: The delegation for the Virtual Appliance. + * + * @param delegation The delegation for the Virtual Appliance. + * @return the next definition stage. + */ + WithCreate withDelegation(DelegationProperties delegation); + } + + /** + * The stage of the NetworkVirtualAppliance definition allowing to specify partnerManagedResource. + */ + interface WithPartnerManagedResource { + /** + * Specifies the partnerManagedResource property: The delegation for the Virtual Appliance. + * + * @param partnerManagedResource The delegation for the Virtual Appliance. + * @return the next definition stage. + */ + WithCreate withPartnerManagedResource(PartnerManagedResourceProperties partnerManagedResource); + } + } + + /** + * 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); + + /** + * Restarts one or more VMs belonging to the specified Network 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 specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + NetworkVirtualApplianceInstanceIds restart(); + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + NetworkVirtualApplianceInstanceIds + restart(NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnection.java new file mode 100644 index 0000000000000..33800a1448387 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnection.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.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkVirtualApplianceConnection. + */ +public interface NetworkVirtualApplianceConnection { + /** + * 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 namePropertiesName property: The name of the resource. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the provisioningState property: The provisioning state of the NetworkVirtualApplianceConnection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the asn property: Network Virtual Appliance ASN. + * + * @return the asn value. + */ + Long asn(); + + /** + * Gets the tunnelIdentifier property: Unique identifier for the connection. + * + * @return the tunnelIdentifier value. + */ + Long tunnelIdentifier(); + + /** + * Gets the bgpPeerAddress property: List of bgpPeerAddresses for the NVA instances. + * + * @return the bgpPeerAddress value. + */ + List bgpPeerAddress(); + + /** + * 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 inner com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner + * object. + * + * @return the inner object. + */ + NetworkVirtualApplianceConnectionInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnectionList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnectionList.java new file mode 100644 index 0000000000000..b62e5364091c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnectionList.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * NetworkVirtualApplianceConnection list. + */ +@Fluent +public final class NetworkVirtualApplianceConnectionList + implements JsonSerializable { + /* + * The list of NetworkVirtualAppliance connections. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkVirtualApplianceConnectionList class. + */ + public NetworkVirtualApplianceConnectionList() { + } + + /** + * Get the value property: The list of NetworkVirtualAppliance connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of NetworkVirtualAppliance connections. + * + * @param value the value value to set. + * @return the NetworkVirtualApplianceConnectionList object itself. + */ + public NetworkVirtualApplianceConnectionList 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 NetworkVirtualApplianceConnectionList object itself. + */ + public NetworkVirtualApplianceConnectionList 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceConnectionList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceConnectionList if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceConnectionList. + */ + public static NetworkVirtualApplianceConnectionList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceConnectionList deserializedNetworkVirtualApplianceConnectionList + = new NetworkVirtualApplianceConnectionList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkVirtualApplianceConnectionInner.fromJson(reader1)); + deserializedNetworkVirtualApplianceConnectionList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkVirtualApplianceConnectionList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceConnectionList; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnections.java new file mode 100644 index 0000000000000..6468c1f7bf90e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceConnections.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.NetworkVirtualApplianceConnectionInner; + +/** + * Resource collection API of NetworkVirtualApplianceConnections. + */ +public interface NetworkVirtualApplianceConnections { + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource. + */ + NetworkVirtualApplianceConnection createOrUpdate(String resourceGroupName, String networkVirtualApplianceName, + String connectionName, NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters); + + /** + * Creates a connection to Network Virtual Appliance, if it doesn't exist else updates the existing NVA connection'. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA connection. + * @param networkVirtualApplianceConnectionParameters Parameters supplied in an NetworkVirtualApplianceConnection + * 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 networkVirtualApplianceConnection resource. + */ + NetworkVirtualApplianceConnection createOrUpdate(String resourceGroupName, String networkVirtualApplianceName, + String connectionName, NetworkVirtualApplianceConnectionInner networkVirtualApplianceConnectionParameters, + Context context); + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String connectionName, Context context); + + /** + * Retrieves the details of specified NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceConnection resource. + */ + NetworkVirtualApplianceConnection get(String resourceGroupName, String networkVirtualApplianceName, + String connectionName); + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceName, String connectionName); + + /** + * Deletes a NVA connection. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of the Network Virtual Appliance. + * @param connectionName The name of the NVA 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 networkVirtualApplianceName, String connectionName, Context context); + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Lists NetworkVirtualApplianceConnections under the NVA. + * + * @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 networkVirtualApplianceConnection list as paginated response with {@link PagedIterable}. + */ + 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/models/NetworkVirtualApplianceInstanceIds.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceInstanceIds.java new file mode 100644 index 0000000000000..b0ee3497d1e8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceInstanceIds.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights 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.NetworkVirtualApplianceInstanceIdsInner; +import java.util.List; + +/** + * An immutable client-side representation of NetworkVirtualApplianceInstanceIds. + */ +public interface NetworkVirtualApplianceInstanceIds { + /** + * Gets the instanceIds property: The network virtual appliance instance ids. Omitting the network virtual appliance + * instance ids will result in the operation being performed on all virtual machines belonging to the network + * virtual appliance. + * + * @return the instanceIds value. + */ + List instanceIds(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInstanceIdsInner + * object. + * + * @return the inner object. + */ + NetworkVirtualApplianceInstanceIdsInner innerModel(); +} 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..76a5219d299fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListNetworkVirtualAppliances API service call. + */ +@Fluent +public final class NetworkVirtualApplianceListResult implements JsonSerializable { + /* + * List of Network Virtual Appliances. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkVirtualApplianceListResult class. + */ + public NetworkVirtualApplianceListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceListResult. + */ + public static NetworkVirtualApplianceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceListResult deserializedNetworkVirtualApplianceListResult + = new NetworkVirtualApplianceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkVirtualApplianceInner.fromJson(reader1)); + deserializedNetworkVirtualApplianceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkVirtualApplianceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliancePropertiesFormatNetworkProfile.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliancePropertiesFormatNetworkProfile.java new file mode 100644 index 0000000000000..5d879f8c34702 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliancePropertiesFormatNetworkProfile.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network Profile containing configurations for Public and Private NIC. + */ +@Fluent +public final class NetworkVirtualAppliancePropertiesFormatNetworkProfile + implements JsonSerializable { + /* + * The networkInterfaceConfigurations property. + */ + private List networkInterfaceConfigurations; + + /** + * Creates an instance of NetworkVirtualAppliancePropertiesFormatNetworkProfile class. + */ + public NetworkVirtualAppliancePropertiesFormatNetworkProfile() { + } + + /** + * Get the networkInterfaceConfigurations property: The networkInterfaceConfigurations property. + * + * @return the networkInterfaceConfigurations value. + */ + public List networkInterfaceConfigurations() { + return this.networkInterfaceConfigurations; + } + + /** + * Set the networkInterfaceConfigurations property: The networkInterfaceConfigurations property. + * + * @param networkInterfaceConfigurations the networkInterfaceConfigurations value to set. + * @return the NetworkVirtualAppliancePropertiesFormatNetworkProfile object itself. + */ + public NetworkVirtualAppliancePropertiesFormatNetworkProfile withNetworkInterfaceConfigurations( + List networkInterfaceConfigurations) { + this.networkInterfaceConfigurations = networkInterfaceConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaceConfigurations() != null) { + networkInterfaceConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("networkInterfaceConfigurations", this.networkInterfaceConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualAppliancePropertiesFormatNetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualAppliancePropertiesFormatNetworkProfile if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualAppliancePropertiesFormatNetworkProfile. + */ + public static NetworkVirtualAppliancePropertiesFormatNetworkProfile fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualAppliancePropertiesFormatNetworkProfile deserializedNetworkVirtualAppliancePropertiesFormatNetworkProfile + = new NetworkVirtualAppliancePropertiesFormatNetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaceConfigurations".equals(fieldName)) { + List networkInterfaceConfigurations + = reader.readArray(reader1 -> VirtualApplianceNetworkInterfaceConfiguration.fromJson(reader1)); + deserializedNetworkVirtualAppliancePropertiesFormatNetworkProfile.networkInterfaceConfigurations + = networkInterfaceConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualAppliancePropertiesFormatNetworkProfile; + }); + } +} 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..d58f534a93043 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSiteListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualApplianceSiteInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListNetworkVirtualApplianceSites API service call. + */ +@Fluent +public final class NetworkVirtualApplianceSiteListResult + implements JsonSerializable { + /* + * List of Network Virtual Appliance sites. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkVirtualApplianceSiteListResult class. + */ + public NetworkVirtualApplianceSiteListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceSiteListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceSiteListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceSiteListResult. + */ + public static NetworkVirtualApplianceSiteListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceSiteListResult deserializedNetworkVirtualApplianceSiteListResult + = new NetworkVirtualApplianceSiteListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualApplianceSiteInner.fromJson(reader1)); + deserializedNetworkVirtualApplianceSiteListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkVirtualApplianceSiteListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceSiteListResult; + }); + } +} 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..27ac665c5d5a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSku.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 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..ed7428a73a514 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuInstances.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.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network Virtual Appliance Sku Instances + * + * List of available Sku and instances. + */ +@Immutable +public final class NetworkVirtualApplianceSkuInstances + implements JsonSerializable { + /* + * Scale Unit. + */ + private String scaleUnit; + + /* + * Instance Count. + */ + private Integer instanceCount; + + /** + * Creates an instance of NetworkVirtualApplianceSkuInstances class. + */ + public NetworkVirtualApplianceSkuInstances() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceSkuInstances from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceSkuInstances if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceSkuInstances. + */ + public static NetworkVirtualApplianceSkuInstances fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceSkuInstances deserializedNetworkVirtualApplianceSkuInstances + = new NetworkVirtualApplianceSkuInstances(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scaleUnit".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInstances.scaleUnit = reader.getString(); + } else if ("instanceCount".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuInstances.instanceCount + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceSkuInstances; + }); + } +} 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..db525b799f49b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualApplianceSkuListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceSkuInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListNetworkVirtualApplianceSkus API service call. + */ +@Fluent +public final class NetworkVirtualApplianceSkuListResult + implements JsonSerializable { + /* + * List of Network Virtual Appliance Skus that are available. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkVirtualApplianceSkuListResult class. + */ + public NetworkVirtualApplianceSkuListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkVirtualApplianceSkuListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkVirtualApplianceSkuListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkVirtualApplianceSkuListResult. + */ + public static NetworkVirtualApplianceSkuListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkVirtualApplianceSkuListResult deserializedNetworkVirtualApplianceSkuListResult + = new NetworkVirtualApplianceSkuListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkVirtualApplianceSkuInner.fromJson(reader1)); + deserializedNetworkVirtualApplianceSkuListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkVirtualApplianceSkuListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkVirtualApplianceSkuListResult; + }); + } +} 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..ce3bdc6ce1cb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkVirtualAppliances.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.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.NetworkVirtualApplianceInstanceIdsInner; + +/** + * 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String networkVirtualApplianceName, String expand, 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); + + /** + * Restarts one or more VMs belonging to 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 specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + NetworkVirtualApplianceInstanceIds restart(String resourceGroupName, String networkVirtualApplianceName); + + /** + * Restarts one or more VMs belonging to the specified Network Virtual Appliance. + * + * @param resourceGroupName The name of the resource group. + * @param networkVirtualApplianceName The name of Network Virtual Appliance. + * @param networkVirtualApplianceInstanceIds Specifies a list of virtual machine instance IDs from the Network + * Virtual Appliance VM instances. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return specifies a list of virtual machine instance IDs from the Network Virtual Appliance VM instances. + */ + NetworkVirtualApplianceInstanceIds restart(String resourceGroupName, String networkVirtualApplianceName, + NetworkVirtualApplianceInstanceIdsInner networkVirtualApplianceInstanceIds, 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..134708611e67f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcher.java @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the provisioningState property: The provisioning state of the network watcher 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getTopologyWithResponse(TopologyParameters parameters, 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); + + /** + * 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..809fbcc8a2554 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatcherListResult.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkWatcherInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListNetworkWatchers API service call. + */ +@Fluent +public final class NetworkWatcherListResult implements JsonSerializable { + /* + * List of network watcher resources. + */ + private List value; + + /** + * Creates an instance of NetworkWatcherListResult class. + */ + public NetworkWatcherListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkWatcherListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkWatcherListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkWatcherListResult. + */ + public static NetworkWatcherListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkWatcherListResult deserializedNetworkWatcherListResult = new NetworkWatcherListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkWatcherInner.fromJson(reader1)); + deserializedNetworkWatcherListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkWatcherListResult; + }); + } +} 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..219c258b967b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NetworkWatchers.java @@ -0,0 +1,517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String networkWatcherName, + 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. + */ + NetworkWatcher getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getTopologyWithResponse(String resourceGroupName, String networkWatcherName, + TopologyParameters parameters, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..4b7e7cd84ecb1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the source and destination endpoint. + */ +@Fluent +public final class NextHopParameters implements JsonSerializable { + /* + * The resource identifier of the target resource against which the action is to be performed. + */ + private String targetResourceId; + + /* + * The source IP address. + */ + private String sourceIpAddress; + + /* + * The destination IP address. + */ + 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). + */ + private String targetNicResourceId; + + /** + * Creates an instance of NextHopParameters class. + */ + public NextHopParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model NextHopParameters")); + } + if (sourceIpAddress() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceIpAddress in model NextHopParameters")); + } + if (destinationIpAddress() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationIpAddress in model NextHopParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NextHopParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeStringField("sourceIPAddress", this.sourceIpAddress); + jsonWriter.writeStringField("destinationIPAddress", this.destinationIpAddress); + jsonWriter.writeStringField("targetNicResourceId", this.targetNicResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NextHopParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NextHopParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NextHopParameters. + */ + public static NextHopParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NextHopParameters deserializedNextHopParameters = new NextHopParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedNextHopParameters.targetResourceId = reader.getString(); + } else if ("sourceIPAddress".equals(fieldName)) { + deserializedNextHopParameters.sourceIpAddress = reader.getString(); + } else if ("destinationIPAddress".equals(fieldName)) { + deserializedNextHopParameters.destinationIpAddress = reader.getString(); + } else if ("targetNicResourceId".equals(fieldName)) { + deserializedNextHopParameters.targetNicResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNextHopParameters; + }); + } +} 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..f6f019f8fa8dd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopResult.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.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..496902313a8d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextHopType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Next hop type. + */ +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 a new instance of NextHopType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NextHopType() { + } + + /** + * Creates or finds a NextHopType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NextHopType. + */ + public static NextHopType fromString(String name) { + return fromString(name, NextHopType.class); + } + + /** + * Gets known NextHopType values. + * + * @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/NextStep.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextStep.java new file mode 100644 index 0000000000000..b37d937d1e83a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NextStep.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported next step behaviors after a rule is applied to a matched route. + */ +public final class NextStep extends ExpandableStringEnum { + /** + * Static value Unknown for NextStep. + */ + public static final NextStep UNKNOWN = fromString("Unknown"); + + /** + * Static value Continue for NextStep. + */ + public static final NextStep CONTINUE = fromString("Continue"); + + /** + * Static value Terminate for NextStep. + */ + public static final NextStep TERMINATE = fromString("Terminate"); + + /** + * Creates a new instance of NextStep value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NextStep() { + } + + /** + * Creates or finds a NextStep from its string representation. + * + * @param name a name to look for. + * @return the corresponding NextStep. + */ + public static NextStep fromString(String name) { + return fromString(name, NextStep.class); + } + + /** + * Gets known NextStep values. + * + * @return known NextStep values. + */ + public static Collection values() { + return values(NextStep.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInRequest.java new file mode 100644 index 0000000000000..43886dd279718 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInRequest.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * NIC type. This should be either PublicNic or PrivateNic. + */ +public final class NicTypeInRequest extends ExpandableStringEnum { + /** + * Static value PublicNic for NicTypeInRequest. + */ + public static final NicTypeInRequest PUBLIC_NIC = fromString("PublicNic"); + + /** + * Static value PrivateNic for NicTypeInRequest. + */ + public static final NicTypeInRequest PRIVATE_NIC = fromString("PrivateNic"); + + /** + * Creates a new instance of NicTypeInRequest value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NicTypeInRequest() { + } + + /** + * Creates or finds a NicTypeInRequest from its string representation. + * + * @param name a name to look for. + * @return the corresponding NicTypeInRequest. + */ + public static NicTypeInRequest fromString(String name) { + return fromString(name, NicTypeInRequest.class); + } + + /** + * Gets known NicTypeInRequest values. + * + * @return known NicTypeInRequest values. + */ + public static Collection values() { + return values(NicTypeInRequest.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInResponse.java new file mode 100644 index 0000000000000..238f30935db7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/NicTypeInResponse.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * NIC type - PublicNic, PrivateNic, or AdditionalNic. + */ +public final class NicTypeInResponse extends ExpandableStringEnum { + /** + * Static value PublicNic for NicTypeInResponse. + */ + public static final NicTypeInResponse PUBLIC_NIC = fromString("PublicNic"); + + /** + * Static value PrivateNic for NicTypeInResponse. + */ + public static final NicTypeInResponse PRIVATE_NIC = fromString("PrivateNic"); + + /** + * Static value AdditionalNic for NicTypeInResponse. + */ + public static final NicTypeInResponse ADDITIONAL_NIC = fromString("AdditionalNic"); + + /** + * Creates a new instance of NicTypeInResponse value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NicTypeInResponse() { + } + + /** + * Creates or finds a NicTypeInResponse from its string representation. + * + * @param name a name to look for. + * @return the corresponding NicTypeInResponse. + */ + public static NicTypeInResponse fromString(String name) { + return fromString(name, NicTypeInResponse.class); + } + + /** + * Gets known NicTypeInResponse values. + * + * @return known NicTypeInResponse values. + */ + public static Collection values() { + return values(NicTypeInResponse.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..5be204ebc4fef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365BreakOutCategoryPolicies.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Office365 breakout categories. + */ +@Fluent +public final class O365BreakOutCategoryPolicies implements JsonSerializable { + /* + * Flag to control allow category. + */ + private Boolean allow; + + /* + * Flag to control optimize category. + */ + private Boolean optimize; + + /* + * Flag to control default category. + */ + private Boolean defaultProperty; + + /** + * Creates an instance of O365BreakOutCategoryPolicies class. + */ + public O365BreakOutCategoryPolicies() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allow", this.allow); + jsonWriter.writeBooleanField("optimize", this.optimize); + jsonWriter.writeBooleanField("default", this.defaultProperty); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of O365BreakOutCategoryPolicies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of O365BreakOutCategoryPolicies if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the O365BreakOutCategoryPolicies. + */ + public static O365BreakOutCategoryPolicies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + O365BreakOutCategoryPolicies deserializedO365BreakOutCategoryPolicies = new O365BreakOutCategoryPolicies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allow".equals(fieldName)) { + deserializedO365BreakOutCategoryPolicies.allow = reader.getNullable(JsonReader::getBoolean); + } else if ("optimize".equals(fieldName)) { + deserializedO365BreakOutCategoryPolicies.optimize = reader.getNullable(JsonReader::getBoolean); + } else if ("default".equals(fieldName)) { + deserializedO365BreakOutCategoryPolicies.defaultProperty + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedO365BreakOutCategoryPolicies; + }); + } +} 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..dde5f8e38cd01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/O365PolicyProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Office365 breakout policy. + */ +@Fluent +public final class O365PolicyProperties implements JsonSerializable { + /* + * Office365 breakout categories. + */ + private O365BreakOutCategoryPolicies breakOutCategories; + + /** + * Creates an instance of O365PolicyProperties class. + */ + public O365PolicyProperties() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("breakOutCategories", this.breakOutCategories); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of O365PolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of O365PolicyProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the O365PolicyProperties. + */ + public static O365PolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + O365PolicyProperties deserializedO365PolicyProperties = new O365PolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("breakOutCategories".equals(fieldName)) { + deserializedO365PolicyProperties.breakOutCategories = O365BreakOutCategoryPolicies.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedO365PolicyProperties; + }); + } +} 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..035b013306fba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Office365PolicyProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network Virtual Appliance Sku Properties. + */ +@Fluent +public final class Office365PolicyProperties implements JsonSerializable { + /* + * Office 365 breakout categories. + */ + private BreakOutCategoryPolicies breakOutCategories; + + /** + * Creates an instance of Office365PolicyProperties class. + */ + public Office365PolicyProperties() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("breakOutCategories", this.breakOutCategories); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Office365PolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Office365PolicyProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the Office365PolicyProperties. + */ + public static Office365PolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Office365PolicyProperties deserializedOffice365PolicyProperties = new Office365PolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("breakOutCategories".equals(fieldName)) { + deserializedOffice365PolicyProperties.breakOutCategories + = BreakOutCategoryPolicies.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOffice365PolicyProperties; + }); + } +} 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..19a4552fd8417 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OfficeTrafficCategory.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 java.util.Collection; + +/** + * The office traffic category. + */ +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 a new instance of OfficeTrafficCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OfficeTrafficCategory() { + } + + /** + * Creates or finds a OfficeTrafficCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding OfficeTrafficCategory. + */ + public static OfficeTrafficCategory fromString(String name) { + return fromString(name, OfficeTrafficCategory.class); + } + + /** + * Gets known OfficeTrafficCategory values. + * + * @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..618f35f535162 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operation.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.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..780aa7735a0d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationDisplay.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Display metadata associated with the operation. + */ +@Fluent +public final class OperationDisplay implements JsonSerializable { + /* + * Service provider: Microsoft Network. + */ + private String provider; + + /* + * Resource on which the operation is performed. + */ + private String resource; + + /* + * Type of the operation: get, read, delete, etc. + */ + private String operation; + + /* + * Description of the operation. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/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..1d3db87ebcd22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.OperationInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of Network operations supported by the Network resource provider. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} 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..c37d5e7135e6b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OperationPropertiesFormatServiceSpecification.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Specification of the service. + */ +@Fluent +public final class OperationPropertiesFormatServiceSpecification + implements JsonSerializable { + /* + * Operation service specification. + */ + private List metricSpecifications; + + /* + * Operation log specification. + */ + private List logSpecifications; + + /** + * Creates an instance of OperationPropertiesFormatServiceSpecification class. + */ + public OperationPropertiesFormatServiceSpecification() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("metricSpecifications", this.metricSpecifications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationPropertiesFormatServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationPropertiesFormatServiceSpecification if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationPropertiesFormatServiceSpecification. + */ + public static OperationPropertiesFormatServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationPropertiesFormatServiceSpecification deserializedOperationPropertiesFormatServiceSpecification + = new OperationPropertiesFormatServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricSpecifications".equals(fieldName)) { + List metricSpecifications + = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); + deserializedOperationPropertiesFormatServiceSpecification.metricSpecifications + = metricSpecifications; + } else if ("logSpecifications".equals(fieldName)) { + List logSpecifications + = reader.readArray(reader1 -> LogSpecification.fromJson(reader1)); + deserializedOperationPropertiesFormatServiceSpecification.logSpecifications = logSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationPropertiesFormatServiceSpecification; + }); + } +} 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..21014c74f410d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OrderBy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OrderBy.java new file mode 100644 index 0000000000000..2fdfc81dc3cc9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OrderBy.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a column to sort. + */ +@Fluent +public final class OrderBy implements JsonSerializable { + /* + * Describes the actual column name to sort by + */ + private String field; + + /* + * Describes if results should be in ascending/descending order + */ + private FirewallPolicyIdpsQuerySortOrder order; + + /** + * Creates an instance of OrderBy class. + */ + public OrderBy() { + } + + /** + * Get the field property: Describes the actual column name to sort by. + * + * @return the field value. + */ + public String field() { + return this.field; + } + + /** + * Set the field property: Describes the actual column name to sort by. + * + * @param field the field value to set. + * @return the OrderBy object itself. + */ + public OrderBy withField(String field) { + this.field = field; + return this; + } + + /** + * Get the order property: Describes if results should be in ascending/descending order. + * + * @return the order value. + */ + public FirewallPolicyIdpsQuerySortOrder order() { + return this.order; + } + + /** + * Set the order property: Describes if results should be in ascending/descending order. + * + * @param order the order value to set. + * @return the OrderBy object itself. + */ + public OrderBy withOrder(FirewallPolicyIdpsQuerySortOrder order) { + this.order = order; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("field", this.field); + jsonWriter.writeStringField("order", this.order == null ? null : this.order.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrderBy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrderBy if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the OrderBy. + */ + public static OrderBy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrderBy deserializedOrderBy = new OrderBy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("field".equals(fieldName)) { + deserializedOrderBy.field = reader.getString(); + } else if ("order".equals(fieldName)) { + deserializedOrderBy.order = FirewallPolicyIdpsQuerySortOrder.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOrderBy; + }); + } +} 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..3d84f3ed4e0b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Origin.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The origin of the issue. + */ +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 a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/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..d724388e9b93f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutboundRule.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.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..a2793fe836d92 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OutputType.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 java.util.Collection; + +/** + * Connection monitor output destination type. Currently, only "Workspace" is supported. + */ +public final class OutputType extends ExpandableStringEnum { + /** + * Static value Workspace for OutputType. + */ + public static final OutputType WORKSPACE = fromString("Workspace"); + + /** + * Creates a new instance of OutputType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OutputType() { + } + + /** + * Creates or finds a OutputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutputType. + */ + public static OutputType fromString(String name) { + return fromString(name, OutputType.class); + } + + /** + * Gets known OutputType values. + * + * @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..0103380eb9c98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntry.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Allow to exclude some variable satisfy the condition for the WAF check. + */ +@Fluent +public final class OwaspCrsExclusionEntry implements JsonSerializable { + /* + * The variable to be excluded. + */ + private OwaspCrsExclusionEntryMatchVariable matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this + * exclusion applies to. + */ + private OwaspCrsExclusionEntrySelectorMatchOperator selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which elements in the collection this exclusion + * applies to. + */ + private String selector; + + /* + * The managed rule sets that are associated with the exclusion. + */ + private List exclusionManagedRuleSets; + + /** + * Creates an instance of OwaspCrsExclusionEntry class. + */ + public OwaspCrsExclusionEntry() { + } + + /** + * 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; + } + + /** + * Get the exclusionManagedRuleSets property: The managed rule sets that are associated with the exclusion. + * + * @return the exclusionManagedRuleSets value. + */ + public List exclusionManagedRuleSets() { + return this.exclusionManagedRuleSets; + } + + /** + * Set the exclusionManagedRuleSets property: The managed rule sets that are associated with the exclusion. + * + * @param exclusionManagedRuleSets the exclusionManagedRuleSets value to set. + * @return the OwaspCrsExclusionEntry object itself. + */ + public OwaspCrsExclusionEntry withExclusionManagedRuleSets(List exclusionManagedRuleSets) { + this.exclusionManagedRuleSets = exclusionManagedRuleSets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property matchVariable in model OwaspCrsExclusionEntry")); + } + if (selectorMatchOperator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectorMatchOperator in model OwaspCrsExclusionEntry")); + } + if (selector() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property selector in model OwaspCrsExclusionEntry")); + } + if (exclusionManagedRuleSets() != null) { + exclusionManagedRuleSets().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OwaspCrsExclusionEntry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("matchVariable", this.matchVariable == null ? null : this.matchVariable.toString()); + jsonWriter.writeStringField("selectorMatchOperator", + this.selectorMatchOperator == null ? null : this.selectorMatchOperator.toString()); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeArrayField("exclusionManagedRuleSets", this.exclusionManagedRuleSets, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OwaspCrsExclusionEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OwaspCrsExclusionEntry if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OwaspCrsExclusionEntry. + */ + public static OwaspCrsExclusionEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OwaspCrsExclusionEntry deserializedOwaspCrsExclusionEntry = new OwaspCrsExclusionEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchVariable".equals(fieldName)) { + deserializedOwaspCrsExclusionEntry.matchVariable + = OwaspCrsExclusionEntryMatchVariable.fromString(reader.getString()); + } else if ("selectorMatchOperator".equals(fieldName)) { + deserializedOwaspCrsExclusionEntry.selectorMatchOperator + = OwaspCrsExclusionEntrySelectorMatchOperator.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedOwaspCrsExclusionEntry.selector = reader.getString(); + } else if ("exclusionManagedRuleSets".equals(fieldName)) { + List exclusionManagedRuleSets + = reader.readArray(reader1 -> ExclusionManagedRuleSet.fromJson(reader1)); + deserializedOwaspCrsExclusionEntry.exclusionManagedRuleSets = exclusionManagedRuleSets; + } else { + reader.skipChildren(); + } + } + + return deserializedOwaspCrsExclusionEntry; + }); + } +} 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..6e4a1ac3b1b38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntryMatchVariable.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The variable to be excluded. + */ +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"); + + /** + * Static value RequestHeaderKeys for OwaspCrsExclusionEntryMatchVariable. + */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_HEADER_KEYS = fromString("RequestHeaderKeys"); + + /** + * Static value RequestHeaderValues for OwaspCrsExclusionEntryMatchVariable. + */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_HEADER_VALUES = fromString("RequestHeaderValues"); + + /** + * Static value RequestCookieKeys for OwaspCrsExclusionEntryMatchVariable. + */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_COOKIE_KEYS = fromString("RequestCookieKeys"); + + /** + * Static value RequestCookieValues for OwaspCrsExclusionEntryMatchVariable. + */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_COOKIE_VALUES = fromString("RequestCookieValues"); + + /** + * Static value RequestArgKeys for OwaspCrsExclusionEntryMatchVariable. + */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_ARG_KEYS = fromString("RequestArgKeys"); + + /** + * Static value RequestArgValues for OwaspCrsExclusionEntryMatchVariable. + */ + public static final OwaspCrsExclusionEntryMatchVariable REQUEST_ARG_VALUES = fromString("RequestArgValues"); + + /** + * Creates a new instance of OwaspCrsExclusionEntryMatchVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OwaspCrsExclusionEntryMatchVariable() { + } + + /** + * Creates or finds a OwaspCrsExclusionEntryMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwaspCrsExclusionEntryMatchVariable. + */ + public static OwaspCrsExclusionEntryMatchVariable fromString(String name) { + return fromString(name, OwaspCrsExclusionEntryMatchVariable.class); + } + + /** + * Gets known OwaspCrsExclusionEntryMatchVariable values. + * + * @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..791dc140392b7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/OwaspCrsExclusionEntrySelectorMatchOperator.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this + * exclusion applies to. + */ +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 a new instance of OwaspCrsExclusionEntrySelectorMatchOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OwaspCrsExclusionEntrySelectorMatchOperator() { + } + + /** + * Creates or finds a OwaspCrsExclusionEntrySelectorMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding OwaspCrsExclusionEntrySelectorMatchOperator. + */ + public static OwaspCrsExclusionEntrySelectorMatchOperator fromString(String name) { + return fromString(name, OwaspCrsExclusionEntrySelectorMatchOperator.class); + } + + /** + * Gets known OwaspCrsExclusionEntrySelectorMatchOperator values. + * + * @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..551ad9e8d535d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SConnectionConfiguration.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.P2SConnectionConfigurationProperties; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * P2SConnectionConfiguration Resource. + */ +@Fluent +public final class P2SConnectionConfiguration extends SubResource { + /* + * Properties of the P2S connection configuration. + */ + private P2SConnectionConfigurationProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of P2SConnectionConfiguration class. + */ + public P2SConnectionConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the P2S connection configuration. + * + * @return the innerProperties value. + */ + private P2SConnectionConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public P2SConnectionConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SConnectionConfigurationProperties(); + } + this.innerProperties().withVpnClientAddressPool(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SConnectionConfigurationProperties(); + } + this.innerProperties().withRoutingConfiguration(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new P2SConnectionConfigurationProperties(); + } + this.innerProperties().withEnableInternetSecurity(enableInternetSecurity); + return this; + } + + /** + * Get the configurationPolicyGroupAssociations property: List of Configuration Policy Groups that this + * P2SConnectionConfiguration is attached to. + * + * @return the configurationPolicyGroupAssociations value. + */ + public List configurationPolicyGroupAssociations() { + return this.innerProperties() == null ? null : this.innerProperties().configurationPolicyGroupAssociations(); + } + + /** + * Get the previousConfigurationPolicyGroupAssociations property: List of previous Configuration Policy Groups that + * this P2SConnectionConfiguration was attached to. + * + * @return the previousConfigurationPolicyGroupAssociations value. + */ + public List previousConfigurationPolicyGroupAssociations() { + return this.innerProperties() == null + ? null + : this.innerProperties().previousConfigurationPolicyGroupAssociations(); + } + + /** + * Get the provisioningState property: The provisioning state of the P2SConnectionConfiguration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SConnectionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SConnectionConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the P2SConnectionConfiguration. + */ + public static P2SConnectionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SConnectionConfiguration deserializedP2SConnectionConfiguration = new P2SConnectionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedP2SConnectionConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedP2SConnectionConfiguration.innerProperties + = P2SConnectionConfigurationProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedP2SConnectionConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedP2SConnectionConfiguration.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedP2SConnectionConfiguration; + }); + } +} 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..251ec934db048 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealth.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.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..b6a5a4e7feb2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionHealthRequest.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of P2S Vpn connection health request. + */ +@Fluent +public final class P2SVpnConnectionHealthRequest implements JsonSerializable { + /* + * The list of p2s vpn user names whose p2s vpn connection detailed health to retrieve for. + */ + private List vpnUserNamesFilter; + + /* + * The sas-url to download the P2S Vpn connection health detail. + */ + private String outputBlobSasUrl; + + /** + * Creates an instance of P2SVpnConnectionHealthRequest class. + */ + public P2SVpnConnectionHealthRequest() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vpnUserNamesFilter", this.vpnUserNamesFilter, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("outputBlobSasUrl", this.outputBlobSasUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SVpnConnectionHealthRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SVpnConnectionHealthRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the P2SVpnConnectionHealthRequest. + */ + public static P2SVpnConnectionHealthRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SVpnConnectionHealthRequest deserializedP2SVpnConnectionHealthRequest + = new P2SVpnConnectionHealthRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnUserNamesFilter".equals(fieldName)) { + List vpnUserNamesFilter = reader.readArray(reader1 -> reader1.getString()); + deserializedP2SVpnConnectionHealthRequest.vpnUserNamesFilter = vpnUserNamesFilter; + } else if ("outputBlobSasUrl".equals(fieldName)) { + deserializedP2SVpnConnectionHealthRequest.outputBlobSasUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedP2SVpnConnectionHealthRequest; + }); + } +} 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..9c723eee37aa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnConnectionRequest.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of p2s vpn connections to be disconnected. + */ +@Fluent +public final class P2SVpnConnectionRequest implements JsonSerializable { + /* + * List of p2s vpn connection Ids. + */ + private List vpnConnectionIds; + + /** + * Creates an instance of P2SVpnConnectionRequest class. + */ + public P2SVpnConnectionRequest() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("vpnConnectionIds", this.vpnConnectionIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SVpnConnectionRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SVpnConnectionRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the P2SVpnConnectionRequest. + */ + public static P2SVpnConnectionRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SVpnConnectionRequest deserializedP2SVpnConnectionRequest = new P2SVpnConnectionRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnConnectionIds".equals(fieldName)) { + List vpnConnectionIds = reader.readArray(reader1 -> reader1.getString()); + deserializedP2SVpnConnectionRequest.vpnConnectionIds = vpnConnectionIds; + } else { + reader.skipChildren(); + } + } + + return deserializedP2SVpnConnectionRequest; + }); + } +} 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..65dd1374cebbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateway.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..c489002185523 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnGateways.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..e3a8031b9a1ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/P2SVpnProfileParameters.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Vpn Client Parameters for package generation. + */ +@Fluent +public final class P2SVpnProfileParameters implements JsonSerializable { + /* + * VPN client authentication method. + */ + private AuthenticationMethod authenticationMethod; + + /** + * Creates an instance of P2SVpnProfileParameters class. + */ + public P2SVpnProfileParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authenticationMethod", + this.authenticationMethod == null ? null : this.authenticationMethod.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of P2SVpnProfileParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of P2SVpnProfileParameters if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the P2SVpnProfileParameters. + */ + public static P2SVpnProfileParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + P2SVpnProfileParameters deserializedP2SVpnProfileParameters = new P2SVpnProfileParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authenticationMethod".equals(fieldName)) { + deserializedP2SVpnProfileParameters.authenticationMethod + = AuthenticationMethod.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedP2SVpnProfileParameters; + }); + } +} 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..dab28a8a78219 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCapture.java @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureParameters; +import java.io.IOException; +import java.util.List; + +/** + * Parameters that define the create packet capture operation. + */ +@Fluent +public final class PacketCapture implements JsonSerializable { + /* + * Properties of the packet capture. + */ + private PacketCaptureParameters innerProperties = new PacketCaptureParameters(); + + /** + * Creates an instance of PacketCapture class. + */ + public PacketCapture() { + } + + /** + * Get the innerProperties property: Properties of the packet capture. + * + * @return the innerProperties value. + */ + private PacketCaptureParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently + * supported. + * + * @return the target value. + */ + public String target() { + return this.innerProperties() == null ? null : this.innerProperties().target(); + } + + /** + * Set the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently + * supported. + * + * @param target the target value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withTarget(String target) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withTarget(target); + return this; + } + + /** + * Get the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If + * both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + * + * @return the scope value. + */ + public PacketCaptureMachineScope scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If + * both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + * + * @param scope the scope value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withScope(PacketCaptureMachineScope scope) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the targetType property: Target type of the resource provided. + * + * @return the targetType value. + */ + public PacketCaptureTargetType targetType() { + return this.innerProperties() == null ? null : this.innerProperties().targetType(); + } + + /** + * Set the targetType property: Target type of the resource provided. + * + * @param targetType the targetType value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withTargetType(PacketCaptureTargetType targetType) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withTargetType(targetType); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withBytesToCapturePerPacket(bytesToCapturePerPacket); + return this; + } + + /** + * Get the totalBytesPerSession property: Maximum size of the capture output. + * + * @return the totalBytesPerSession value. + */ + public Long totalBytesPerSession() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withTotalBytesPerSession(totalBytesPerSession); + return this; + } + + /** + * Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds. + * + * @return the timeLimitInSeconds value. + */ + public Integer timeLimitInSeconds() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withTimeLimitInSeconds(timeLimitInSeconds); + return this; + } + + /** + * Get the storageLocation property: The storage location for a packet capture session. + * + * @return the storageLocation value. + */ + public PacketCaptureStorageLocation storageLocation() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withStorageLocation(storageLocation); + return this; + } + + /** + * Get the filters property: A list of packet capture filters. + * + * @return the filters value. + */ + public List filters() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withFilters(filters); + return this; + } + + /** + * Get the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true' + * or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. + * + * @return the continuousCapture value. + */ + public Boolean continuousCapture() { + return this.innerProperties() == null ? null : this.innerProperties().continuousCapture(); + } + + /** + * Set the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true' + * or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. + * + * @param continuousCapture the continuousCapture value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withContinuousCapture(Boolean continuousCapture) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withContinuousCapture(continuousCapture); + return this; + } + + /** + * Get the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes', + * 'SessionTimeLimitInSeconds' values. + * + * @return the captureSettings value. + */ + public PacketCaptureSettings captureSettings() { + return this.innerProperties() == null ? null : this.innerProperties().captureSettings(); + } + + /** + * Set the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes', + * 'SessionTimeLimitInSeconds' values. + * + * @param captureSettings the captureSettings value to set. + * @return the PacketCapture object itself. + */ + public PacketCapture withCaptureSettings(PacketCaptureSettings captureSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new PacketCaptureParameters(); + } + this.innerProperties().withCaptureSettings(captureSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model PacketCapture")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PacketCapture.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCapture from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCapture if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PacketCapture. + */ + public static PacketCapture fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCapture deserializedPacketCapture = new PacketCapture(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedPacketCapture.innerProperties = PacketCaptureParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCapture; + }); + } +} 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..d33caf76421bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureFilter.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Filter that is applied to packet capture request. Multiple filters can be applied. + */ +@Fluent +public final class PacketCaptureFilter implements JsonSerializable { + /* + * Protocol to be filtered on. + */ + 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. + */ + 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. + */ + 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. + */ + 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. + */ + private String remotePort; + + /** + * Creates an instance of PacketCaptureFilter class. + */ + public PacketCaptureFilter() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("localIPAddress", this.localIpAddress); + jsonWriter.writeStringField("remoteIPAddress", this.remoteIpAddress); + jsonWriter.writeStringField("localPort", this.localPort); + jsonWriter.writeStringField("remotePort", this.remotePort); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureFilter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PacketCaptureFilter. + */ + public static PacketCaptureFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureFilter deserializedPacketCaptureFilter = new PacketCaptureFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedPacketCaptureFilter.protocol = PcProtocol.fromString(reader.getString()); + } else if ("localIPAddress".equals(fieldName)) { + deserializedPacketCaptureFilter.localIpAddress = reader.getString(); + } else if ("remoteIPAddress".equals(fieldName)) { + deserializedPacketCaptureFilter.remoteIpAddress = reader.getString(); + } else if ("localPort".equals(fieldName)) { + deserializedPacketCaptureFilter.localPort = reader.getString(); + } else if ("remotePort".equals(fieldName)) { + deserializedPacketCaptureFilter.remotePort = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureFilter; + }); + } +} 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..ff698a0567b19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureListResult.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.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PacketCaptureResultInner; +import java.io.IOException; +import java.util.List; + +/** + * List of packet capture sessions. + */ +@Fluent +public final class PacketCaptureListResult implements JsonSerializable { + /* + * Information about packet capture sessions. + */ + private List value; + + /** + * Creates an instance of PacketCaptureListResult class. + */ + public PacketCaptureListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PacketCaptureListResult. + */ + public static PacketCaptureListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureListResult deserializedPacketCaptureListResult = new PacketCaptureListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PacketCaptureResultInner.fromJson(reader1)); + deserializedPacketCaptureListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureMachineScope.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureMachineScope.java new file mode 100644 index 0000000000000..253120dedc260 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureMachineScope.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded + * are empty, then the packet capture will run on all instances of AzureVMSS. + */ +@Fluent +public final class PacketCaptureMachineScope implements JsonSerializable { + /* + * List of AzureVMSS instances to run packet capture on. + */ + private List include; + + /* + * List of AzureVMSS instances which has to be excluded from the AzureVMSS from running packet capture. + */ + private List exclude; + + /** + * Creates an instance of PacketCaptureMachineScope class. + */ + public PacketCaptureMachineScope() { + } + + /** + * Get the include property: List of AzureVMSS instances to run packet capture on. + * + * @return the include value. + */ + public List include() { + return this.include; + } + + /** + * Set the include property: List of AzureVMSS instances to run packet capture on. + * + * @param include the include value to set. + * @return the PacketCaptureMachineScope object itself. + */ + public PacketCaptureMachineScope withInclude(List include) { + this.include = include; + return this; + } + + /** + * Get the exclude property: List of AzureVMSS instances which has to be excluded from the AzureVMSS from running + * packet capture. + * + * @return the exclude value. + */ + public List exclude() { + return this.exclude; + } + + /** + * Set the exclude property: List of AzureVMSS instances which has to be excluded from the AzureVMSS from running + * packet capture. + * + * @param exclude the exclude value to set. + * @return the PacketCaptureMachineScope object itself. + */ + public PacketCaptureMachineScope withExclude(List exclude) { + this.exclude = exclude; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("include", this.include, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("exclude", this.exclude, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureMachineScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureMachineScope if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PacketCaptureMachineScope. + */ + public static PacketCaptureMachineScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureMachineScope deserializedPacketCaptureMachineScope = new PacketCaptureMachineScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("include".equals(fieldName)) { + List include = reader.readArray(reader1 -> reader1.getString()); + deserializedPacketCaptureMachineScope.include = include; + } else if ("exclude".equals(fieldName)) { + List exclude = reader.readArray(reader1 -> reader1.getString()); + deserializedPacketCaptureMachineScope.exclude = exclude; + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureMachineScope; + }); + } +} 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..4f759a962c209 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureQueryStatusResult.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.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..9fdc89df4cf0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureResult.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights 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 provisioningState property: The provisioning state of the packet capture session. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are + * currently supported. + * + * @return the target value. + */ + String target(); + + /** + * Gets the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. + * If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + * + * @return the scope value. + */ + PacketCaptureMachineScope scope(); + + /** + * Gets the targetType property: Target type of the resource provided. + * + * @return the targetType value. + */ + PacketCaptureTargetType targetType(); + + /** + * 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 continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true' + * or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'. + * + * @return the continuousCapture value. + */ + Boolean continuousCapture(); + + /** + * Gets the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes', + * 'SessionTimeLimitInSeconds' values. + * + * @return the captureSettings value. + */ + PacketCaptureSettings captureSettings(); + + /** + * 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/PacketCaptureSettings.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureSettings.java new file mode 100644 index 0000000000000..3f71ff8242e33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureSettings.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The storage location for a packet capture session. + */ +@Fluent +public final class PacketCaptureSettings implements JsonSerializable { + /* + * Number of file count. Default value of count is 10 and maximum number is 10000. + */ + private Integer fileCount; + + /* + * Number of bytes captured per packet. Default value in bytes 104857600 (100MB) and maximum in bytes 4294967295 + * (4GB). + */ + private Long fileSizeInBytes; + + /* + * Maximum duration of the capture session in seconds is 604800s (7 days) for a file. Default value in second 86400s + * (1 day). + */ + private Integer sessionTimeLimitInSeconds; + + /** + * Creates an instance of PacketCaptureSettings class. + */ + public PacketCaptureSettings() { + } + + /** + * Get the fileCount property: Number of file count. Default value of count is 10 and maximum number is 10000. + * + * @return the fileCount value. + */ + public Integer fileCount() { + return this.fileCount; + } + + /** + * Set the fileCount property: Number of file count. Default value of count is 10 and maximum number is 10000. + * + * @param fileCount the fileCount value to set. + * @return the PacketCaptureSettings object itself. + */ + public PacketCaptureSettings withFileCount(Integer fileCount) { + this.fileCount = fileCount; + return this; + } + + /** + * Get the fileSizeInBytes property: Number of bytes captured per packet. Default value in bytes 104857600 (100MB) + * and maximum in bytes 4294967295 (4GB). + * + * @return the fileSizeInBytes value. + */ + public Long fileSizeInBytes() { + return this.fileSizeInBytes; + } + + /** + * Set the fileSizeInBytes property: Number of bytes captured per packet. Default value in bytes 104857600 (100MB) + * and maximum in bytes 4294967295 (4GB). + * + * @param fileSizeInBytes the fileSizeInBytes value to set. + * @return the PacketCaptureSettings object itself. + */ + public PacketCaptureSettings withFileSizeInBytes(Long fileSizeInBytes) { + this.fileSizeInBytes = fileSizeInBytes; + return this; + } + + /** + * Get the sessionTimeLimitInSeconds property: Maximum duration of the capture session in seconds is 604800s (7 + * days) for a file. Default value in second 86400s (1 day). + * + * @return the sessionTimeLimitInSeconds value. + */ + public Integer sessionTimeLimitInSeconds() { + return this.sessionTimeLimitInSeconds; + } + + /** + * Set the sessionTimeLimitInSeconds property: Maximum duration of the capture session in seconds is 604800s (7 + * days) for a file. Default value in second 86400s (1 day). + * + * @param sessionTimeLimitInSeconds the sessionTimeLimitInSeconds value to set. + * @return the PacketCaptureSettings object itself. + */ + public PacketCaptureSettings withSessionTimeLimitInSeconds(Integer sessionTimeLimitInSeconds) { + this.sessionTimeLimitInSeconds = sessionTimeLimitInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("fileCount", this.fileCount); + jsonWriter.writeNumberField("fileSizeInBytes", this.fileSizeInBytes); + jsonWriter.writeNumberField("sessionTimeLimitInSeconds", this.sessionTimeLimitInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PacketCaptureSettings. + */ + public static PacketCaptureSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureSettings deserializedPacketCaptureSettings = new PacketCaptureSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileCount".equals(fieldName)) { + deserializedPacketCaptureSettings.fileCount = reader.getNullable(JsonReader::getInt); + } else if ("fileSizeInBytes".equals(fieldName)) { + deserializedPacketCaptureSettings.fileSizeInBytes = reader.getNullable(JsonReader::getLong); + } else if ("sessionTimeLimitInSeconds".equals(fieldName)) { + deserializedPacketCaptureSettings.sessionTimeLimitInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureSettings; + }); + } +} 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..d71596c82ece6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureStorageLocation.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The storage location for a packet capture session. + */ +@Fluent +public final class PacketCaptureStorageLocation implements JsonSerializable { + /* + * The ID of the storage account to save the packet capture session. Required if no localPath or filePath is + * provided. + */ + 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. + */ + private String storagePath; + + /* + * This path is invalid if 'Continuous Capture' is provided with 'true' or 'false'. 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. + */ + private String filePath; + + /* + * This path is valid if 'Continuous Capture' is provided with 'true' or 'false' and required if no storage ID is + * provided, otherwise optional. Must include the name of the capture file (*.cap). For linux virtual machine it + * must start with /var/captures. + */ + private String localPath; + + /** + * Creates an instance of PacketCaptureStorageLocation class. + */ + public PacketCaptureStorageLocation() { + } + + /** + * Get the storageId property: The ID of the storage account to save the packet capture session. Required if no + * localPath or filePath 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 + * localPath or filePath 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: This path is invalid if 'Continuous Capture' is provided with 'true' or 'false'. 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: This path is invalid if 'Continuous Capture' is provided with 'true' or 'false'. 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; + } + + /** + * Get the localPath property: This path is valid if 'Continuous Capture' is provided with 'true' or 'false' and + * required if no storage ID is provided, otherwise optional. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. + * + * @return the localPath value. + */ + public String localPath() { + return this.localPath; + } + + /** + * Set the localPath property: This path is valid if 'Continuous Capture' is provided with 'true' or 'false' and + * required if no storage ID is provided, otherwise optional. Must include the name of the capture file (*.cap). For + * linux virtual machine it must start with /var/captures. + * + * @param localPath the localPath value to set. + * @return the PacketCaptureStorageLocation object itself. + */ + public PacketCaptureStorageLocation withLocalPath(String localPath) { + this.localPath = localPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageId", this.storageId); + jsonWriter.writeStringField("storagePath", this.storagePath); + jsonWriter.writeStringField("filePath", this.filePath); + jsonWriter.writeStringField("localPath", this.localPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PacketCaptureStorageLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PacketCaptureStorageLocation if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PacketCaptureStorageLocation. + */ + public static PacketCaptureStorageLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PacketCaptureStorageLocation deserializedPacketCaptureStorageLocation = new PacketCaptureStorageLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageId".equals(fieldName)) { + deserializedPacketCaptureStorageLocation.storageId = reader.getString(); + } else if ("storagePath".equals(fieldName)) { + deserializedPacketCaptureStorageLocation.storagePath = reader.getString(); + } else if ("filePath".equals(fieldName)) { + deserializedPacketCaptureStorageLocation.filePath = reader.getString(); + } else if ("localPath".equals(fieldName)) { + deserializedPacketCaptureStorageLocation.localPath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPacketCaptureStorageLocation; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureTargetType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureTargetType.java new file mode 100644 index 0000000000000..b12dc95385696 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptureTargetType.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; + +/** + * Target type of the resource provided. + */ +public enum PacketCaptureTargetType { + /** + * Enum value AzureVM. + */ + AZURE_VM("AzureVM"), + + /** + * Enum value AzureVMSS. + */ + AZURE_VMSS("AzureVMSS"); + + /** + * The actual serialized value for a PacketCaptureTargetType instance. + */ + private final String value; + + PacketCaptureTargetType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PacketCaptureTargetType instance. + * + * @param value the serialized value to parse. + * @return the parsed PacketCaptureTargetType object, or null if unable to parse. + */ + public static PacketCaptureTargetType fromString(String value) { + if (value == null) { + return null; + } + PacketCaptureTargetType[] items = PacketCaptureTargetType.values(); + for (PacketCaptureTargetType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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/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..24e983b6fdcd3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PacketCaptures.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkWatcherName, + String packetCaptureName, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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/Parameter.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Parameter.java new file mode 100644 index 0000000000000..a5a353bb83a0d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Parameter.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for an Action. + */ +@Fluent +public final class Parameter implements JsonSerializable { + /* + * List of route prefixes. + */ + private List routePrefix; + + /* + * List of BGP communities. + */ + private List community; + + /* + * List of AS paths. + */ + private List asPath; + + /** + * Creates an instance of Parameter class. + */ + public Parameter() { + } + + /** + * Get the routePrefix property: List of route prefixes. + * + * @return the routePrefix value. + */ + public List routePrefix() { + return this.routePrefix; + } + + /** + * Set the routePrefix property: List of route prefixes. + * + * @param routePrefix the routePrefix value to set. + * @return the Parameter object itself. + */ + public Parameter withRoutePrefix(List routePrefix) { + this.routePrefix = routePrefix; + return this; + } + + /** + * Get the community property: List of BGP communities. + * + * @return the community value. + */ + public List community() { + return this.community; + } + + /** + * Set the community property: List of BGP communities. + * + * @param community the community value to set. + * @return the Parameter object itself. + */ + public Parameter withCommunity(List community) { + this.community = community; + return this; + } + + /** + * Get the asPath property: List of AS paths. + * + * @return the asPath value. + */ + public List asPath() { + return this.asPath; + } + + /** + * Set the asPath property: List of AS paths. + * + * @param asPath the asPath value to set. + * @return the Parameter object itself. + */ + public Parameter withAsPath(List asPath) { + this.asPath = asPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routePrefix", this.routePrefix, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("community", this.community, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("asPath", this.asPath, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Parameter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Parameter if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Parameter. + */ + public static Parameter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Parameter deserializedParameter = new Parameter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routePrefix".equals(fieldName)) { + List routePrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedParameter.routePrefix = routePrefix; + } else if ("community".equals(fieldName)) { + List community = reader.readArray(reader1 -> reader1.getString()); + deserializedParameter.community = community; + } else if ("asPath".equals(fieldName)) { + List asPath = reader.readArray(reader1 -> reader1.getString()); + deserializedParameter.asPath = asPath; + } else { + reader.skipChildren(); + } + } + + return deserializedParameter; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PartnerManagedResourceProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PartnerManagedResourceProperties.java new file mode 100644 index 0000000000000..66c948f44b486 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PartnerManagedResourceProperties.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the partner managed resource. + */ +@Immutable +public final class PartnerManagedResourceProperties implements JsonSerializable { + /* + * The partner managed resource id. + */ + private String id; + + /* + * The partner managed ILB resource id + */ + private String internalLoadBalancerId; + + /* + * The partner managed SLB resource id + */ + private String standardLoadBalancerId; + + /** + * Creates an instance of PartnerManagedResourceProperties class. + */ + public PartnerManagedResourceProperties() { + } + + /** + * Get the id property: The partner managed resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the internalLoadBalancerId property: The partner managed ILB resource id. + * + * @return the internalLoadBalancerId value. + */ + public String internalLoadBalancerId() { + return this.internalLoadBalancerId; + } + + /** + * Get the standardLoadBalancerId property: The partner managed SLB resource id. + * + * @return the standardLoadBalancerId value. + */ + public String standardLoadBalancerId() { + return this.standardLoadBalancerId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PartnerManagedResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PartnerManagedResourceProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PartnerManagedResourceProperties. + */ + public static PartnerManagedResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PartnerManagedResourceProperties deserializedPartnerManagedResourceProperties + = new PartnerManagedResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPartnerManagedResourceProperties.id = reader.getString(); + } else if ("internalLoadBalancerId".equals(fieldName)) { + deserializedPartnerManagedResourceProperties.internalLoadBalancerId = reader.getString(); + } else if ("standardLoadBalancerId".equals(fieldName)) { + deserializedPartnerManagedResourceProperties.standardLoadBalancerId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPartnerManagedResourceProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PatchObject.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PatchObject.java new file mode 100644 index 0000000000000..bb4407bc884d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PatchObject.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Object for patch operations. + */ +@Fluent +public final class PatchObject implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of PatchObject class. + */ + public PatchObject() { + } + + /** + * 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 PatchObject object itself. + */ + public PatchObject withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchObject if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PatchObject. + */ + public static PatchObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchObject deserializedPatchObject = new PatchObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPatchObject.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedPatchObject; + }); + } +} 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..6d2f94318415a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcError.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.util.ExpandableStringEnum; +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 a new instance of PcError value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PcError() { + } + + /** + * Creates or finds a PcError from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcError. + */ + public static PcError fromString(String name) { + return fromString(name, PcError.class); + } + + /** + * Gets known PcError values. + * + * @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..5f668c0d20448 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol to be filtered on. + */ +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 a new instance of PcProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PcProtocol() { + } + + /** + * Creates or finds a PcProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcProtocol. + */ + public static PcProtocol fromString(String name) { + return fromString(name, PcProtocol.class); + } + + /** + * Gets known PcProtocol values. + * + * @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..c6d4ece21c55b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PcStatus.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the packet capture session. + */ +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 a new instance of PcStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PcStatus() { + } + + /** + * Creates or finds a PcStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PcStatus. + */ + public static PcStatus fromString(String name) { + return fromString(name, PcStatus.class); + } + + /** + * Gets known PcStatus values. + * + * @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..241482c1d3d03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnection.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.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..556a5db6fbd43 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PeerExpressRouteCircuitConnectionInner; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PeerExpressRouteCircuitConnectionListResult class. + */ + public PeerExpressRouteCircuitConnectionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PeerExpressRouteCircuitConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PeerExpressRouteCircuitConnectionListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PeerExpressRouteCircuitConnectionListResult. + */ + public static PeerExpressRouteCircuitConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PeerExpressRouteCircuitConnectionListResult deserializedPeerExpressRouteCircuitConnectionListResult + = new PeerExpressRouteCircuitConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PeerExpressRouteCircuitConnectionInner.fromJson(reader1)); + deserializedPeerExpressRouteCircuitConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPeerExpressRouteCircuitConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPeerExpressRouteCircuitConnectionListResult; + }); + } +} 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..229b306e73173 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerExpressRouteCircuitConnections.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String circuitName, + String peeringName, String connectionName, 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 com.azure.core.management.exception.ManagementException thrown 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 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 as + * paginated response with {@link PagedIterable}. + */ + 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 as + * paginated response with {@link PagedIterable}. + */ + 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..f5a2c139a45d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PeerRoute.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Peer routing details. + */ +@Immutable +public final class PeerRoute implements JsonSerializable { + /* + * The peer's local address. + */ + private String localAddress; + + /* + * The route's network prefix. + */ + private String network; + + /* + * The route's next hop. + */ + private String nextHop; + + /* + * The peer this route was learned from. + */ + private String sourcePeer; + + /* + * The source this route was learned from. + */ + private String origin; + + /* + * The route's AS path sequence. + */ + private String asPath; + + /* + * The route's weight. + */ + private Integer weight; + + /** + * Creates an instance of PeerRoute class. + */ + public PeerRoute() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PeerRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PeerRoute if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PeerRoute. + */ + public static PeerRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PeerRoute deserializedPeerRoute = new PeerRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("localAddress".equals(fieldName)) { + deserializedPeerRoute.localAddress = reader.getString(); + } else if ("network".equals(fieldName)) { + deserializedPeerRoute.network = reader.getString(); + } else if ("nextHop".equals(fieldName)) { + deserializedPeerRoute.nextHop = reader.getString(); + } else if ("sourcePeer".equals(fieldName)) { + deserializedPeerRoute.sourcePeer = reader.getString(); + } else if ("origin".equals(fieldName)) { + deserializedPeerRoute.origin = reader.getString(); + } else if ("asPath".equals(fieldName)) { + deserializedPeerRoute.asPath = reader.getString(); + } else if ("weight".equals(fieldName)) { + deserializedPeerRoute.weight = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPeerRoute; + }); + } +} 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..b6a4863436bff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PfsGroup.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Pfs Groups used in IKE Phase 2 for new child SA. + */ +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 a new instance of PfsGroup value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PfsGroup() { + } + + /** + * Creates or finds a PfsGroup from its string representation. + * + * @param name a name to look for. + * @return the corresponding PfsGroup. + */ + public static PfsGroup fromString(String name) { + return fromString(name, PfsGroup.class); + } + + /** + * Gets known PfsGroup values. + * + * @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..0f9c46e93e66b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettings.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Defines contents of a web application firewall global configuration. + */ +@Fluent +public final class PolicySettings implements JsonSerializable { + /* + * The state of the policy. + */ + private WebApplicationFirewallEnabledState state; + + /* + * The mode of the policy. + */ + private WebApplicationFirewallMode mode; + + /* + * Whether to allow WAF to check request Body. + */ + private Boolean requestBodyCheck; + + /* + * Max inspection limit in KB for request body inspection for WAF. + */ + private Integer requestBodyInspectLimitInKB; + + /* + * Whether allow WAF to enforce request body limits. + */ + private Boolean requestBodyEnforcement; + + /* + * Maximum request body size in Kb for WAF. + */ + private Integer maxRequestBodySizeInKb; + + /* + * Whether allow WAF to enforce file upload limits. + */ + private Boolean fileUploadEnforcement; + + /* + * Maximum file upload size in Mb for WAF. + */ + private Integer fileUploadLimitInMb; + + /* + * If the action type is block, customer can override the response status code. + */ + private Integer customBlockResponseStatusCode; + + /* + * If the action type is block, customer can override the response body. The body must be specified in base64 + * encoding. + */ + private String customBlockResponseBody; + + /* + * To scrub sensitive log fields + */ + private PolicySettingsLogScrubbing logScrubbing; + + /* + * Web Application Firewall JavaScript Challenge Cookie Expiration time in minutes. + */ + private Integer jsChallengeCookieExpirationInMins; + + /** + * Creates an instance of PolicySettings class. + */ + public PolicySettings() { + } + + /** + * 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 requestBodyInspectLimitInKB property: Max inspection limit in KB for request body inspection for WAF. + * + * @return the requestBodyInspectLimitInKB value. + */ + public Integer requestBodyInspectLimitInKB() { + return this.requestBodyInspectLimitInKB; + } + + /** + * Set the requestBodyInspectLimitInKB property: Max inspection limit in KB for request body inspection for WAF. + * + * @param requestBodyInspectLimitInKB the requestBodyInspectLimitInKB value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withRequestBodyInspectLimitInKB(Integer requestBodyInspectLimitInKB) { + this.requestBodyInspectLimitInKB = requestBodyInspectLimitInKB; + return this; + } + + /** + * Get the requestBodyEnforcement property: Whether allow WAF to enforce request body limits. + * + * @return the requestBodyEnforcement value. + */ + public Boolean requestBodyEnforcement() { + return this.requestBodyEnforcement; + } + + /** + * Set the requestBodyEnforcement property: Whether allow WAF to enforce request body limits. + * + * @param requestBodyEnforcement the requestBodyEnforcement value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withRequestBodyEnforcement(Boolean requestBodyEnforcement) { + this.requestBodyEnforcement = requestBodyEnforcement; + 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 fileUploadEnforcement property: Whether allow WAF to enforce file upload limits. + * + * @return the fileUploadEnforcement value. + */ + public Boolean fileUploadEnforcement() { + return this.fileUploadEnforcement; + } + + /** + * Set the fileUploadEnforcement property: Whether allow WAF to enforce file upload limits. + * + * @param fileUploadEnforcement the fileUploadEnforcement value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withFileUploadEnforcement(Boolean fileUploadEnforcement) { + this.fileUploadEnforcement = fileUploadEnforcement; + 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; + } + + /** + * Get the customBlockResponseStatusCode property: If the action type is block, customer can override the response + * status code. + * + * @return the customBlockResponseStatusCode value. + */ + public Integer customBlockResponseStatusCode() { + return this.customBlockResponseStatusCode; + } + + /** + * Set the customBlockResponseStatusCode property: If the action type is block, customer can override the response + * status code. + * + * @param customBlockResponseStatusCode the customBlockResponseStatusCode value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withCustomBlockResponseStatusCode(Integer customBlockResponseStatusCode) { + this.customBlockResponseStatusCode = customBlockResponseStatusCode; + return this; + } + + /** + * Get the customBlockResponseBody property: If the action type is block, customer can override the response body. + * The body must be specified in base64 encoding. + * + * @return the customBlockResponseBody value. + */ + public String customBlockResponseBody() { + return this.customBlockResponseBody; + } + + /** + * Set the customBlockResponseBody property: If the action type is block, customer can override the response body. + * The body must be specified in base64 encoding. + * + * @param customBlockResponseBody the customBlockResponseBody value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withCustomBlockResponseBody(String customBlockResponseBody) { + this.customBlockResponseBody = customBlockResponseBody; + return this; + } + + /** + * Get the logScrubbing property: To scrub sensitive log fields. + * + * @return the logScrubbing value. + */ + public PolicySettingsLogScrubbing logScrubbing() { + return this.logScrubbing; + } + + /** + * Set the logScrubbing property: To scrub sensitive log fields. + * + * @param logScrubbing the logScrubbing value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withLogScrubbing(PolicySettingsLogScrubbing logScrubbing) { + this.logScrubbing = logScrubbing; + return this; + } + + /** + * Get the jsChallengeCookieExpirationInMins property: Web Application Firewall JavaScript Challenge Cookie + * Expiration time in minutes. + * + * @return the jsChallengeCookieExpirationInMins value. + */ + public Integer jsChallengeCookieExpirationInMins() { + return this.jsChallengeCookieExpirationInMins; + } + + /** + * Set the jsChallengeCookieExpirationInMins property: Web Application Firewall JavaScript Challenge Cookie + * Expiration time in minutes. + * + * @param jsChallengeCookieExpirationInMins the jsChallengeCookieExpirationInMins value to set. + * @return the PolicySettings object itself. + */ + public PolicySettings withJsChallengeCookieExpirationInMins(Integer jsChallengeCookieExpirationInMins) { + this.jsChallengeCookieExpirationInMins = jsChallengeCookieExpirationInMins; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logScrubbing() != null) { + logScrubbing().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeBooleanField("requestBodyCheck", this.requestBodyCheck); + jsonWriter.writeNumberField("requestBodyInspectLimitInKB", this.requestBodyInspectLimitInKB); + jsonWriter.writeBooleanField("requestBodyEnforcement", this.requestBodyEnforcement); + jsonWriter.writeNumberField("maxRequestBodySizeInKb", this.maxRequestBodySizeInKb); + jsonWriter.writeBooleanField("fileUploadEnforcement", this.fileUploadEnforcement); + jsonWriter.writeNumberField("fileUploadLimitInMb", this.fileUploadLimitInMb); + jsonWriter.writeNumberField("customBlockResponseStatusCode", this.customBlockResponseStatusCode); + jsonWriter.writeStringField("customBlockResponseBody", this.customBlockResponseBody); + jsonWriter.writeJsonField("logScrubbing", this.logScrubbing); + jsonWriter.writeNumberField("jsChallengeCookieExpirationInMins", this.jsChallengeCookieExpirationInMins); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PolicySettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicySettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PolicySettings. + */ + public static PolicySettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PolicySettings deserializedPolicySettings = new PolicySettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedPolicySettings.state + = WebApplicationFirewallEnabledState.fromString(reader.getString()); + } else if ("mode".equals(fieldName)) { + deserializedPolicySettings.mode = WebApplicationFirewallMode.fromString(reader.getString()); + } else if ("requestBodyCheck".equals(fieldName)) { + deserializedPolicySettings.requestBodyCheck = reader.getNullable(JsonReader::getBoolean); + } else if ("requestBodyInspectLimitInKB".equals(fieldName)) { + deserializedPolicySettings.requestBodyInspectLimitInKB = reader.getNullable(JsonReader::getInt); + } else if ("requestBodyEnforcement".equals(fieldName)) { + deserializedPolicySettings.requestBodyEnforcement = reader.getNullable(JsonReader::getBoolean); + } else if ("maxRequestBodySizeInKb".equals(fieldName)) { + deserializedPolicySettings.maxRequestBodySizeInKb = reader.getNullable(JsonReader::getInt); + } else if ("fileUploadEnforcement".equals(fieldName)) { + deserializedPolicySettings.fileUploadEnforcement = reader.getNullable(JsonReader::getBoolean); + } else if ("fileUploadLimitInMb".equals(fieldName)) { + deserializedPolicySettings.fileUploadLimitInMb = reader.getNullable(JsonReader::getInt); + } else if ("customBlockResponseStatusCode".equals(fieldName)) { + deserializedPolicySettings.customBlockResponseStatusCode = reader.getNullable(JsonReader::getInt); + } else if ("customBlockResponseBody".equals(fieldName)) { + deserializedPolicySettings.customBlockResponseBody = reader.getString(); + } else if ("logScrubbing".equals(fieldName)) { + deserializedPolicySettings.logScrubbing = PolicySettingsLogScrubbing.fromJson(reader); + } else if ("jsChallengeCookieExpirationInMins".equals(fieldName)) { + deserializedPolicySettings.jsChallengeCookieExpirationInMins + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedPolicySettings; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettingsLogScrubbing.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettingsLogScrubbing.java new file mode 100644 index 0000000000000..573eef2dd4888 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PolicySettingsLogScrubbing.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * To scrub sensitive log fields. + */ +@Fluent +public final class PolicySettingsLogScrubbing implements JsonSerializable { + /* + * State of the log scrubbing config. Default value is Enabled. + */ + private WebApplicationFirewallScrubbingState state; + + /* + * The rules that are applied to the logs for scrubbing. + */ + private List scrubbingRules; + + /** + * Creates an instance of PolicySettingsLogScrubbing class. + */ + public PolicySettingsLogScrubbing() { + } + + /** + * Get the state property: State of the log scrubbing config. Default value is Enabled. + * + * @return the state value. + */ + public WebApplicationFirewallScrubbingState state() { + return this.state; + } + + /** + * Set the state property: State of the log scrubbing config. Default value is Enabled. + * + * @param state the state value to set. + * @return the PolicySettingsLogScrubbing object itself. + */ + public PolicySettingsLogScrubbing withState(WebApplicationFirewallScrubbingState state) { + this.state = state; + return this; + } + + /** + * Get the scrubbingRules property: The rules that are applied to the logs for scrubbing. + * + * @return the scrubbingRules value. + */ + public List scrubbingRules() { + return this.scrubbingRules; + } + + /** + * Set the scrubbingRules property: The rules that are applied to the logs for scrubbing. + * + * @param scrubbingRules the scrubbingRules value to set. + * @return the PolicySettingsLogScrubbing object itself. + */ + public PolicySettingsLogScrubbing withScrubbingRules(List scrubbingRules) { + this.scrubbingRules = scrubbingRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scrubbingRules() != null) { + scrubbingRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeArrayField("scrubbingRules", this.scrubbingRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PolicySettingsLogScrubbing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicySettingsLogScrubbing if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PolicySettingsLogScrubbing. + */ + public static PolicySettingsLogScrubbing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PolicySettingsLogScrubbing deserializedPolicySettingsLogScrubbing = new PolicySettingsLogScrubbing(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedPolicySettingsLogScrubbing.state + = WebApplicationFirewallScrubbingState.fromString(reader.getString()); + } else if ("scrubbingRules".equals(fieldName)) { + List scrubbingRules + = reader.readArray(reader1 -> WebApplicationFirewallScrubbingRules.fromJson(reader1)); + deserializedPolicySettingsLogScrubbing.scrubbingRules = scrubbingRules; + } else { + reader.skipChildren(); + } + } + + return deserializedPolicySettingsLogScrubbing; + }); + } +} 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..ed491cdb45954 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredIpVersion.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 java.util.Collection; + +/** + * The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version + * depending on other parameters. + */ +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 a new instance of PreferredIpVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PreferredIpVersion() { + } + + /** + * Creates or finds a PreferredIpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreferredIpVersion. + */ + public static PreferredIpVersion fromString(String name) { + return fromString(name, PreferredIpVersion.class); + } + + /** + * Gets known PreferredIpVersion values. + * + * @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..d3c659c703186 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PreferredRoutingGateway.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The preferred routing gateway types. + */ +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 a new instance of PreferredRoutingGateway value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PreferredRoutingGateway() { + } + + /** + * Creates or finds a PreferredRoutingGateway from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreferredRoutingGateway. + */ + public static PreferredRoutingGateway fromString(String name) { + return fromString(name, PreferredRoutingGateway.class); + } + + /** + * Gets known PreferredRoutingGateway values. + * + * @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..f3a5db7e8d9a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrepareNetworkPoliciesRequest.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Details of PrepareNetworkPolicies for Subnet. + */ +@Fluent +public final class PrepareNetworkPoliciesRequest implements JsonSerializable { + /* + * The name of the service for which subnet is being prepared for. + */ + private String serviceName; + + /* + * A list of NetworkIntentPolicyConfiguration. + */ + private List networkIntentPolicyConfigurations; + + /** + * Creates an instance of PrepareNetworkPoliciesRequest class. + */ + public PrepareNetworkPoliciesRequest() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceName", this.serviceName); + jsonWriter.writeArrayField("networkIntentPolicyConfigurations", this.networkIntentPolicyConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrepareNetworkPoliciesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrepareNetworkPoliciesRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrepareNetworkPoliciesRequest. + */ + public static PrepareNetworkPoliciesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrepareNetworkPoliciesRequest deserializedPrepareNetworkPoliciesRequest + = new PrepareNetworkPoliciesRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedPrepareNetworkPoliciesRequest.serviceName = reader.getString(); + } else if ("networkIntentPolicyConfigurations".equals(fieldName)) { + List networkIntentPolicyConfigurations + = reader.readArray(reader1 -> NetworkIntentPolicyConfiguration.fromJson(reader1)); + deserializedPrepareNetworkPoliciesRequest.networkIntentPolicyConfigurations + = networkIntentPolicyConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedPrepareNetworkPoliciesRequest; + }); + } +} 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..1c89e2bb3779c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneConfig.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZonePropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * PrivateDnsZoneConfig resource. + */ +@Fluent +public final class PrivateDnsZoneConfig implements JsonSerializable { + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * Properties of the private dns zone configuration. + */ + private PrivateDnsZonePropertiesFormat innerProperties; + + /** + * Creates an instance of PrivateDnsZoneConfig class. + */ + public PrivateDnsZoneConfig() { + } + + /** + * 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 innerProperties property: Properties of the private dns zone configuration. + * + * @return the innerProperties value. + */ + private PrivateDnsZonePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * Get the privateDnsZoneId property: The resource id of the private dns zone. + * + * @return the privateDnsZoneId value. + */ + public String privateDnsZoneId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateDnsZonePropertiesFormat(); + } + this.innerProperties().withPrivateDnsZoneId(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.innerProperties() == null ? null : this.innerProperties().recordSets(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateDnsZoneConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateDnsZoneConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateDnsZoneConfig. + */ + public static PrivateDnsZoneConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateDnsZoneConfig deserializedPrivateDnsZoneConfig = new PrivateDnsZoneConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPrivateDnsZoneConfig.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateDnsZoneConfig.innerProperties = PrivateDnsZonePropertiesFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateDnsZoneConfig; + }); + } +} 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..b78f55af6fdde --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroup.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.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..c4f20e0a4a040 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroupListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListPrivateDnsZoneGroups API service call. + */ +@Fluent +public final class PrivateDnsZoneGroupListResult implements JsonSerializable { + /* + * A list of private dns zone group resources in a private endpoint. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PrivateDnsZoneGroupListResult class. + */ + public PrivateDnsZoneGroupListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateDnsZoneGroupListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateDnsZoneGroupListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateDnsZoneGroupListResult. + */ + public static PrivateDnsZoneGroupListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateDnsZoneGroupListResult deserializedPrivateDnsZoneGroupListResult + = new PrivateDnsZoneGroupListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateDnsZoneGroupInner.fromJson(reader1)); + deserializedPrivateDnsZoneGroupListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateDnsZoneGroupListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateDnsZoneGroupListResult; + }); + } +} 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..4fb688ed14d7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateDnsZoneGroups.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..c1785939f2284 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoint.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.models; + +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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 applicationSecurityGroups property: Application security groups in which the private endpoint IP + * configuration is included. + * + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * Gets the ipConfigurations property: A list of IP configurations of the private endpoint. This will be used to map + * to the First Party Service's endpoints. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the customNetworkInterfaceName property: The custom name of the network interface attached to the private + * endpoint. + * + * @return the customNetworkInterfaceName value. + */ + String customNetworkInterfaceName(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithApplicationSecurityGroups, DefinitionStages.WithIpConfigurations, + DefinitionStages.WithCustomNetworkInterfaceName { + /** + * 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); + } + + /** + * The stage of the PrivateEndpoint definition allowing to specify applicationSecurityGroups. + */ + interface WithApplicationSecurityGroups { + /** + * Specifies the applicationSecurityGroups property: Application security groups in which the private + * endpoint IP configuration is included.. + * + * @param applicationSecurityGroups Application security groups in which the private endpoint IP + * configuration is included. + * @return the next definition stage. + */ + WithCreate withApplicationSecurityGroups(List applicationSecurityGroups); + } + + /** + * The stage of the PrivateEndpoint definition allowing to specify ipConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: A list of IP configurations of the private endpoint. This will + * be used to map to the First Party Service's endpoints.. + * + * @param ipConfigurations A list of IP configurations of the private endpoint. This will be used to map to + * the First Party Service's endpoints. + * @return the next definition stage. + */ + WithCreate withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the PrivateEndpoint definition allowing to specify customNetworkInterfaceName. + */ + interface WithCustomNetworkInterfaceName { + /** + * Specifies the customNetworkInterfaceName property: The custom name of the network interface attached to + * the private endpoint.. + * + * @param customNetworkInterfaceName The custom name of the network interface attached to the private + * endpoint. + * @return the next definition stage. + */ + WithCreate withCustomNetworkInterfaceName(String customNetworkInterfaceName); + } + } + + /** + * 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, UpdateStages.WithApplicationSecurityGroups, + UpdateStages.WithIpConfigurations, UpdateStages.WithCustomNetworkInterfaceName { + /** + * 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); + } + + /** + * The stage of the PrivateEndpoint update allowing to specify applicationSecurityGroups. + */ + interface WithApplicationSecurityGroups { + /** + * Specifies the applicationSecurityGroups property: Application security groups in which the private + * endpoint IP configuration is included.. + * + * @param applicationSecurityGroups Application security groups in which the private endpoint IP + * configuration is included. + * @return the next definition stage. + */ + Update withApplicationSecurityGroups(List applicationSecurityGroups); + } + + /** + * The stage of the PrivateEndpoint update allowing to specify ipConfigurations. + */ + interface WithIpConfigurations { + /** + * Specifies the ipConfigurations property: A list of IP configurations of the private endpoint. This will + * be used to map to the First Party Service's endpoints.. + * + * @param ipConfigurations A list of IP configurations of the private endpoint. This will be used to map to + * the First Party Service's endpoints. + * @return the next definition stage. + */ + Update withIpConfigurations(List ipConfigurations); + } + + /** + * The stage of the PrivateEndpoint update allowing to specify customNetworkInterfaceName. + */ + interface WithCustomNetworkInterfaceName { + /** + * Specifies the customNetworkInterfaceName property: The custom name of the network interface attached to + * the private endpoint.. + * + * @param customNetworkInterfaceName The custom name of the network interface attached to the private + * endpoint. + * @return the next definition stage. + */ + Update withCustomNetworkInterfaceName(String customNetworkInterfaceName); + } + } + + /** + * 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..0d1969140dafe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnection.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.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 privateEndpointLocation property: The location of the private endpoint. + * + * @return the privateEndpointLocation value. + */ + String privateEndpointLocation(); + + /** + * 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..894f6bc34c42a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListPrivateEndpointConnection API service call. + */ +@Fluent +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * A list of PrivateEndpointConnection resources for a specific private link service. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ + public PrivateEndpointConnectionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..38854502449e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointConnectionProperties.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.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionPropertiesInner; + +/** + * An immutable client-side representation of PrivateEndpointConnectionProperties. + */ +public interface PrivateEndpointConnectionProperties { + /** + * 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 privateEndpointLocation property: The location of the private endpoint. + * + * @return the privateEndpointLocation value. + */ + String privateEndpointLocation(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionPropertiesInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionPropertiesInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointIpConfiguration.java new file mode 100644 index 0000000000000..993a462cdf7ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointIpConfiguration.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointIpConfigurationProperties; +import java.io.IOException; + +/** + * An IP Configuration of the private endpoint. + */ +@Fluent +public final class PrivateEndpointIpConfiguration implements JsonSerializable { + /* + * Properties of private endpoint IP configurations. + */ + private PrivateEndpointIpConfigurationProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. + */ + private String name; + + /* + * The resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of PrivateEndpointIpConfiguration class. + */ + public PrivateEndpointIpConfiguration() { + } + + /** + * Get the innerProperties property: Properties of private endpoint IP configurations. + * + * @return the innerProperties value. + */ + private PrivateEndpointIpConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the name property: The name of the resource that is unique within a resource group. + * + * @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. + * + * @param name the name value to set. + * @return the PrivateEndpointIpConfiguration object itself. + */ + public PrivateEndpointIpConfiguration 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 groupId property: The ID of a group obtained from the remote resource that this private endpoint should + * connect to. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Set the groupId property: The ID of a group obtained from the remote resource that this private endpoint should + * connect to. + * + * @param groupId the groupId value to set. + * @return the PrivateEndpointIpConfiguration object itself. + */ + public PrivateEndpointIpConfiguration withGroupId(String groupId) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointIpConfigurationProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * Get the memberName property: The member name of a group obtained from the remote resource that this private + * endpoint should connect to. + * + * @return the memberName value. + */ + public String memberName() { + return this.innerProperties() == null ? null : this.innerProperties().memberName(); + } + + /** + * Set the memberName property: The member name of a group obtained from the remote resource that this private + * endpoint should connect to. + * + * @param memberName the memberName value to set. + * @return the PrivateEndpointIpConfiguration object itself. + */ + public PrivateEndpointIpConfiguration withMemberName(String memberName) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointIpConfigurationProperties(); + } + this.innerProperties().withMemberName(memberName); + return this; + } + + /** + * Get the privateIpAddress property: A private ip address obtained from the private endpoint's subnet. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().privateIpAddress(); + } + + /** + * Set the privateIpAddress property: A private ip address obtained from the private endpoint's subnet. + * + * @param privateIpAddress the privateIpAddress value to set. + * @return the PrivateEndpointIpConfiguration object itself. + */ + public PrivateEndpointIpConfiguration withPrivateIpAddress(String privateIpAddress) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointIpConfigurationProperties(); + } + this.innerProperties().withPrivateIpAddress(privateIpAddress); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointIpConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointIpConfiguration. + */ + public static PrivateEndpointIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointIpConfiguration deserializedPrivateEndpointIpConfiguration + = new PrivateEndpointIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedPrivateEndpointIpConfiguration.innerProperties + = PrivateEndpointIpConfigurationProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointIpConfiguration.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointIpConfiguration.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPrivateEndpointIpConfiguration.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointIpConfiguration; + }); + } +} 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..f2205e1de15e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListPrivateEndpoints API service call. + */ +@Fluent +public final class PrivateEndpointListResult implements JsonSerializable { + /* + * A list of private endpoint resources in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointListResult class. + */ + public PrivateEndpointListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointListResult. + */ + public static PrivateEndpointListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointListResult deserializedPrivateEndpointListResult = new PrivateEndpointListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointInner.fromJson(reader1)); + deserializedPrivateEndpointListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointProperties.java new file mode 100644 index 0000000000000..0af6d9a392398 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointProperties.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.PrivateEndpointPropertiesInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateEndpointProperties. + */ +public interface PrivateEndpointProperties { + /** + * 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 applicationSecurityGroups property: Application security groups in which the private endpoint IP + * configuration is included. + * + * @return the applicationSecurityGroups value. + */ + List applicationSecurityGroups(); + + /** + * Gets the ipConfigurations property: A list of IP configurations of the private endpoint. This will be used to map + * to the First Party Service's endpoints. + * + * @return the ipConfigurations value. + */ + List ipConfigurations(); + + /** + * Gets the customNetworkInterfaceName property: The custom name of the network interface attached to the private + * endpoint. + * + * @return the customNetworkInterfaceName value. + */ + String customNetworkInterfaceName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointPropertiesInner object. + * + * @return the inner object. + */ + PrivateEndpointPropertiesInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointVNetPolicies.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointVNetPolicies.java new file mode 100644 index 0000000000000..d0fe742738d85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpointVNetPolicies.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Private Endpoint VNet Policies. + */ +public final class PrivateEndpointVNetPolicies extends ExpandableStringEnum { + /** + * Static value Disabled for PrivateEndpointVNetPolicies. + */ + public static final PrivateEndpointVNetPolicies DISABLED = fromString("Disabled"); + + /** + * Static value Basic for PrivateEndpointVNetPolicies. + */ + public static final PrivateEndpointVNetPolicies BASIC = fromString("Basic"); + + /** + * Creates a new instance of PrivateEndpointVNetPolicies value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointVNetPolicies() { + } + + /** + * Creates or finds a PrivateEndpointVNetPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointVNetPolicies. + */ + public static PrivateEndpointVNetPolicies fromString(String name) { + return fromString(name, PrivateEndpointVNetPolicies.class); + } + + /** + * Gets known PrivateEndpointVNetPolicies values. + * + * @return known PrivateEndpointVNetPolicies values. + */ + public static Collection values() { + return values(PrivateEndpointVNetPolicies.class); + } +} 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..6587e6845b973 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateEndpoints.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 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String privateEndpointName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..a2a66d15db8b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkService.java @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 destinationIpAddress property: The destination IP address of the private link service. + * + * @return the destinationIpAddress value. + */ + String destinationIpAddress(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithDestinationIpAddress, 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 destinationIpAddress. + */ + interface WithDestinationIpAddress { + /** + * Specifies the destinationIpAddress property: The destination IP address of the private link service.. + * + * @param destinationIpAddress The destination IP address of the private link service. + * @return the next definition stage. + */ + WithCreate withDestinationIpAddress(String destinationIpAddress); + } + + /** + * 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.WithDestinationIpAddress, 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 destinationIpAddress. + */ + interface WithDestinationIpAddress { + /** + * Specifies the destinationIpAddress property: The destination IP address of the private link service.. + * + * @param destinationIpAddress The destination IP address of the private link service. + * @return the next definition stage. + */ + Update withDestinationIpAddress(String destinationIpAddress); + } + + /** + * 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..9a8b596a31be0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnection.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceConnectionProperties; +import java.io.IOException; +import java.util.List; + +/** + * PrivateLinkServiceConnection resource. + */ +@Fluent +public final class PrivateLinkServiceConnection extends SubResource { + /* + * Properties of the private link service connection. + */ + private PrivateLinkServiceConnectionProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * The resource type. + */ + private String type; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of PrivateLinkServiceConnection class. + */ + public PrivateLinkServiceConnection() { + } + + /** + * Get the innerProperties property: Properties of the private link service connection. + * + * @return the innerProperties value. + */ + private PrivateLinkServiceConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateLinkServiceConnection withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private link service connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateLinkServiceId property: The resource id of private link service. + * + * @return the privateLinkServiceId value. + */ + public String privateLinkServiceId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceConnectionProperties(); + } + this.innerProperties().withGroupIds(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceConnectionProperties(); + } + this.innerProperties().withRequestMessage(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkServiceConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnection if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnection. + */ + public static PrivateLinkServiceConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnection deserializedPrivateLinkServiceConnection = new PrivateLinkServiceConnection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkServiceConnection.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkServiceConnection.innerProperties + = PrivateLinkServiceConnectionProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkServiceConnection.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkServiceConnection.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPrivateLinkServiceConnection.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnection; + }); + } +} 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..8de62c0322531 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceConnectionState.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private String status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionsRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} 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..3c84fdce13063 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfiguration.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.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/PrivateLinkServiceIpConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfigurationProperties.java new file mode 100644 index 0000000000000..e44e5024cf6ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceIpConfigurationProperties.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.resourcemanager.network.generated.fluent.models.PrivateLinkServiceIpConfigurationPropertiesInner; + +/** + * An immutable client-side representation of PrivateLinkServiceIpConfigurationProperties. + */ +public interface PrivateLinkServiceIpConfigurationProperties { + /** + * 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.PrivateLinkServiceIpConfigurationPropertiesInner + * object. + * + * @return the inner object. + */ + PrivateLinkServiceIpConfigurationPropertiesInner 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..0eec2dacce09c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PrivateLinkServiceInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListPrivateLinkService API service call. + */ +@Fluent +public final class PrivateLinkServiceListResult implements JsonSerializable { + /* + * A list of PrivateLinkService resources in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PrivateLinkServiceListResult class. + */ + public PrivateLinkServiceListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceListResult. + */ + public static PrivateLinkServiceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceListResult deserializedPrivateLinkServiceListResult = new PrivateLinkServiceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkServiceInner.fromJson(reader1)); + deserializedPrivateLinkServiceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkServiceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceListResult; + }); + } +} 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..1d72de5c83901 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesAutoApproval.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The auto-approval list of the private link service. + */ +@Fluent +public final class PrivateLinkServicePropertiesAutoApproval extends ResourceSet { + /** + * Creates an instance of PrivateLinkServicePropertiesAutoApproval class. + */ + public PrivateLinkServicePropertiesAutoApproval() { + } + + /** + * {@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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("subscriptions", subscriptions(), (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServicePropertiesAutoApproval from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServicePropertiesAutoApproval if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServicePropertiesAutoApproval. + */ + public static PrivateLinkServicePropertiesAutoApproval fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServicePropertiesAutoApproval deserializedPrivateLinkServicePropertiesAutoApproval + = new PrivateLinkServicePropertiesAutoApproval(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptions".equals(fieldName)) { + List subscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkServicePropertiesAutoApproval.withSubscriptions(subscriptions); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServicePropertiesAutoApproval; + }); + } +} 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..e8e0da9ab4869 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServicePropertiesVisibility.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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The visibility list of the private link service. + */ +@Fluent +public final class PrivateLinkServicePropertiesVisibility extends ResourceSet { + /** + * Creates an instance of PrivateLinkServicePropertiesVisibility class. + */ + public PrivateLinkServicePropertiesVisibility() { + } + + /** + * {@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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("subscriptions", subscriptions(), (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServicePropertiesVisibility from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServicePropertiesVisibility if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServicePropertiesVisibility. + */ + public static PrivateLinkServicePropertiesVisibility fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServicePropertiesVisibility deserializedPrivateLinkServicePropertiesVisibility + = new PrivateLinkServicePropertiesVisibility(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptions".equals(fieldName)) { + List subscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkServicePropertiesVisibility.withSubscriptions(subscriptions); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServicePropertiesVisibility; + }); + } +} 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..32c771eacb5d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServiceVisibility.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.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..fa92df38bdea1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PrivateLinkServices.java @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String serviceName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along + * with {@link Response}. + */ + Response getPrivateEndpointConnectionWithResponse(String resourceGroupName, + String serviceName, String peConnectionName, String expand, 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); + + /** + * 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 along with {@link Response}. + */ + Response updatePrivateEndpointConnectionWithResponse(String resourceGroupName, + String serviceName, String peConnectionName, PrivateEndpointConnectionInner parameters, 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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as + * paginated response with {@link PagedIterable}. + */ + 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 as + * paginated response with {@link PagedIterable}. + */ + 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 as + * paginated response with {@link PagedIterable}. + */ + 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 as + * paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..8df211dc51560 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Probe.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.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. + */ + int 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 noHealthyBackendsBehavior property: Determines how new connections are handled by the load balancer when + * all backend instances are probed down. + * + * @return the noHealthyBackendsBehavior value. + */ + ProbeNoHealthyBackendsBehavior noHealthyBackendsBehavior(); + + /** + * 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 probeThreshold property: The number of consecutive successful or failed probes in order to allow or deny + * traffic from being delivered to this endpoint. After failing the number of consecutive probes equal to this + * value, the endpoint will be taken out of rotation and require the same number of successful consecutive probes to + * be placed back in rotation. + * + * @return the probeThreshold value. + */ + Integer probeThreshold(); + + /** + * 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/ProbeNoHealthyBackendsBehavior.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeNoHealthyBackendsBehavior.java new file mode 100644 index 0000000000000..bf1c6929ce005 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeNoHealthyBackendsBehavior.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Determines how new connections are handled by the load balancer when all backend instances are probed down. + */ +public final class ProbeNoHealthyBackendsBehavior extends ExpandableStringEnum { + /** + * Static value AllProbedDown for ProbeNoHealthyBackendsBehavior. + */ + public static final ProbeNoHealthyBackendsBehavior ALL_PROBED_DOWN = fromString("AllProbedDown"); + + /** + * Static value AllProbedUp for ProbeNoHealthyBackendsBehavior. + */ + public static final ProbeNoHealthyBackendsBehavior ALL_PROBED_UP = fromString("AllProbedUp"); + + /** + * Creates a new instance of ProbeNoHealthyBackendsBehavior value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProbeNoHealthyBackendsBehavior() { + } + + /** + * Creates or finds a ProbeNoHealthyBackendsBehavior from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProbeNoHealthyBackendsBehavior. + */ + public static ProbeNoHealthyBackendsBehavior fromString(String name) { + return fromString(name, ProbeNoHealthyBackendsBehavior.class); + } + + /** + * Gets known ProbeNoHealthyBackendsBehavior values. + * + * @return known ProbeNoHealthyBackendsBehavior values. + */ + public static Collection values() { + return values(ProbeNoHealthyBackendsBehavior.class); + } +} 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..87a7e58599cf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProbeProtocol.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * 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. + */ +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 a new instance of ProbeProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProbeProtocol() { + } + + /** + * Creates or finds a ProbeProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProbeProtocol. + */ + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** + * Gets known ProbeProtocol values. + * + * @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..07e90eb890ee7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProcessorArchitecture.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VPN client Processor Architecture. + */ +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 a new instance of ProcessorArchitecture value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProcessorArchitecture() { + } + + /** + * Creates or finds a ProcessorArchitecture from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProcessorArchitecture. + */ + public static ProcessorArchitecture fromString(String name) { + return fromString(name, ProcessorArchitecture.class); + } + + /** + * Gets known ProcessorArchitecture values. + * + * @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..cc881af524b1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PropagatedRouteTable.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The list of RouteTables to advertise the routes to. + */ +@Fluent +public final class PropagatedRouteTable implements JsonSerializable { + /* + * The list of labels. + */ + private List labels; + + /* + * The list of resource ids of all the RouteTables. + */ + private List ids; + + /** + * Creates an instance of PropagatedRouteTable class. + */ + public PropagatedRouteTable() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("labels", this.labels, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("ids", this.ids, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PropagatedRouteTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PropagatedRouteTable if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the PropagatedRouteTable. + */ + public static PropagatedRouteTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PropagatedRouteTable deserializedPropagatedRouteTable = new PropagatedRouteTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("labels".equals(fieldName)) { + List labels = reader.readArray(reader1 -> reader1.getString()); + deserializedPropagatedRouteTable.labels = labels; + } else if ("ids".equals(fieldName)) { + List ids = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedPropagatedRouteTable.ids = ids; + } else { + reader.skipChildren(); + } + } + + return deserializedPropagatedRouteTable; + }); + } +} 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..b058a074eab78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Protocol.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 java.util.Collection; + +/** + * Network 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 a new instance of Protocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Protocol() { + } + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * Gets known Protocol values. + * + * @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..84803a15f7b5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolConfiguration.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration of the protocol. + */ +@Fluent +public final class ProtocolConfiguration implements JsonSerializable { + /* + * HTTP configuration of the connectivity check. + */ + private HttpConfiguration httpConfiguration; + + /** + * Creates an instance of ProtocolConfiguration class. + */ + public ProtocolConfiguration() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("HTTPConfiguration", this.httpConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProtocolConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtocolConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProtocolConfiguration. + */ + public static ProtocolConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtocolConfiguration deserializedProtocolConfiguration = new ProtocolConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("HTTPConfiguration".equals(fieldName)) { + deserializedProtocolConfiguration.httpConfiguration = HttpConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProtocolConfiguration; + }); + } +} 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..80079636be66e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProtocolType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * RNM supported protocol types. + */ +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 a new instance of ProtocolType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProtocolType() { + } + + /** + * Creates or finds a ProtocolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProtocolType. + */ + public static ProtocolType fromString(String name) { + return fromString(name, ProtocolType.class); + } + + /** + * Gets known ProtocolType values. + * + * @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..917476de9f5e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ProvisioningState.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 java.util.Collection; + +/** + * The current provisioning state. + */ +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 a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @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..2292a076629bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddress.java @@ -0,0 +1,609 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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); + + /** + * Gets the Ddos Protection Status of a Public IP Address. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of a Public IP Address. + */ + PublicIpDdosProtectionStatusResult ddosProtectionStatus(); + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address. + */ + PublicIpDdosProtectionStatusResult ddosProtectionStatus(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..97f5ad31b4437 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettings.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Contains FQDN of the DNS record associated with the public IP address. + */ +@Fluent +public final class PublicIpAddressDnsSettings implements JsonSerializable { + /* + * 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. + */ + private String domainNameLabel; + + /* + * The domain name label scope. If a domain name label and a domain name label scope are specified, an A DNS record + * is created for the public IP in the Microsoft Azure DNS system with a hashed value includes in FQDN. + */ + private PublicIpAddressDnsSettingsDomainNameLabelScope domainNameLabelScope; + + /* + * 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. + */ + 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. + */ + private String reverseFqdn; + + /** + * Creates an instance of PublicIpAddressDnsSettings class. + */ + public PublicIpAddressDnsSettings() { + } + + /** + * 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 domainNameLabelScope property: The domain name label scope. If a domain name label and a domain name + * label scope are specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system with a + * hashed value includes in FQDN. + * + * @return the domainNameLabelScope value. + */ + public PublicIpAddressDnsSettingsDomainNameLabelScope domainNameLabelScope() { + return this.domainNameLabelScope; + } + + /** + * Set the domainNameLabelScope property: The domain name label scope. If a domain name label and a domain name + * label scope are specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system with a + * hashed value includes in FQDN. + * + * @param domainNameLabelScope the domainNameLabelScope value to set. + * @return the PublicIpAddressDnsSettings object itself. + */ + public PublicIpAddressDnsSettings + withDomainNameLabelScope(PublicIpAddressDnsSettingsDomainNameLabelScope domainNameLabelScope) { + this.domainNameLabelScope = domainNameLabelScope; + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domainNameLabel", this.domainNameLabel); + jsonWriter.writeStringField("domainNameLabelScope", + this.domainNameLabelScope == null ? null : this.domainNameLabelScope.toString()); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeStringField("reverseFqdn", this.reverseFqdn); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpAddressDnsSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpAddressDnsSettings if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpAddressDnsSettings. + */ + public static PublicIpAddressDnsSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpAddressDnsSettings deserializedPublicIpAddressDnsSettings = new PublicIpAddressDnsSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainNameLabel".equals(fieldName)) { + deserializedPublicIpAddressDnsSettings.domainNameLabel = reader.getString(); + } else if ("domainNameLabelScope".equals(fieldName)) { + deserializedPublicIpAddressDnsSettings.domainNameLabelScope + = PublicIpAddressDnsSettingsDomainNameLabelScope.fromString(reader.getString()); + } else if ("fqdn".equals(fieldName)) { + deserializedPublicIpAddressDnsSettings.fqdn = reader.getString(); + } else if ("reverseFqdn".equals(fieldName)) { + deserializedPublicIpAddressDnsSettings.reverseFqdn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpAddressDnsSettings; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettingsDomainNameLabelScope.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettingsDomainNameLabelScope.java new file mode 100644 index 0000000000000..ca7e3bd074bb8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressDnsSettingsDomainNameLabelScope.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; + +/** + * The domain name label scope. If a domain name label and a domain name label scope are specified, an A DNS record is + * created for the public IP in the Microsoft Azure DNS system with a hashed value includes in FQDN. + */ +public enum PublicIpAddressDnsSettingsDomainNameLabelScope { + /** + * Enum value TenantReuse. + */ + TENANT_REUSE("TenantReuse"), + + /** + * Enum value SubscriptionReuse. + */ + SUBSCRIPTION_REUSE("SubscriptionReuse"), + + /** + * Enum value ResourceGroupReuse. + */ + RESOURCE_GROUP_REUSE("ResourceGroupReuse"), + + /** + * Enum value NoReuse. + */ + NO_REUSE("NoReuse"); + + /** + * The actual serialized value for a PublicIpAddressDnsSettingsDomainNameLabelScope instance. + */ + private final String value; + + PublicIpAddressDnsSettingsDomainNameLabelScope(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PublicIpAddressDnsSettingsDomainNameLabelScope instance. + * + * @param value the serialized value to parse. + * @return the parsed PublicIpAddressDnsSettingsDomainNameLabelScope object, or null if unable to parse. + */ + public static PublicIpAddressDnsSettingsDomainNameLabelScope fromString(String value) { + if (value == null) { + return null; + } + PublicIpAddressDnsSettingsDomainNameLabelScope[] items + = PublicIpAddressDnsSettingsDomainNameLabelScope.values(); + for (PublicIpAddressDnsSettingsDomainNameLabelScope item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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/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..aaf77fcd4943b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListPublicIpAddresses API service call. + */ +@Fluent +public final class PublicIpAddressListResult implements JsonSerializable { + /* + * A list of public IP addresses that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PublicIpAddressListResult class. + */ + public PublicIpAddressListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpAddressListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpAddressListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpAddressListResult. + */ + public static PublicIpAddressListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpAddressListResult deserializedPublicIpAddressListResult = new PublicIpAddressListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PublicIpAddressInner.fromJson(reader1)); + deserializedPublicIpAddressListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPublicIpAddressListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpAddressListResult; + }); + } +} 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..9d46b13a35880 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressMigrationPhase.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Migration phase of Public IP Address. + */ +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 a new instance of PublicIpAddressMigrationPhase value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAddressMigrationPhase() { + } + + /** + * Creates or finds a PublicIpAddressMigrationPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressMigrationPhase. + */ + public static PublicIpAddressMigrationPhase fromString(String name) { + return fromString(name, PublicIpAddressMigrationPhase.class); + } + + /** + * Gets known PublicIpAddressMigrationPhase values. + * + * @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/PublicIpAddressPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressPropertiesFormat.java new file mode 100644 index 0000000000000..93441a10f2c5c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressPropertiesFormat.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.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of PublicIpAddressPropertiesFormat. + */ +public interface PublicIpAddressPropertiesFormat { + /** + * 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 inner com.azure.resourcemanager.network.generated.fluent.models.PublicIpAddressPropertiesFormatInner + * object. + * + * @return the inner object. + */ + PublicIpAddressPropertiesFormatInner innerModel(); +} 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..708b5f5cc9ff2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSku.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU of a public IP address. + */ +@Fluent +public final class PublicIpAddressSku implements JsonSerializable { + /* + * Name of a public IP address SKU. + */ + private PublicIpAddressSkuName name; + + /* + * Tier of a public IP address SKU. + */ + private PublicIpAddressSkuTier tier; + + /** + * Creates an instance of PublicIpAddressSku class. + */ + public PublicIpAddressSku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpAddressSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpAddressSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpAddressSku. + */ + public static PublicIpAddressSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpAddressSku deserializedPublicIpAddressSku = new PublicIpAddressSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPublicIpAddressSku.name = PublicIpAddressSkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedPublicIpAddressSku.tier = PublicIpAddressSkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpAddressSku; + }); + } +} 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..cd1fb0adbc09d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuName.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Name of a public IP address SKU. + */ +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 a new instance of PublicIpAddressSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAddressSkuName() { + } + + /** + * Creates or finds a PublicIpAddressSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuName. + */ + public static PublicIpAddressSkuName fromString(String name) { + return fromString(name, PublicIpAddressSkuName.class); + } + + /** + * Gets known PublicIpAddressSkuName values. + * + * @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..deb44ff29e593 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddressSkuTier.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tier of a public IP address SKU. + */ +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 a new instance of PublicIpAddressSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpAddressSkuTier() { + } + + /** + * Creates or finds a PublicIpAddressSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpAddressSkuTier. + */ + public static PublicIpAddressSkuTier fromString(String name) { + return fromString(name, PublicIpAddressSkuTier.class); + } + + /** + * Gets known PublicIpAddressSkuTier values. + * + * @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..d3a23a570bda1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpAddresses.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as + * paginated response with {@link PagedIterable}. + */ + 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 as + * paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getCloudServicePublicIpAddressWithResponse(String resourceGroupName, + String cloudServiceName, String roleInstanceName, String networkInterfaceName, String ipConfigurationName, + String publicIpAddressName, String expand, 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); + + /** + * 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String publicIpAddressName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address. + */ + PublicIpDdosProtectionStatusResult ddosProtectionStatus(String resourceGroupName, String publicIpAddressName); + + /** + * Gets the Ddos Protection Status of a 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 Ddos Protection Status of a Public IP Address. + */ + PublicIpDdosProtectionStatusResult ddosProtectionStatus(String resourceGroupName, String publicIpAddressName, + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + Response getVirtualMachineScaleSetPublicIpAddressWithResponse(String resourceGroupName, + String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, + String ipConfigurationName, String publicIpAddressName, String expand, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/PublicIpDdosProtectionStatusResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpDdosProtectionStatusResult.java new file mode 100644 index 0000000000000..ea552a1ce6462 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpDdosProtectionStatusResult.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.resourcemanager.network.generated.fluent.models.PublicIpDdosProtectionStatusResultInner; + +/** + * An immutable client-side representation of PublicIpDdosProtectionStatusResult. + */ +public interface PublicIpDdosProtectionStatusResult { + /** + * Gets the publicIpAddressId property: Public IP ARM resource ID. + * + * @return the publicIpAddressId value. + */ + String publicIpAddressId(); + + /** + * Gets the publicIpAddress property: IP Address of the Public IP Resource. + * + * @return the publicIpAddress value. + */ + String publicIpAddress(); + + /** + * Gets the isWorkloadProtected property: Value indicating whether the IP address is DDoS workload protected or not. + * + * @return the isWorkloadProtected value. + */ + IsWorkloadProtected isWorkloadProtected(); + + /** + * Gets the ddosProtectionPlanId property: DDoS protection plan Resource Id of a if IP address is protected through + * a plan. + * + * @return the ddosProtectionPlanId value. + */ + String ddosProtectionPlanId(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.PublicIpDdosProtectionStatusResultInner + * object. + * + * @return the inner object. + */ + PublicIpDdosProtectionStatusResultInner innerModel(); +} 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..8e822e801fc22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefix.java @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..7a5dd97769b5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListPublicIpPrefixes API service call. + */ +@Fluent +public final class PublicIpPrefixListResult implements JsonSerializable { + /* + * A list of public IP prefixes that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of PublicIpPrefixListResult class. + */ + public PublicIpPrefixListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpPrefixListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpPrefixListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpPrefixListResult. + */ + public static PublicIpPrefixListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpPrefixListResult deserializedPublicIpPrefixListResult = new PublicIpPrefixListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PublicIpPrefixInner.fromJson(reader1)); + deserializedPublicIpPrefixListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPublicIpPrefixListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpPrefixListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixPropertiesFormat.java new file mode 100644 index 0000000000000..7d6e9653e7fd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixPropertiesFormat.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.PublicIpPrefixPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of PublicIpPrefixPropertiesFormat. + */ +public interface PublicIpPrefixPropertiesFormat { + /** + * 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 inner com.azure.resourcemanager.network.generated.fluent.models.PublicIpPrefixPropertiesFormatInner + * object. + * + * @return the inner object. + */ + PublicIpPrefixPropertiesFormatInner innerModel(); +} 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..b5441da2e84ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSku.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * SKU of a public IP prefix. + */ +@Fluent +public final class PublicIpPrefixSku implements JsonSerializable { + /* + * Name of a public IP prefix SKU. + */ + private PublicIpPrefixSkuName name; + + /* + * Tier of a public IP prefix SKU. + */ + private PublicIpPrefixSkuTier tier; + + /** + * Creates an instance of PublicIpPrefixSku class. + */ + public PublicIpPrefixSku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicIpPrefixSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicIpPrefixSku if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PublicIpPrefixSku. + */ + public static PublicIpPrefixSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicIpPrefixSku deserializedPublicIpPrefixSku = new PublicIpPrefixSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPublicIpPrefixSku.name = PublicIpPrefixSkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedPublicIpPrefixSku.tier = PublicIpPrefixSkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicIpPrefixSku; + }); + } +} 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..fcca2272951fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuName.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 java.util.Collection; + +/** + * Name of a public IP prefix SKU. + */ +public final class PublicIpPrefixSkuName extends ExpandableStringEnum { + /** + * Static value Standard for PublicIpPrefixSkuName. + */ + public static final PublicIpPrefixSkuName STANDARD = fromString("Standard"); + + /** + * Creates a new instance of PublicIpPrefixSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpPrefixSkuName() { + } + + /** + * Creates or finds a PublicIpPrefixSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpPrefixSkuName. + */ + public static PublicIpPrefixSkuName fromString(String name) { + return fromString(name, PublicIpPrefixSkuName.class); + } + + /** + * Gets known PublicIpPrefixSkuName values. + * + * @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..55c1f30b92993 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixSkuTier.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Tier of a public IP prefix SKU. + */ +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 a new instance of PublicIpPrefixSkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicIpPrefixSkuTier() { + } + + /** + * Creates or finds a PublicIpPrefixSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicIpPrefixSkuTier. + */ + public static PublicIpPrefixSkuTier fromString(String name) { + return fromString(name, PublicIpPrefixSkuTier.class); + } + + /** + * Gets known PublicIpPrefixSkuTier values. + * + * @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..c2ffcf6fc7869 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/PublicIpPrefixes.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String publicIpPrefixName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/QosDefinition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosDefinition.java new file mode 100644 index 0000000000000..175f7f1dead2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosDefinition.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Quality of Service defines the traffic configuration between endpoints. Mandatory to have one marking. + */ +@Fluent +public final class QosDefinition implements JsonSerializable { + /* + * List of markings to be used in the configuration. + */ + private List markings; + + /* + * Source IP ranges. + */ + private List sourceIpRanges; + + /* + * Destination IP ranges. + */ + private List destinationIpRanges; + + /* + * Sources port ranges. + */ + private List sourcePortRanges; + + /* + * Destination port ranges. + */ + private List destinationPortRanges; + + /* + * RNM supported protocol types. + */ + private ProtocolType protocol; + + /** + * Creates an instance of QosDefinition class. + */ + public QosDefinition() { + } + + /** + * 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 QosDefinition object itself. + */ + public QosDefinition 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 QosDefinition object itself. + */ + public QosDefinition 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 QosDefinition object itself. + */ + public QosDefinition 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 QosDefinition object itself. + */ + public QosDefinition 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 QosDefinition object itself. + */ + public QosDefinition 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 QosDefinition object itself. + */ + public QosDefinition withProtocol(ProtocolType protocol) { + this.protocol = protocol; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("markings", this.markings, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeArrayField("sourceIpRanges", this.sourceIpRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("destinationIpRanges", this.destinationIpRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sourcePortRanges", this.sourcePortRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("destinationPortRanges", this.destinationPortRanges, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QosDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QosDefinition if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QosDefinition. + */ + public static QosDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QosDefinition deserializedQosDefinition = new QosDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("markings".equals(fieldName)) { + List markings = reader.readArray(reader1 -> reader1.getInt()); + deserializedQosDefinition.markings = markings; + } else if ("sourceIpRanges".equals(fieldName)) { + List sourceIpRanges = reader.readArray(reader1 -> QosIpRange.fromJson(reader1)); + deserializedQosDefinition.sourceIpRanges = sourceIpRanges; + } else if ("destinationIpRanges".equals(fieldName)) { + List destinationIpRanges = reader.readArray(reader1 -> QosIpRange.fromJson(reader1)); + deserializedQosDefinition.destinationIpRanges = destinationIpRanges; + } else if ("sourcePortRanges".equals(fieldName)) { + List sourcePortRanges = reader.readArray(reader1 -> QosPortRange.fromJson(reader1)); + deserializedQosDefinition.sourcePortRanges = sourcePortRanges; + } else if ("destinationPortRanges".equals(fieldName)) { + List destinationPortRanges + = reader.readArray(reader1 -> QosPortRange.fromJson(reader1)); + deserializedQosDefinition.destinationPortRanges = destinationPortRanges; + } else if ("protocol".equals(fieldName)) { + deserializedQosDefinition.protocol = ProtocolType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedQosDefinition; + }); + } +} 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..f910196a44047 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosIpRange.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Qos Traffic Profiler IP Range properties. + */ +@Fluent +public final class QosIpRange implements JsonSerializable { + /* + * Start IP Address. + */ + private String startIp; + + /* + * End IP Address. + */ + private String endIp; + + /** + * Creates an instance of QosIpRange class. + */ + public QosIpRange() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startIP", this.startIp); + jsonWriter.writeStringField("endIP", this.endIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QosIpRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QosIpRange if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the QosIpRange. + */ + public static QosIpRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QosIpRange deserializedQosIpRange = new QosIpRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startIP".equals(fieldName)) { + deserializedQosIpRange.startIp = reader.getString(); + } else if ("endIP".equals(fieldName)) { + deserializedQosIpRange.endIp = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQosIpRange; + }); + } +} 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..67f08a441c720 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QosPortRange.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Qos Traffic Profiler Port range properties. + */ +@Fluent +public final class QosPortRange implements JsonSerializable { + /* + * Qos Port Range start. + */ + private Integer start; + + /* + * Qos Port Range end. + */ + private Integer end; + + /** + * Creates an instance of QosPortRange class. + */ + public QosPortRange() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("start", this.start); + jsonWriter.writeNumberField("end", this.end); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QosPortRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QosPortRange if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QosPortRange. + */ + public static QosPortRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QosPortRange deserializedQosPortRange = new QosPortRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("start".equals(fieldName)) { + deserializedQosPortRange.start = reader.getNullable(JsonReader::getInt); + } else if ("end".equals(fieldName)) { + deserializedQosPortRange.end = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedQosPortRange; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryInboundNatRulePortMappingRequest.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryInboundNatRulePortMappingRequest.java new file mode 100644 index 0000000000000..00e66472f84ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryInboundNatRulePortMappingRequest.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The request for a QueryInboundNatRulePortMapping API. Either IpConfiguration or IpAddress should be set. + */ +@Fluent +public final class QueryInboundNatRulePortMappingRequest + implements JsonSerializable { + /* + * NetworkInterfaceIPConfiguration set in load balancer backend address. + */ + private SubResource ipConfiguration; + + /* + * IP address set in load balancer backend address. + */ + private String ipAddress; + + /** + * Creates an instance of QueryInboundNatRulePortMappingRequest class. + */ + public QueryInboundNatRulePortMappingRequest() { + } + + /** + * Get the ipConfiguration property: NetworkInterfaceIPConfiguration set in load balancer backend address. + * + * @return the ipConfiguration value. + */ + public SubResource ipConfiguration() { + return this.ipConfiguration; + } + + /** + * Set the ipConfiguration property: NetworkInterfaceIPConfiguration set in load balancer backend address. + * + * @param ipConfiguration the ipConfiguration value to set. + * @return the QueryInboundNatRulePortMappingRequest object itself. + */ + public QueryInboundNatRulePortMappingRequest withIpConfiguration(SubResource ipConfiguration) { + this.ipConfiguration = ipConfiguration; + return this; + } + + /** + * Get the ipAddress property: IP address set in load balancer backend address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: IP address set in load balancer backend address. + * + * @param ipAddress the ipAddress value to set. + * @return the QueryInboundNatRulePortMappingRequest object itself. + */ + public QueryInboundNatRulePortMappingRequest withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("ipConfiguration", this.ipConfiguration); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryInboundNatRulePortMappingRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryInboundNatRulePortMappingRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryInboundNatRulePortMappingRequest. + */ + public static QueryInboundNatRulePortMappingRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryInboundNatRulePortMappingRequest deserializedQueryInboundNatRulePortMappingRequest + = new QueryInboundNatRulePortMappingRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfiguration".equals(fieldName)) { + deserializedQueryInboundNatRulePortMappingRequest.ipConfiguration = SubResource.fromJson(reader); + } else if ("ipAddress".equals(fieldName)) { + deserializedQueryInboundNatRulePortMappingRequest.ipAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryInboundNatRulePortMappingRequest; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryRequestOptions.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryRequestOptions.java new file mode 100644 index 0000000000000..0cae05fd5db2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryRequestOptions.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Query Request Options. + */ +@Fluent +public final class QueryRequestOptions implements JsonSerializable { + /* + * When present, the value can be passed to a subsequent query call (together with the same query and scopes used in + * the current request) to retrieve the next page of data. + */ + private String skipToken; + + /** + * Creates an instance of QueryRequestOptions class. + */ + public QueryRequestOptions() { + } + + /** + * Get the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @return the skipToken value. + */ + public String skipToken() { + return this.skipToken; + } + + /** + * Set the skipToken property: When present, the value can be passed to a subsequent query call (together with the + * same query and scopes used in the current request) to retrieve the next page of data. + * + * @param skipToken the skipToken value to set. + * @return the QueryRequestOptions object itself. + */ + public QueryRequestOptions withSkipToken(String skipToken) { + this.skipToken = skipToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("skipToken", this.skipToken); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryRequestOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryRequestOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QueryRequestOptions. + */ + public static QueryRequestOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryRequestOptions deserializedQueryRequestOptions = new QueryRequestOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skipToken".equals(fieldName)) { + deserializedQueryRequestOptions.skipToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryRequestOptions; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryResults.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryResults.java new file mode 100644 index 0000000000000..7e6bb6fbe2b10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryResults.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.QueryResultsInner; +import java.util.List; + +/** + * An immutable client-side representation of QueryResults. + */ +public interface QueryResults { + /** + * Gets the matchingRecordsCount property: Number of total records matching the query. + * + * @return the matchingRecordsCount value. + */ + Long matchingRecordsCount(); + + /** + * Gets the signatures property: Array containing the results of the query. + * + * @return the signatures value. + */ + List signatures(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.QueryResultsInner object. + * + * @return the inner object. + */ + QueryResultsInner innerModel(); +} 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..e7adf75003791 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/QueryTroubleshootingParameters.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the resource to query the troubleshooting result. + */ +@Fluent +public final class QueryTroubleshootingParameters implements JsonSerializable { + /* + * The target resource ID to query the troubleshooting result. + */ + private String targetResourceId; + + /** + * Creates an instance of QueryTroubleshootingParameters class. + */ + public QueryTroubleshootingParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model QueryTroubleshootingParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(QueryTroubleshootingParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueryTroubleshootingParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueryTroubleshootingParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QueryTroubleshootingParameters. + */ + public static QueryTroubleshootingParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueryTroubleshootingParameters deserializedQueryTroubleshootingParameters + = new QueryTroubleshootingParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedQueryTroubleshootingParameters.targetResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQueryTroubleshootingParameters; + }); + } +} 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..9d357cdf844c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RadiusServer.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Radius Server Settings. + */ +@Fluent +public final class RadiusServer implements JsonSerializable { + /* + * The address of this radius server. + */ + private String radiusServerAddress; + + /* + * The initial score assigned to this radius server. + */ + private Long radiusServerScore; + + /* + * The secret used for this radius server. + */ + private String radiusServerSecret; + + /** + * Creates an instance of RadiusServer class. + */ + public RadiusServer() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property radiusServerAddress in model RadiusServer")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RadiusServer.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("radiusServerAddress", this.radiusServerAddress); + jsonWriter.writeNumberField("radiusServerScore", this.radiusServerScore); + jsonWriter.writeStringField("radiusServerSecret", this.radiusServerSecret); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RadiusServer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RadiusServer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RadiusServer. + */ + public static RadiusServer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RadiusServer deserializedRadiusServer = new RadiusServer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("radiusServerAddress".equals(fieldName)) { + deserializedRadiusServer.radiusServerAddress = reader.getString(); + } else if ("radiusServerScore".equals(fieldName)) { + deserializedRadiusServer.radiusServerScore = reader.getNullable(JsonReader::getLong); + } else if ("radiusServerSecret".equals(fieldName)) { + deserializedRadiusServer.radiusServerSecret = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRadiusServer; + }); + } +} 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..09795253878a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RecordSet.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A collective group of information about the record set information. + */ +@Fluent +public final class RecordSet implements JsonSerializable { + /* + * Resource record type. + */ + private String recordType; + + /* + * Recordset name. + */ + private String recordSetName; + + /* + * Fqdn that resolves to private endpoint ip address. + */ + private String fqdn; + + /* + * The provisioning state of the recordset. + */ + private ProvisioningState provisioningState; + + /* + * Recordset time to live. + */ + private Integer ttl; + + /* + * The private ip address of the private endpoint. + */ + private List ipAddresses; + + /** + * Creates an instance of RecordSet class. + */ + public RecordSet() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("recordType", this.recordType); + jsonWriter.writeStringField("recordSetName", this.recordSetName); + jsonWriter.writeStringField("fqdn", this.fqdn); + jsonWriter.writeNumberField("ttl", this.ttl); + jsonWriter.writeArrayField("ipAddresses", this.ipAddresses, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecordSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecordSet if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the RecordSet. + */ + public static RecordSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecordSet deserializedRecordSet = new RecordSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("recordType".equals(fieldName)) { + deserializedRecordSet.recordType = reader.getString(); + } else if ("recordSetName".equals(fieldName)) { + deserializedRecordSet.recordSetName = reader.getString(); + } else if ("fqdn".equals(fieldName)) { + deserializedRecordSet.fqdn = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedRecordSet.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("ttl".equals(fieldName)) { + deserializedRecordSet.ttl = reader.getNullable(JsonReader::getInt); + } else if ("ipAddresses".equals(fieldName)) { + List ipAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedRecordSet.ipAddresses = ipAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedRecordSet; + }); + } +} 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..08a94113739b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ReferencedPublicIpAddress.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Reference to a public IP address. + */ +@Fluent +public final class ReferencedPublicIpAddress implements JsonSerializable { + /* + * The PublicIPAddress Reference. + */ + private String id; + + /** + * Creates an instance of ReferencedPublicIpAddress class. + */ + public ReferencedPublicIpAddress() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ReferencedPublicIpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ReferencedPublicIpAddress if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ReferencedPublicIpAddress. + */ + public static ReferencedPublicIpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ReferencedPublicIpAddress deserializedReferencedPublicIpAddress = new ReferencedPublicIpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedReferencedPublicIpAddress.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedReferencedPublicIpAddress; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResiliencyModel.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResiliencyModel.java new file mode 100644 index 0000000000000..2672856c50e2b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResiliencyModel.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Property to indicate if the Express Route Gateway has resiliency model of MultiHomed or SingleHomed. + */ +public final class ResiliencyModel extends ExpandableStringEnum { + /** + * Static value SingleHomed for ResiliencyModel. + */ + public static final ResiliencyModel SINGLE_HOMED = fromString("SingleHomed"); + + /** + * Static value MultiHomed for ResiliencyModel. + */ + public static final ResiliencyModel MULTI_HOMED = fromString("MultiHomed"); + + /** + * Creates a new instance of ResiliencyModel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResiliencyModel() { + } + + /** + * Creates or finds a ResiliencyModel from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResiliencyModel. + */ + public static ResiliencyModel fromString(String name) { + return fromString(name, ResiliencyModel.class); + } + + /** + * Gets known ResiliencyModel values. + * + * @return known ResiliencyModel values. + */ + public static Collection values() { + return values(ResiliencyModel.class); + } +} 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..4798c2d0b8a28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceIdentityType.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; + +/** + * 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. + */ +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. + */ + public static ResourceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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..567f426da0fb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLink.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ResourceNavigationLinkFormat; +import java.io.IOException; + +/** + * ResourceNavigationLink resource. + */ +@Fluent +public final class ResourceNavigationLink extends SubResource { + /* + * Resource navigation link properties format. + */ + private ResourceNavigationLinkFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of ResourceNavigationLink class. + */ + public ResourceNavigationLink() { + } + + /** + * Get the innerProperties property: Resource navigation link properties format. + * + * @return the innerProperties value. + */ + private ResourceNavigationLinkFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ResourceNavigationLink withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the linkedResourceType property: Resource type of the linked resource. + * + * @return the linkedResourceType value. + */ + public String linkedResourceType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ResourceNavigationLinkFormat(); + } + this.innerProperties().withLinkedResourceType(linkedResourceType); + return this; + } + + /** + * Get the link property: Link to the external resource. + * + * @return the link value. + */ + public String link() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ResourceNavigationLinkFormat(); + } + this.innerProperties().withLink(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceNavigationLink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceNavigationLink if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceNavigationLink. + */ + public static ResourceNavigationLink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceNavigationLink deserializedResourceNavigationLink = new ResourceNavigationLink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceNavigationLink.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedResourceNavigationLink.innerProperties = ResourceNavigationLinkFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedResourceNavigationLink.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedResourceNavigationLink.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedResourceNavigationLink.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceNavigationLink; + }); + } +} 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..1ba7c111097e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinks.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String virtualNetworkName, + String subnetName, 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 com.azure.core.management.exception.ManagementException 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); +} 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..b706206668f3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceNavigationLinksListResult.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.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..4e92cf7be3870 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceProviders.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.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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + 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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + 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 Create/Delete/Get 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 Create/Delete/Get 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); + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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. + */ + void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest); + + /** + * Deletes the Bastion Shareable Links for all the tokens specified in the request. + * + * @param resourceGroupName The name of the resource group. + * @param bastionHostname The name of the Bastion Host. + * @param bslTokenRequest Post request for Delete Bastion Shareable Link By Token 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. + */ + void deleteBastionShareableLinkByToken(String resourceGroupName, String bastionHostname, + BastionShareableLinkTokenListRequest bslTokenRequest, 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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + 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 Create/Delete/Get 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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]$. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response checkDnsNameAvailabilityWithResponse(String location, String domainNameLabel, + 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); + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource along with {@link Response}. + */ + Response expressRouteProviderPortWithResponse(String providerport, Context context); + + /** + * Retrieves detail of a provider port. + * + * @param providerport The name of the provider port. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return expressRouteProviderPort resource. + */ + ExpressRouteProviderPort expressRouteProviderPort(String providerport); + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active connectivity configurations along with {@link Response}. + */ + Response listActiveConnectivityConfigurationsWithResponse( + String resourceGroupName, String networkManagerName, ActiveConfigurationParameter parameters, Integer top, + Context context); + + /** + * Lists active connectivity configurations in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active connectivity configurations. + */ + ActiveConnectivityConfigurationsListResult listActiveConnectivityConfigurations(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters); + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active security admin rules along with {@link Response}. + */ + Response listActiveSecurityAdminRulesWithResponse(String resourceGroupName, + String networkManagerName, ActiveConfigurationParameter parameters, Integer top, Context context); + + /** + * Lists active security admin rules in a network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param parameters Active Configuration Parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 active security admin rules. + */ + ActiveSecurityAdminRulesListResult listActiveSecurityAdminRules(String resourceGroupName, String networkManagerName, + ActiveConfigurationParameter parameters); + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveConnectivityConfiguration along with + * {@link Response}. + */ + Response + listNetworkManagerEffectiveConnectivityConfigurationsWithResponse(String resourceGroupName, + String virtualNetworkName, QueryRequestOptions parameters, Integer top, Context context); + + /** + * List all effective connectivity configurations applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveConnectivityConfiguration. + */ + NetworkManagerEffectiveConnectivityConfigurationListResult listNetworkManagerEffectiveConnectivityConfigurations( + String resourceGroupName, String virtualNetworkName, QueryRequestOptions parameters); + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveSecurityAdminRules along with {@link Response}. + */ + Response + listNetworkManagerEffectiveSecurityAdminRulesWithResponse(String resourceGroupName, String virtualNetworkName, + QueryRequestOptions parameters, Integer top, Context context); + + /** + * List all effective security admin rules applied on a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to list correct page. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerEffectiveSecurityAdminRules. + */ + NetworkManagerEffectiveSecurityAdminRulesListResult listNetworkManagerEffectiveSecurityAdminRules( + String resourceGroupName, String virtualNetworkName, QueryRequestOptions parameters); + + /** + * 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 along with {@link Response}. + */ + Response supportedSecurityProvidersWithResponse(String resourceGroupName, + String virtualWanName, 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); + + /** + * 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..f26206ecac1cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ResourceSet.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The base resource set for visibility and auto-approval. + */ +@Fluent +public class ResourceSet implements JsonSerializable { + /* + * The list of subscriptions. + */ + private List subscriptions; + + /** + * Creates an instance of ResourceSet class. + */ + public ResourceSet() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSet if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceSet. + */ + public static ResourceSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSet deserializedResourceSet = new ResourceSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptions".equals(fieldName)) { + List subscriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedResourceSet.subscriptions = subscriptions; + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSet; + }); + } +} 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..f36e90f967810 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RetentionPolicyParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the retention policy for flow log. + */ +@Fluent +public final class RetentionPolicyParameters implements JsonSerializable { + /* + * Number of days to retain flow log records. + */ + private Integer days; + + /* + * Flag to enable/disable retention. + */ + private Boolean enabled; + + /** + * Creates an instance of RetentionPolicyParameters class. + */ + public RetentionPolicyParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("days", this.days); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetentionPolicyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetentionPolicyParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RetentionPolicyParameters. + */ + public static RetentionPolicyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetentionPolicyParameters deserializedRetentionPolicyParameters = new RetentionPolicyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("days".equals(fieldName)) { + deserializedRetentionPolicyParameters.days = reader.getNullable(JsonReader::getInt); + } else if ("enabled".equals(fieldName)) { + deserializedRetentionPolicyParameters.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRetentionPolicyParameters; + }); + } +} 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..5420be401c73f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Route.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.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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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 { + /** + * 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); + } + } + + /** + * 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 { + /** + * 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); + } + } + + /** + * 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..fa21dc57edb3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilter.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..102a515b647f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListRouteFilters API service call. + */ +@Fluent +public final class RouteFilterListResult implements JsonSerializable { + /* + * A list of route filters in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of RouteFilterListResult class. + */ + public RouteFilterListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteFilterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteFilterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteFilterListResult. + */ + public static RouteFilterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteFilterListResult deserializedRouteFilterListResult = new RouteFilterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RouteFilterInner.fromJson(reader1)); + deserializedRouteFilterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRouteFilterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteFilterListResult; + }); + } +} 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..7cb23ea6cd492 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRule.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.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..77751cc774cab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListRouteFilterRules API service call. + */ +@Fluent +public final class RouteFilterRuleListResult implements JsonSerializable { + /* + * A list of RouteFilterRules in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of RouteFilterRuleListResult class. + */ + public RouteFilterRuleListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteFilterRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteFilterRuleListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteFilterRuleListResult. + */ + public static RouteFilterRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteFilterRuleListResult deserializedRouteFilterRuleListResult = new RouteFilterRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RouteFilterRuleInner.fromJson(reader1)); + deserializedRouteFilterRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRouteFilterRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteFilterRuleListResult; + }); + } +} 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..1c4713c1f9c3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRuleType.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 java.util.Collection; + +/** + * The rule type of the rule. + */ +public final class RouteFilterRuleType extends ExpandableStringEnum { + /** + * Static value Community for RouteFilterRuleType. + */ + public static final RouteFilterRuleType COMMUNITY = fromString("Community"); + + /** + * Creates a new instance of RouteFilterRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RouteFilterRuleType() { + } + + /** + * Creates or finds a RouteFilterRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteFilterRuleType. + */ + public static RouteFilterRuleType fromString(String name) { + return fromString(name, RouteFilterRuleType.class); + } + + /** + * Gets known RouteFilterRuleType values. + * + * @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..9e0509eac602d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilterRules.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..9232c0d0d4a13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteFilters.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String routeFilterName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..bf98a292b67de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListRoute API service call. + */ +@Fluent +public final class RouteListResult implements JsonSerializable { + /* + * A list of routes in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of RouteListResult class. + */ + public RouteListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteListResult. + */ + public static RouteListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteListResult deserializedRouteListResult = new RouteListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RouteInner.fromJson(reader1)); + deserializedRouteListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRouteListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMap.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMap.java new file mode 100644 index 0000000000000..c3bb420484452 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMap.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.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RouteMapInner; +import java.util.List; + +/** + * An immutable client-side representation of RouteMap. + */ +public interface RouteMap { + /** + * 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 associatedInboundConnections property: List of connections which have this RoutMap associated for + * inbound traffic. + * + * @return the associatedInboundConnections value. + */ + List associatedInboundConnections(); + + /** + * Gets the associatedOutboundConnections property: List of connections which have this RoutMap associated for + * outbound traffic. + * + * @return the associatedOutboundConnections value. + */ + List associatedOutboundConnections(); + + /** + * Gets the rules property: List of RouteMap rules to be applied. + * + * @return the rules value. + */ + List rules(); + + /** + * Gets the provisioningState property: The provisioning state of the RouteMap resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RouteMapInner object. + * + * @return the inner object. + */ + RouteMapInner innerModel(); + + /** + * The entirety of the RouteMap definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The RouteMap definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RouteMap definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the RouteMap definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualHubName. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @return the next definition stage. + */ + WithCreate withExistingVirtualHub(String resourceGroupName, String virtualHubName); + } + + /** + * The stage of the RouteMap 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.WithAssociatedInboundConnections, + DefinitionStages.WithAssociatedOutboundConnections, DefinitionStages.WithRules { + /** + * Executes the create request. + * + * @return the created resource. + */ + RouteMap create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RouteMap create(Context context); + } + + /** + * The stage of the RouteMap definition allowing to specify associatedInboundConnections. + */ + interface WithAssociatedInboundConnections { + /** + * Specifies the associatedInboundConnections property: List of connections which have this RoutMap + * associated for inbound traffic.. + * + * @param associatedInboundConnections List of connections which have this RoutMap associated for inbound + * traffic. + * @return the next definition stage. + */ + WithCreate withAssociatedInboundConnections(List associatedInboundConnections); + } + + /** + * The stage of the RouteMap definition allowing to specify associatedOutboundConnections. + */ + interface WithAssociatedOutboundConnections { + /** + * Specifies the associatedOutboundConnections property: List of connections which have this RoutMap + * associated for outbound traffic.. + * + * @param associatedOutboundConnections List of connections which have this RoutMap associated for outbound + * traffic. + * @return the next definition stage. + */ + WithCreate withAssociatedOutboundConnections(List associatedOutboundConnections); + } + + /** + * The stage of the RouteMap definition allowing to specify rules. + */ + interface WithRules { + /** + * Specifies the rules property: List of RouteMap rules to be applied.. + * + * @param rules List of RouteMap rules to be applied. + * @return the next definition stage. + */ + WithCreate withRules(List rules); + } + } + + /** + * Begins update for the RouteMap resource. + * + * @return the stage of resource update. + */ + RouteMap.Update update(); + + /** + * The template for RouteMap update. + */ + interface Update extends UpdateStages.WithAssociatedInboundConnections, + UpdateStages.WithAssociatedOutboundConnections, UpdateStages.WithRules { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RouteMap apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RouteMap apply(Context context); + } + + /** + * The RouteMap update stages. + */ + interface UpdateStages { + /** + * The stage of the RouteMap update allowing to specify associatedInboundConnections. + */ + interface WithAssociatedInboundConnections { + /** + * Specifies the associatedInboundConnections property: List of connections which have this RoutMap + * associated for inbound traffic.. + * + * @param associatedInboundConnections List of connections which have this RoutMap associated for inbound + * traffic. + * @return the next definition stage. + */ + Update withAssociatedInboundConnections(List associatedInboundConnections); + } + + /** + * The stage of the RouteMap update allowing to specify associatedOutboundConnections. + */ + interface WithAssociatedOutboundConnections { + /** + * Specifies the associatedOutboundConnections property: List of connections which have this RoutMap + * associated for outbound traffic.. + * + * @param associatedOutboundConnections List of connections which have this RoutMap associated for outbound + * traffic. + * @return the next definition stage. + */ + Update withAssociatedOutboundConnections(List associatedOutboundConnections); + } + + /** + * The stage of the RouteMap update allowing to specify rules. + */ + interface WithRules { + /** + * Specifies the rules property: List of RouteMap rules to be applied.. + * + * @param rules List of RouteMap rules to be applied. + * @return the next definition stage. + */ + Update withRules(List rules); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RouteMap refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RouteMap refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapActionType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapActionType.java new file mode 100644 index 0000000000000..18ae2e3e6a55b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapActionType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Kind of actions which can be taken on a matched route. Add, Replace, Remove refer to parameters on the route, like + * community or prefix. + */ +public final class RouteMapActionType extends ExpandableStringEnum { + /** + * Static value Unknown for RouteMapActionType. + */ + public static final RouteMapActionType UNKNOWN = fromString("Unknown"); + + /** + * Static value Remove for RouteMapActionType. + */ + public static final RouteMapActionType REMOVE = fromString("Remove"); + + /** + * Static value Add for RouteMapActionType. + */ + public static final RouteMapActionType ADD = fromString("Add"); + + /** + * Static value Replace for RouteMapActionType. + */ + public static final RouteMapActionType REPLACE = fromString("Replace"); + + /** + * Static value Drop for RouteMapActionType. + */ + public static final RouteMapActionType DROP = fromString("Drop"); + + /** + * Creates a new instance of RouteMapActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RouteMapActionType() { + } + + /** + * Creates or finds a RouteMapActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteMapActionType. + */ + public static RouteMapActionType fromString(String name) { + return fromString(name, RouteMapActionType.class); + } + + /** + * Gets known RouteMapActionType values. + * + * @return known RouteMapActionType values. + */ + public static Collection values() { + return values(RouteMapActionType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapMatchCondition.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapMatchCondition.java new file mode 100644 index 0000000000000..5116b72ada733 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapMatchCondition.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Match condition to apply RouteMap rules. + */ +public final class RouteMapMatchCondition extends ExpandableStringEnum { + /** + * Static value Unknown for RouteMapMatchCondition. + */ + public static final RouteMapMatchCondition UNKNOWN = fromString("Unknown"); + + /** + * Static value Contains for RouteMapMatchCondition. + */ + public static final RouteMapMatchCondition CONTAINS = fromString("Contains"); + + /** + * Static value Equals for RouteMapMatchCondition. + */ + public static final RouteMapMatchCondition EQUALS = fromString("Equals"); + + /** + * Static value NotContains for RouteMapMatchCondition. + */ + public static final RouteMapMatchCondition NOT_CONTAINS = fromString("NotContains"); + + /** + * Static value NotEquals for RouteMapMatchCondition. + */ + public static final RouteMapMatchCondition NOT_EQUALS = fromString("NotEquals"); + + /** + * Creates a new instance of RouteMapMatchCondition value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RouteMapMatchCondition() { + } + + /** + * Creates or finds a RouteMapMatchCondition from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteMapMatchCondition. + */ + public static RouteMapMatchCondition fromString(String name) { + return fromString(name, RouteMapMatchCondition.class); + } + + /** + * Gets known RouteMapMatchCondition values. + * + * @return known RouteMapMatchCondition values. + */ + public static Collection values() { + return values(RouteMapMatchCondition.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapRule.java new file mode 100644 index 0000000000000..91f3bf262ca11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMapRule.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A RouteMap Rule. + */ +@Fluent +public final class RouteMapRule implements JsonSerializable { + /* + * The unique name for the rule. + */ + private String name; + + /* + * List of matching criterion which will be applied to traffic. + */ + private List matchCriteria; + + /* + * List of actions which will be applied on a match. + */ + private List actions; + + /* + * Next step after rule is evaluated. Current supported behaviors are 'Continue'(to next rule) and 'Terminate'. + */ + private NextStep nextStepIfMatched; + + /** + * Creates an instance of RouteMapRule class. + */ + public RouteMapRule() { + } + + /** + * Get the name property: The unique name for the rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name for the rule. + * + * @param name the name value to set. + * @return the RouteMapRule object itself. + */ + public RouteMapRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the matchCriteria property: List of matching criterion which will be applied to traffic. + * + * @return the matchCriteria value. + */ + public List matchCriteria() { + return this.matchCriteria; + } + + /** + * Set the matchCriteria property: List of matching criterion which will be applied to traffic. + * + * @param matchCriteria the matchCriteria value to set. + * @return the RouteMapRule object itself. + */ + public RouteMapRule withMatchCriteria(List matchCriteria) { + this.matchCriteria = matchCriteria; + return this; + } + + /** + * Get the actions property: List of actions which will be applied on a match. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: List of actions which will be applied on a match. + * + * @param actions the actions value to set. + * @return the RouteMapRule object itself. + */ + public RouteMapRule withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the nextStepIfMatched property: Next step after rule is evaluated. Current supported behaviors are + * 'Continue'(to next rule) and 'Terminate'. + * + * @return the nextStepIfMatched value. + */ + public NextStep nextStepIfMatched() { + return this.nextStepIfMatched; + } + + /** + * Set the nextStepIfMatched property: Next step after rule is evaluated. Current supported behaviors are + * 'Continue'(to next rule) and 'Terminate'. + * + * @param nextStepIfMatched the nextStepIfMatched value to set. + * @return the RouteMapRule object itself. + */ + public RouteMapRule withNextStepIfMatched(NextStep nextStepIfMatched) { + this.nextStepIfMatched = nextStepIfMatched; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchCriteria() != null) { + matchCriteria().forEach(e -> e.validate()); + } + if (actions() != null) { + actions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("matchCriteria", this.matchCriteria, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextStepIfMatched", + this.nextStepIfMatched == null ? null : this.nextStepIfMatched.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteMapRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteMapRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteMapRule. + */ + public static RouteMapRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteMapRule deserializedRouteMapRule = new RouteMapRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRouteMapRule.name = reader.getString(); + } else if ("matchCriteria".equals(fieldName)) { + List matchCriteria = reader.readArray(reader1 -> Criterion.fromJson(reader1)); + deserializedRouteMapRule.matchCriteria = matchCriteria; + } else if ("actions".equals(fieldName)) { + List actions = reader.readArray(reader1 -> Action.fromJson(reader1)); + deserializedRouteMapRule.actions = actions; + } else if ("nextStepIfMatched".equals(fieldName)) { + deserializedRouteMapRule.nextStepIfMatched = NextStep.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteMapRule; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMaps.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMaps.java new file mode 100644 index 0000000000000..c974c275792c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteMaps.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.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RouteMaps. + */ +public interface RouteMaps { + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualHubName, String routeMapName, + Context context); + + /** + * Retrieves the details of a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the RouteMap child resource of a Virtual hub. + */ + RouteMap get(String resourceGroupName, String virtualHubName, String routeMapName); + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 routeMapName); + + /** + * Deletes a RouteMap. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param routeMapName The name of the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 routeMapName, Context context); + + /** + * Retrieves the details of all RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RouteMaps. + * + * @param resourceGroupName The resource group name of the RouteMap's resource group'. + * @param virtualHubName The name of the VirtualHub containing the RouteMap. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 RouteMaps and a URL nextLink to get the next set of results as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves the details of a RouteMap. + * + * @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 RouteMap child resource of a Virtual hub along with {@link Response}. + */ + RouteMap getById(String id); + + /** + * Retrieves the details of a RouteMap. + * + * @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 RouteMap child resource of a Virtual hub along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a RouteMap. + * + * @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 RouteMap. + * + * @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 RouteMap resource. + * + * @param name resource name. + * @return the first stage of the new RouteMap definition. + */ + RouteMap.DefinitionStages.Blank define(String name); +} 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..c3f3c845591dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteNextHopType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of Azure hop the packet should be sent to. + */ +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 a new instance of RouteNextHopType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RouteNextHopType() { + } + + /** + * Creates or finds a RouteNextHopType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RouteNextHopType. + */ + public static RouteNextHopType fromString(String name) { + return fromString(name, RouteNextHopType.class); + } + + /** + * Gets known RouteNextHopType values. + * + * @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..fc6ac74890ec6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTable.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..d919c561236d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTableListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RouteTableInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListRouteTable API service call. + */ +@Fluent +public final class RouteTableListResult implements JsonSerializable { + /* + * A list of route tables in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of RouteTableListResult class. + */ + public RouteTableListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RouteTableListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RouteTableListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RouteTableListResult. + */ + public static RouteTableListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RouteTableListResult deserializedRouteTableListResult = new RouteTableListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RouteTableInner.fromJson(reader1)); + deserializedRouteTableListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRouteTableListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRouteTableListResult; + }); + } +} 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..8f38884e367c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RouteTables.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String routeTableName, String expand, + 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..5ba27533e9bc0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Routes.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..9c12af1826126 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingConfiguration.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Routing Configuration indicating the associated and propagated route tables for this connection. + */ +@Fluent +public final class RoutingConfiguration implements JsonSerializable { + /* + * The resource id RouteTable associated with this RoutingConfiguration. + */ + private SubResource associatedRouteTable; + + /* + * The list of RouteTables to advertise the routes to. + */ + private PropagatedRouteTable propagatedRouteTables; + + /* + * List of routes that control routing from VirtualHub into a virtual network connection. + */ + private VnetRoute vnetRoutes; + + /* + * The resource id of the RouteMap associated with this RoutingConfiguration for inbound learned routes. + */ + private SubResource inboundRouteMap; + + /* + * The resource id of theRouteMap associated with this RoutingConfiguration for outbound advertised routes. + */ + private SubResource outboundRouteMap; + + /** + * Creates an instance of RoutingConfiguration class. + */ + public RoutingConfiguration() { + } + + /** + * 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; + } + + /** + * Get the inboundRouteMap property: The resource id of the RouteMap associated with this RoutingConfiguration for + * inbound learned routes. + * + * @return the inboundRouteMap value. + */ + public SubResource inboundRouteMap() { + return this.inboundRouteMap; + } + + /** + * Set the inboundRouteMap property: The resource id of the RouteMap associated with this RoutingConfiguration for + * inbound learned routes. + * + * @param inboundRouteMap the inboundRouteMap value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withInboundRouteMap(SubResource inboundRouteMap) { + this.inboundRouteMap = inboundRouteMap; + return this; + } + + /** + * Get the outboundRouteMap property: The resource id of theRouteMap associated with this RoutingConfiguration for + * outbound advertised routes. + * + * @return the outboundRouteMap value. + */ + public SubResource outboundRouteMap() { + return this.outboundRouteMap; + } + + /** + * Set the outboundRouteMap property: The resource id of theRouteMap associated with this RoutingConfiguration for + * outbound advertised routes. + * + * @param outboundRouteMap the outboundRouteMap value to set. + * @return the RoutingConfiguration object itself. + */ + public RoutingConfiguration withOutboundRouteMap(SubResource outboundRouteMap) { + this.outboundRouteMap = outboundRouteMap; + 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("associatedRouteTable", this.associatedRouteTable); + jsonWriter.writeJsonField("propagatedRouteTables", this.propagatedRouteTables); + jsonWriter.writeJsonField("vnetRoutes", this.vnetRoutes); + jsonWriter.writeJsonField("inboundRouteMap", this.inboundRouteMap); + jsonWriter.writeJsonField("outboundRouteMap", this.outboundRouteMap); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutingConfiguration. + */ + public static RoutingConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingConfiguration deserializedRoutingConfiguration = new RoutingConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("associatedRouteTable".equals(fieldName)) { + deserializedRoutingConfiguration.associatedRouteTable = SubResource.fromJson(reader); + } else if ("propagatedRouteTables".equals(fieldName)) { + deserializedRoutingConfiguration.propagatedRouteTables = PropagatedRouteTable.fromJson(reader); + } else if ("vnetRoutes".equals(fieldName)) { + deserializedRoutingConfiguration.vnetRoutes = VnetRoute.fromJson(reader); + } else if ("inboundRouteMap".equals(fieldName)) { + deserializedRoutingConfiguration.inboundRouteMap = SubResource.fromJson(reader); + } else if ("outboundRouteMap".equals(fieldName)) { + deserializedRoutingConfiguration.outboundRouteMap = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingConfiguration; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntent.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntent.java new file mode 100644 index 0000000000000..80e8daeea3ee8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntent.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.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner; +import java.util.List; + +/** + * An immutable client-side representation of RoutingIntent. + */ +public interface RoutingIntent { + /** + * 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 routingPolicies property: List of routing policies. + * + * @return the routingPolicies value. + */ + List routingPolicies(); + + /** + * Gets the provisioningState property: The provisioning state of the RoutingIntent resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RoutingIntentInner object. + * + * @return the inner object. + */ + RoutingIntentInner innerModel(); + + /** + * The entirety of the RoutingIntent definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The RoutingIntent definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RoutingIntent definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the RoutingIntent definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, virtualHubName. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @return the next definition stage. + */ + WithCreate withExistingVirtualHub(String resourceGroupName, String virtualHubName); + } + + /** + * The stage of the RoutingIntent 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.WithRoutingPolicies { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoutingIntent create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoutingIntent create(Context context); + } + + /** + * The stage of the RoutingIntent 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 RoutingIntent definition allowing to specify routingPolicies. + */ + interface WithRoutingPolicies { + /** + * Specifies the routingPolicies property: List of routing policies.. + * + * @param routingPolicies List of routing policies. + * @return the next definition stage. + */ + WithCreate withRoutingPolicies(List routingPolicies); + } + } + + /** + * Begins update for the RoutingIntent resource. + * + * @return the stage of resource update. + */ + RoutingIntent.Update update(); + + /** + * The template for RoutingIntent update. + */ + interface Update extends UpdateStages.WithName, UpdateStages.WithRoutingPolicies { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RoutingIntent apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RoutingIntent apply(Context context); + } + + /** + * The RoutingIntent update stages. + */ + interface UpdateStages { + /** + * The stage of the RoutingIntent 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 RoutingIntent update allowing to specify routingPolicies. + */ + interface WithRoutingPolicies { + /** + * Specifies the routingPolicies property: List of routing policies.. + * + * @param routingPolicies List of routing policies. + * @return the next definition stage. + */ + Update withRoutingPolicies(List routingPolicies); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoutingIntent refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoutingIntent refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntents.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntents.java new file mode 100644 index 0000000000000..012047fd9ad1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingIntents.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.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RoutingIntents. + */ +public interface RoutingIntents { + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualHubName, String routingIntentName, + Context context); + + /** + * Retrieves the details of a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the routing intent child resource of a Virtual hub. + */ + RoutingIntent get(String resourceGroupName, String virtualHubName, String routingIntentName); + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 routingIntentName); + + /** + * Deletes a RoutingIntent. + * + * @param resourceGroupName The resource group name of the RoutingIntent. + * @param virtualHubName The name of the VirtualHub. + * @param routingIntentName The name of the RoutingIntent. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 routingIntentName, Context context); + + /** + * Retrieves the details of all RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String virtualHubName); + + /** + * Retrieves the details of all RoutingIntent child resources of the 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 list of the routing intent result and a URL nextLink to get the next set of results as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String virtualHubName, Context context); + + /** + * Retrieves the details of a RoutingIntent. + * + * @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 routing intent child resource of a Virtual hub along with {@link Response}. + */ + RoutingIntent getById(String id); + + /** + * Retrieves the details of a RoutingIntent. + * + * @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 routing intent child resource of a Virtual hub along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a RoutingIntent. + * + * @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 RoutingIntent. + * + * @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 RoutingIntent resource. + * + * @param name resource name. + * @return the first stage of the new RoutingIntent definition. + */ + RoutingIntent.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingPolicy.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingPolicy.java new file mode 100644 index 0000000000000..25aab8a630f2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingPolicy.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The routing policy object used in a RoutingIntent resource. + */ +@Fluent +public final class RoutingPolicy implements JsonSerializable { + /* + * The unique name for the routing policy. + */ + private String name; + + /* + * List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic). + */ + private List destinations; + + /* + * The next hop resource id on which this routing policy is applicable to. + */ + private String nextHop; + + /** + * Creates an instance of RoutingPolicy class. + */ + public RoutingPolicy() { + } + + /** + * Get the name property: The unique name for the routing policy. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The unique name for the routing policy. + * + * @param name the name value to set. + * @return the RoutingPolicy object itself. + */ + public RoutingPolicy withName(String name) { + this.name = name; + return this; + } + + /** + * Get the destinations property: List of all destinations which this routing policy is applicable to (for example: + * Internet, PrivateTraffic). + * + * @return the destinations value. + */ + public List destinations() { + return this.destinations; + } + + /** + * Set the destinations property: List of all destinations which this routing policy is applicable to (for example: + * Internet, PrivateTraffic). + * + * @param destinations the destinations value to set. + * @return the RoutingPolicy object itself. + */ + public RoutingPolicy withDestinations(List destinations) { + this.destinations = destinations; + return this; + } + + /** + * Get the nextHop property: The next hop resource id on which this routing policy is applicable to. + * + * @return the nextHop value. + */ + public String nextHop() { + return this.nextHop; + } + + /** + * Set the nextHop property: The next hop resource id on which this routing policy is applicable to. + * + * @param nextHop the nextHop value to set. + * @return the RoutingPolicy object itself. + */ + public RoutingPolicy 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.atError() + .log(new IllegalArgumentException("Missing required property name in model RoutingPolicy")); + } + if (destinations() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property destinations in model RoutingPolicy")); + } + if (nextHop() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property nextHop in model RoutingPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutingPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextHop", this.nextHop); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutingPolicy. + */ + public static RoutingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingPolicy deserializedRoutingPolicy = new RoutingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedRoutingPolicy.name = reader.getString(); + } else if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedRoutingPolicy.destinations = destinations; + } else if ("nextHop".equals(fieldName)) { + deserializedRoutingPolicy.nextHop = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingPolicy; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRule.java new file mode 100644 index 0000000000000..e2062ba90c0a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRule.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.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleInner; + +/** + * An immutable client-side representation of RoutingRule. + */ +public interface RoutingRule { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description for this rule. + * + * @return the description value. + */ + String description(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the destination property: Indicates the destination for this particular rule. + * + * @return the destination value. + */ + RoutingRuleRouteDestination destination(); + + /** + * Gets the nextHop property: Indicates the next hop for this particular rule. + * + * @return the nextHop value. + */ + RoutingRuleNextHop nextHop(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleInner object. + * + * @return the inner object. + */ + RoutingRuleInner innerModel(); + + /** + * The entirety of the RoutingRule definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The RoutingRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RoutingRule definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the RoutingRule definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName, configurationName, ruleCollectionName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @return the next definition stage. + */ + WithCreate withExistingRuleCollection(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName); + } + + /** + * The stage of the RoutingRule 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.WithDescription, DefinitionStages.WithDestination, DefinitionStages.WithNextHop { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoutingRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoutingRule create(Context context); + } + + /** + * The stage of the RoutingRule definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule.. + * + * @param description A description for this rule. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the RoutingRule definition allowing to specify destination. + */ + interface WithDestination { + /** + * Specifies the destination property: Indicates the destination for this particular rule.. + * + * @param destination Indicates the destination for this particular rule. + * @return the next definition stage. + */ + WithCreate withDestination(RoutingRuleRouteDestination destination); + } + + /** + * The stage of the RoutingRule definition allowing to specify nextHop. + */ + interface WithNextHop { + /** + * Specifies the nextHop property: Indicates the next hop for this particular rule.. + * + * @param nextHop Indicates the next hop for this particular rule. + * @return the next definition stage. + */ + WithCreate withNextHop(RoutingRuleNextHop nextHop); + } + } + + /** + * Begins update for the RoutingRule resource. + * + * @return the stage of resource update. + */ + RoutingRule.Update update(); + + /** + * The template for RoutingRule update. + */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithDestination, UpdateStages.WithNextHop { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RoutingRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RoutingRule apply(Context context); + } + + /** + * The RoutingRule update stages. + */ + interface UpdateStages { + /** + * The stage of the RoutingRule update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule.. + * + * @param description A description for this rule. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the RoutingRule update allowing to specify destination. + */ + interface WithDestination { + /** + * Specifies the destination property: Indicates the destination for this particular rule.. + * + * @param destination Indicates the destination for this particular rule. + * @return the next definition stage. + */ + Update withDestination(RoutingRuleRouteDestination destination); + } + + /** + * The stage of the RoutingRule update allowing to specify nextHop. + */ + interface WithNextHop { + /** + * Specifies the nextHop property: Indicates the next hop for this particular rule.. + * + * @param nextHop Indicates the next hop for this particular rule. + * @return the next definition stage. + */ + Update withNextHop(RoutingRuleNextHop nextHop); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoutingRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoutingRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollection.java new file mode 100644 index 0000000000000..4bb6cb711b0ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollection.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.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleCollectionInner; +import java.util.List; + +/** + * An immutable client-side representation of RoutingRuleCollection. + */ +public interface RoutingRuleCollection { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the routing rule collection. + * + * @return the description value. + */ + String description(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the appliesTo property: Groups for configuration. + * + * @return the appliesTo value. + */ + List appliesTo(); + + /** + * Gets the disableBgpRoutePropagation property: Determines whether BGP route propagation is enabled. Defaults to + * true. + * + * @return the disableBgpRoutePropagation value. + */ + DisableBgpRoutePropagation disableBgpRoutePropagation(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleCollectionInner object. + * + * @return the inner object. + */ + RoutingRuleCollectionInner innerModel(); + + /** + * The entirety of the RoutingRuleCollection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The RoutingRuleCollection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RoutingRuleCollection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the RoutingRuleCollection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName, configurationName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @return the next definition stage. + */ + WithCreate withExistingRoutingConfiguration(String resourceGroupName, String networkManagerName, + String configurationName); + } + + /** + * The stage of the RoutingRuleCollection 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.WithDescription, DefinitionStages.WithAppliesTo, + DefinitionStages.WithDisableBgpRoutePropagation { + /** + * Executes the create request. + * + * @return the created resource. + */ + RoutingRuleCollection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RoutingRuleCollection create(Context context); + } + + /** + * The stage of the RoutingRuleCollection definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the routing rule collection.. + * + * @param description A description of the routing rule collection. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the RoutingRuleCollection definition allowing to specify appliesTo. + */ + interface WithAppliesTo { + /** + * Specifies the appliesTo property: Groups for configuration. + * + * @param appliesTo Groups for configuration. + * @return the next definition stage. + */ + WithCreate withAppliesTo(List appliesTo); + } + + /** + * The stage of the RoutingRuleCollection definition allowing to specify disableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies the disableBgpRoutePropagation property: Determines whether BGP route propagation is enabled. + * Defaults to true.. + * + * @param disableBgpRoutePropagation Determines whether BGP route propagation is enabled. Defaults to true. + * @return the next definition stage. + */ + WithCreate withDisableBgpRoutePropagation(DisableBgpRoutePropagation disableBgpRoutePropagation); + } + } + + /** + * Begins update for the RoutingRuleCollection resource. + * + * @return the stage of resource update. + */ + RoutingRuleCollection.Update update(); + + /** + * The template for RoutingRuleCollection update. + */ + interface Update + extends UpdateStages.WithDescription, UpdateStages.WithAppliesTo, UpdateStages.WithDisableBgpRoutePropagation { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RoutingRuleCollection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RoutingRuleCollection apply(Context context); + } + + /** + * The RoutingRuleCollection update stages. + */ + interface UpdateStages { + /** + * The stage of the RoutingRuleCollection update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the routing rule collection.. + * + * @param description A description of the routing rule collection. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the RoutingRuleCollection update allowing to specify appliesTo. + */ + interface WithAppliesTo { + /** + * Specifies the appliesTo property: Groups for configuration. + * + * @param appliesTo Groups for configuration. + * @return the next definition stage. + */ + Update withAppliesTo(List appliesTo); + } + + /** + * The stage of the RoutingRuleCollection update allowing to specify disableBgpRoutePropagation. + */ + interface WithDisableBgpRoutePropagation { + /** + * Specifies the disableBgpRoutePropagation property: Determines whether BGP route propagation is enabled. + * Defaults to true.. + * + * @param disableBgpRoutePropagation Determines whether BGP route propagation is enabled. Defaults to true. + * @return the next definition stage. + */ + Update withDisableBgpRoutePropagation(DisableBgpRoutePropagation disableBgpRoutePropagation); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RoutingRuleCollection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RoutingRuleCollection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollectionListResult.java new file mode 100644 index 0000000000000..7650d54985de9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleCollectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Routing configuration rule collection list result. + */ +@Fluent +public final class RoutingRuleCollectionListResult implements JsonSerializable { + /* + * A list of network manager routing configuration rule collections + */ + private List value; + + /* + * Gets the URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of RoutingRuleCollectionListResult class. + */ + public RoutingRuleCollectionListResult() { + } + + /** + * Get the value property: A list of network manager routing configuration rule collections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network manager routing configuration rule collections. + * + * @param value the value value to set. + * @return the RoutingRuleCollectionListResult object itself. + */ + public RoutingRuleCollectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the RoutingRuleCollectionListResult object itself. + */ + public RoutingRuleCollectionListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleCollectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleCollectionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutingRuleCollectionListResult. + */ + public static RoutingRuleCollectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleCollectionListResult deserializedRoutingRuleCollectionListResult + = new RoutingRuleCollectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RoutingRuleCollectionInner.fromJson(reader1)); + deserializedRoutingRuleCollectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRoutingRuleCollectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleCollectionListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollections.java new file mode 100644 index 0000000000000..d863ba209c7c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleCollections.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RoutingRuleCollections. + */ +public interface RoutingRuleCollections { + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing 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 routing configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Lists all the rule collections in a routing configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager routing configuration rule collection along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context); + + /** + * Gets a network manager routing configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager routing configuration rule collection. + */ + RoutingRuleCollection get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes an routing rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context); + + /** + * Gets a network manager routing configuration rule collection. + * + * @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 network manager routing configuration rule collection along with {@link Response}. + */ + RoutingRuleCollection getById(String id); + + /** + * Gets a network manager routing configuration rule collection. + * + * @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 network manager routing configuration rule collection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an routing rule collection. + * + * @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 an routing rule collection. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new RoutingRuleCollection resource. + * + * @param name resource name. + * @return the first stage of the new RoutingRuleCollection definition. + */ + RoutingRuleCollection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleDestinationType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleDestinationType.java new file mode 100644 index 0000000000000..b1f30cee34920 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleDestinationType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Routing rule destination type. + */ +public final class RoutingRuleDestinationType extends ExpandableStringEnum { + /** + * Static value AddressPrefix for RoutingRuleDestinationType. + */ + public static final RoutingRuleDestinationType ADDRESS_PREFIX = fromString("AddressPrefix"); + + /** + * Static value ServiceTag for RoutingRuleDestinationType. + */ + public static final RoutingRuleDestinationType SERVICE_TAG = fromString("ServiceTag"); + + /** + * Creates a new instance of RoutingRuleDestinationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingRuleDestinationType() { + } + + /** + * Creates or finds a RoutingRuleDestinationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingRuleDestinationType. + */ + public static RoutingRuleDestinationType fromString(String name) { + return fromString(name, RoutingRuleDestinationType.class); + } + + /** + * Gets known RoutingRuleDestinationType values. + * + * @return known RoutingRuleDestinationType values. + */ + public static Collection values() { + return values(RoutingRuleDestinationType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleListResult.java new file mode 100644 index 0000000000000..3f8bd6089f36b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.RoutingRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Routing configuration rule list result. + */ +@Fluent +public final class RoutingRuleListResult implements JsonSerializable { + /* + * A list of routing rules. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of RoutingRuleListResult class. + */ + public RoutingRuleListResult() { + } + + /** + * Get the value property: A list of routing rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of routing rules. + * + * @param value the value value to set. + * @return the RoutingRuleListResult object itself. + */ + public RoutingRuleListResult 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 RoutingRuleListResult object itself. + */ + public RoutingRuleListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RoutingRuleListResult. + */ + public static RoutingRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleListResult deserializedRoutingRuleListResult = new RoutingRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RoutingRuleInner.fromJson(reader1)); + deserializedRoutingRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRoutingRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHop.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHop.java new file mode 100644 index 0000000000000..6efc5e0d6097a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHop.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Next hop. + */ +@Fluent +public final class RoutingRuleNextHop implements JsonSerializable { + /* + * Next hop type. + */ + private RoutingRuleNextHopType nextHopType; + + /* + * Next hop address. Only required if the next hop type is VirtualAppliance. + */ + private String nextHopAddress; + + /** + * Creates an instance of RoutingRuleNextHop class. + */ + public RoutingRuleNextHop() { + } + + /** + * Get the nextHopType property: Next hop type. + * + * @return the nextHopType value. + */ + public RoutingRuleNextHopType nextHopType() { + return this.nextHopType; + } + + /** + * Set the nextHopType property: Next hop type. + * + * @param nextHopType the nextHopType value to set. + * @return the RoutingRuleNextHop object itself. + */ + public RoutingRuleNextHop withNextHopType(RoutingRuleNextHopType nextHopType) { + this.nextHopType = nextHopType; + return this; + } + + /** + * Get the nextHopAddress property: Next hop address. Only required if the next hop type is VirtualAppliance. + * + * @return the nextHopAddress value. + */ + public String nextHopAddress() { + return this.nextHopAddress; + } + + /** + * Set the nextHopAddress property: Next hop address. Only required if the next hop type is VirtualAppliance. + * + * @param nextHopAddress the nextHopAddress value to set. + * @return the RoutingRuleNextHop object itself. + */ + public RoutingRuleNextHop withNextHopAddress(String nextHopAddress) { + this.nextHopAddress = nextHopAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nextHopType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property nextHopType in model RoutingRuleNextHop")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutingRuleNextHop.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextHopType", this.nextHopType == null ? null : this.nextHopType.toString()); + jsonWriter.writeStringField("nextHopAddress", this.nextHopAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleNextHop from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleNextHop if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutingRuleNextHop. + */ + public static RoutingRuleNextHop fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleNextHop deserializedRoutingRuleNextHop = new RoutingRuleNextHop(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextHopType".equals(fieldName)) { + deserializedRoutingRuleNextHop.nextHopType = RoutingRuleNextHopType.fromString(reader.getString()); + } else if ("nextHopAddress".equals(fieldName)) { + deserializedRoutingRuleNextHop.nextHopAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleNextHop; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHopType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHopType.java new file mode 100644 index 0000000000000..dcea0212acdbd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleNextHopType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Routing rule next hop type. + */ +public final class RoutingRuleNextHopType extends ExpandableStringEnum { + /** + * Static value Internet for RoutingRuleNextHopType. + */ + public static final RoutingRuleNextHopType INTERNET = fromString("Internet"); + + /** + * Static value NoNextHop for RoutingRuleNextHopType. + */ + public static final RoutingRuleNextHopType NO_NEXT_HOP = fromString("NoNextHop"); + + /** + * Static value VirtualAppliance for RoutingRuleNextHopType. + */ + public static final RoutingRuleNextHopType VIRTUAL_APPLIANCE = fromString("VirtualAppliance"); + + /** + * Static value VirtualNetworkGateway for RoutingRuleNextHopType. + */ + public static final RoutingRuleNextHopType VIRTUAL_NETWORK_GATEWAY = fromString("VirtualNetworkGateway"); + + /** + * Static value VnetLocal for RoutingRuleNextHopType. + */ + public static final RoutingRuleNextHopType VNET_LOCAL = fromString("VnetLocal"); + + /** + * Creates a new instance of RoutingRuleNextHopType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingRuleNextHopType() { + } + + /** + * Creates or finds a RoutingRuleNextHopType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingRuleNextHopType. + */ + public static RoutingRuleNextHopType fromString(String name) { + return fromString(name, RoutingRuleNextHopType.class); + } + + /** + * Gets known RoutingRuleNextHopType values. + * + * @return known RoutingRuleNextHopType values. + */ + public static Collection values() { + return values(RoutingRuleNextHopType.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleRouteDestination.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleRouteDestination.java new file mode 100644 index 0000000000000..554bf294ed117 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRuleRouteDestination.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.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Route destination. + */ +@Fluent +public final class RoutingRuleRouteDestination implements JsonSerializable { + /* + * Destination type. + */ + private RoutingRuleDestinationType type; + + /* + * Destination address. + */ + private String destinationAddress; + + /** + * Creates an instance of RoutingRuleRouteDestination class. + */ + public RoutingRuleRouteDestination() { + } + + /** + * Get the type property: Destination type. + * + * @return the type value. + */ + public RoutingRuleDestinationType type() { + return this.type; + } + + /** + * Set the type property: Destination type. + * + * @param type the type value to set. + * @return the RoutingRuleRouteDestination object itself. + */ + public RoutingRuleRouteDestination withType(RoutingRuleDestinationType type) { + this.type = type; + return this; + } + + /** + * Get the destinationAddress property: Destination address. + * + * @return the destinationAddress value. + */ + public String destinationAddress() { + return this.destinationAddress; + } + + /** + * Set the destinationAddress property: Destination address. + * + * @param destinationAddress the destinationAddress value to set. + * @return the RoutingRuleRouteDestination object itself. + */ + public RoutingRuleRouteDestination withDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model RoutingRuleRouteDestination")); + } + if (destinationAddress() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationAddress in model RoutingRuleRouteDestination")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RoutingRuleRouteDestination.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("destinationAddress", this.destinationAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingRuleRouteDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingRuleRouteDestination if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutingRuleRouteDestination. + */ + public static RoutingRuleRouteDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingRuleRouteDestination deserializedRoutingRuleRouteDestination = new RoutingRuleRouteDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedRoutingRuleRouteDestination.type + = RoutingRuleDestinationType.fromString(reader.getString()); + } else if ("destinationAddress".equals(fieldName)) { + deserializedRoutingRuleRouteDestination.destinationAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingRuleRouteDestination; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRules.java new file mode 100644 index 0000000000000..8fd59d5f31cfa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingRules.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 RoutingRules. + */ +public interface RoutingRules { + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * List all network manager routing configuration routing rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return routing configuration rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Context context); + + /** + * Gets a network manager routing configuration routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 a network manager routing configuration routing rule. + */ + RoutingRule get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes a routing rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Routing Configuration. + * @param ruleCollectionName The name of the network manager routing Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context); + + /** + * Gets a network manager routing configuration routing 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 a network manager routing configuration routing rule along with {@link Response}. + */ + RoutingRule getById(String id); + + /** + * Gets a network manager routing configuration routing 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 a network manager routing configuration routing rule along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a routing 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 routing rule. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new RoutingRule resource. + * + * @param name resource name. + * @return the first stage of the new RoutingRule definition. + */ + RoutingRule.DefinitionStages.Blank define(String name); +} 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..b7a3c1d49fa1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/RoutingState.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 java.util.Collection; + +/** + * The current routing state of the VirtualHub. + */ +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 a new instance of RoutingState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingState() { + } + + /** + * Creates or finds a RoutingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingState. + */ + public static RoutingState fromString(String name) { + return fromString(name, RoutingState.class); + } + + /** + * Gets known RoutingState values. + * + * @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/ScopeConnection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnection.java new file mode 100644 index 0000000000000..90dda21a61b10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnection.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.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.ScopeConnectionInner; + +/** + * An immutable client-side representation of ScopeConnection. + */ +public interface ScopeConnection { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the tenantId property: Tenant ID. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the resourceId property: Resource ID. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the connectionState property: Connection State. + * + * @return the connectionState value. + */ + ScopeConnectionState connectionState(); + + /** + * Gets the description property: A description of the scope connection. + * + * @return the description value. + */ + String description(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ScopeConnectionInner object. + * + * @return the inner object. + */ + ScopeConnectionInner innerModel(); + + /** + * The entirety of the ScopeConnection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ScopeConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ScopeConnection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ScopeConnection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @return the next definition stage. + */ + WithCreate withExistingNetworkManager(String resourceGroupName, String networkManagerName); + } + + /** + * The stage of the ScopeConnection 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.WithTenantId, DefinitionStages.WithResourceId, DefinitionStages.WithDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + ScopeConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ScopeConnection create(Context context); + } + + /** + * The stage of the ScopeConnection definition allowing to specify tenantId. + */ + interface WithTenantId { + /** + * Specifies the tenantId property: Tenant ID.. + * + * @param tenantId Tenant ID. + * @return the next definition stage. + */ + WithCreate withTenantId(String tenantId); + } + + /** + * The stage of the ScopeConnection definition allowing to specify resourceId. + */ + interface WithResourceId { + /** + * Specifies the resourceId property: Resource ID.. + * + * @param resourceId Resource ID. + * @return the next definition stage. + */ + WithCreate withResourceId(String resourceId); + } + + /** + * The stage of the ScopeConnection definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the scope connection.. + * + * @param description A description of the scope connection. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + } + + /** + * Begins update for the ScopeConnection resource. + * + * @return the stage of resource update. + */ + ScopeConnection.Update update(); + + /** + * The template for ScopeConnection update. + */ + interface Update extends UpdateStages.WithTenantId, UpdateStages.WithResourceId, UpdateStages.WithDescription { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ScopeConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ScopeConnection apply(Context context); + } + + /** + * The ScopeConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the ScopeConnection update allowing to specify tenantId. + */ + interface WithTenantId { + /** + * Specifies the tenantId property: Tenant ID.. + * + * @param tenantId Tenant ID. + * @return the next definition stage. + */ + Update withTenantId(String tenantId); + } + + /** + * The stage of the ScopeConnection update allowing to specify resourceId. + */ + interface WithResourceId { + /** + * Specifies the resourceId property: Resource ID.. + * + * @param resourceId Resource ID. + * @return the next definition stage. + */ + Update withResourceId(String resourceId); + } + + /** + * The stage of the ScopeConnection update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the scope connection.. + * + * @param description A description of the scope connection. + * @return the next definition stage. + */ + Update withDescription(String description); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ScopeConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ScopeConnection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionListResult.java new file mode 100644 index 0000000000000..9a22f5de44eed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ScopeConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of scope connections. + */ +@Fluent +public final class ScopeConnectionListResult implements JsonSerializable { + /* + * List of scope connections. + */ + private List value; + + /* + * Gets the URL to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ScopeConnectionListResult class. + */ + public ScopeConnectionListResult() { + } + + /** + * Get the value property: List of scope connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of scope connections. + * + * @param value the value value to set. + * @return the ScopeConnectionListResult object itself. + */ + public ScopeConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the ScopeConnectionListResult object itself. + */ + public ScopeConnectionListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScopeConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScopeConnectionListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ScopeConnectionListResult. + */ + public static ScopeConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScopeConnectionListResult deserializedScopeConnectionListResult = new ScopeConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ScopeConnectionInner.fromJson(reader1)); + deserializedScopeConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedScopeConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedScopeConnectionListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionState.java new file mode 100644 index 0000000000000..f8c82c9292815 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnectionState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current scope connection state. + */ +public final class ScopeConnectionState extends ExpandableStringEnum { + /** + * Static value Connected for ScopeConnectionState. + */ + public static final ScopeConnectionState CONNECTED = fromString("Connected"); + + /** + * Static value Pending for ScopeConnectionState. + */ + public static final ScopeConnectionState PENDING = fromString("Pending"); + + /** + * Static value Conflict for ScopeConnectionState. + */ + public static final ScopeConnectionState CONFLICT = fromString("Conflict"); + + /** + * Static value Revoked for ScopeConnectionState. + */ + public static final ScopeConnectionState REVOKED = fromString("Revoked"); + + /** + * Static value Rejected for ScopeConnectionState. + */ + public static final ScopeConnectionState REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of ScopeConnectionState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScopeConnectionState() { + } + + /** + * Creates or finds a ScopeConnectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScopeConnectionState. + */ + public static ScopeConnectionState fromString(String name) { + return fromString(name, ScopeConnectionState.class); + } + + /** + * Gets known ScopeConnectionState values. + * + * @return known ScopeConnectionState values. + */ + public static Collection values() { + return values(ScopeConnectionState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnections.java new file mode 100644 index 0000000000000..5168a040abbac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScopeConnections.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 ScopeConnections. + */ +public interface ScopeConnections { + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String scopeConnectionName, Context context); + + /** + * Get specified scope connection created by this Network Manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 specified scope connection created by this Network Manager. + */ + ScopeConnection get(String resourceGroupName, String networkManagerName, String scopeConnectionName); + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String networkManagerName, String scopeConnectionName, + Context context); + + /** + * Delete the pending scope connection created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param scopeConnectionName Name for the cross-tenant 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 networkManagerName, String scopeConnectionName); + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 scope connections as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * List all scope connections created by this network manager. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 scope connections as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context); + + /** + * Get specified scope connection created by this Network Manager. + * + * @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 specified scope connection created by this Network Manager along with {@link Response}. + */ + ScopeConnection getById(String id); + + /** + * Get specified scope connection created by this Network Manager. + * + * @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 specified scope connection created by this Network Manager along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the pending scope connection created by this network manager. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the pending scope connection created by this network manager. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ScopeConnection resource. + * + * @param name resource name. + * @return the first stage of the new ScopeConnection definition. + */ + ScopeConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchOperator.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchOperator.java new file mode 100644 index 0000000000000..2fab2bbdf2b14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchOperator.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 java.util.Collection; + +/** + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this rule + * applies to. + */ +public final class ScrubbingRuleEntryMatchOperator extends ExpandableStringEnum { + /** + * Static value Equals for ScrubbingRuleEntryMatchOperator. + */ + public static final ScrubbingRuleEntryMatchOperator EQUALS = fromString("Equals"); + + /** + * Static value EqualsAny for ScrubbingRuleEntryMatchOperator. + */ + public static final ScrubbingRuleEntryMatchOperator EQUALS_ANY = fromString("EqualsAny"); + + /** + * Creates a new instance of ScrubbingRuleEntryMatchOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScrubbingRuleEntryMatchOperator() { + } + + /** + * Creates or finds a ScrubbingRuleEntryMatchOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScrubbingRuleEntryMatchOperator. + */ + public static ScrubbingRuleEntryMatchOperator fromString(String name) { + return fromString(name, ScrubbingRuleEntryMatchOperator.class); + } + + /** + * Gets known ScrubbingRuleEntryMatchOperator values. + * + * @return known ScrubbingRuleEntryMatchOperator values. + */ + public static Collection values() { + return values(ScrubbingRuleEntryMatchOperator.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchVariable.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchVariable.java new file mode 100644 index 0000000000000..fe3be0525f1f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryMatchVariable.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The variable to be scrubbed from the logs. + */ +public final class ScrubbingRuleEntryMatchVariable extends ExpandableStringEnum { + /** + * Static value RequestHeaderNames for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_HEADER_NAMES = fromString("RequestHeaderNames"); + + /** + * Static value RequestCookieNames for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_COOKIE_NAMES = fromString("RequestCookieNames"); + + /** + * Static value RequestArgNames for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_ARG_NAMES = fromString("RequestArgNames"); + + /** + * Static value RequestPostArgNames for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_POST_ARG_NAMES = fromString("RequestPostArgNames"); + + /** + * Static value RequestJSONArgNames for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_JSONARG_NAMES = fromString("RequestJSONArgNames"); + + /** + * Static value RequestIPAddress for ScrubbingRuleEntryMatchVariable. + */ + public static final ScrubbingRuleEntryMatchVariable REQUEST_IPADDRESS = fromString("RequestIPAddress"); + + /** + * Creates a new instance of ScrubbingRuleEntryMatchVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScrubbingRuleEntryMatchVariable() { + } + + /** + * Creates or finds a ScrubbingRuleEntryMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScrubbingRuleEntryMatchVariable. + */ + public static ScrubbingRuleEntryMatchVariable fromString(String name) { + return fromString(name, ScrubbingRuleEntryMatchVariable.class); + } + + /** + * Gets known ScrubbingRuleEntryMatchVariable values. + * + * @return known ScrubbingRuleEntryMatchVariable values. + */ + public static Collection values() { + return values(ScrubbingRuleEntryMatchVariable.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryState.java new file mode 100644 index 0000000000000..7486a1ffee6b8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ScrubbingRuleEntryState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines the state of log scrubbing rule. Default value is Enabled. + */ +public final class ScrubbingRuleEntryState extends ExpandableStringEnum { + /** + * Static value Enabled for ScrubbingRuleEntryState. + */ + public static final ScrubbingRuleEntryState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ScrubbingRuleEntryState. + */ + public static final ScrubbingRuleEntryState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ScrubbingRuleEntryState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScrubbingRuleEntryState() { + } + + /** + * Creates or finds a ScrubbingRuleEntryState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScrubbingRuleEntryState. + */ + public static ScrubbingRuleEntryState fromString(String name) { + return fromString(name, ScrubbingRuleEntryState.class); + } + + /** + * Gets known ScrubbingRuleEntryState values. + * + * @return known ScrubbingRuleEntryState values. + */ + public static Collection values() { + return values(ScrubbingRuleEntryState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfiguration.java new file mode 100644 index 0000000000000..825583cae1180 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfiguration.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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityAdminConfigurationInner; +import java.util.List; + +/** + * An immutable client-side representation of SecurityAdminConfiguration. + */ +public interface SecurityAdminConfiguration { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the security configuration. + * + * @return the description value. + */ + String description(); + + /** + * Gets the applyOnNetworkIntentPolicyBasedServices property: Enum list of network intent policy based services. + * + * @return the applyOnNetworkIntentPolicyBasedServices value. + */ + List applyOnNetworkIntentPolicyBasedServices(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityAdminConfigurationInner object. + * + * @return the inner object. + */ + SecurityAdminConfigurationInner innerModel(); + + /** + * The entirety of the SecurityAdminConfiguration definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SecurityAdminConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecurityAdminConfiguration definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SecurityAdminConfiguration definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @return the next definition stage. + */ + WithCreate withExistingNetworkManager(String resourceGroupName, String networkManagerName); + } + + /** + * The stage of the SecurityAdminConfiguration 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.WithDescription, DefinitionStages.WithApplyOnNetworkIntentPolicyBasedServices { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityAdminConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityAdminConfiguration create(Context context); + } + + /** + * The stage of the SecurityAdminConfiguration definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the security configuration.. + * + * @param description A description of the security configuration. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the SecurityAdminConfiguration definition allowing to specify + * applyOnNetworkIntentPolicyBasedServices. + */ + interface WithApplyOnNetworkIntentPolicyBasedServices { + /** + * Specifies the applyOnNetworkIntentPolicyBasedServices property: Enum list of network intent policy based + * services.. + * + * @param applyOnNetworkIntentPolicyBasedServices Enum list of network intent policy based services. + * @return the next definition stage. + */ + WithCreate withApplyOnNetworkIntentPolicyBasedServices( + List applyOnNetworkIntentPolicyBasedServices); + } + } + + /** + * Begins update for the SecurityAdminConfiguration resource. + * + * @return the stage of resource update. + */ + SecurityAdminConfiguration.Update update(); + + /** + * The template for SecurityAdminConfiguration update. + */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithApplyOnNetworkIntentPolicyBasedServices { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityAdminConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityAdminConfiguration apply(Context context); + } + + /** + * The SecurityAdminConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the SecurityAdminConfiguration update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the security configuration.. + * + * @param description A description of the security configuration. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the SecurityAdminConfiguration update allowing to specify + * applyOnNetworkIntentPolicyBasedServices. + */ + interface WithApplyOnNetworkIntentPolicyBasedServices { + /** + * Specifies the applyOnNetworkIntentPolicyBasedServices property: Enum list of network intent policy based + * services.. + * + * @param applyOnNetworkIntentPolicyBasedServices Enum list of network intent policy based services. + * @return the next definition stage. + */ + Update withApplyOnNetworkIntentPolicyBasedServices( + List applyOnNetworkIntentPolicyBasedServices); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityAdminConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityAdminConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurationListResult.java new file mode 100644 index 0000000000000..8d0b886d3191c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityAdminConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of network manager security admin configurations. + */ +@Fluent +public final class SecurityAdminConfigurationListResult + implements JsonSerializable { + /* + * Gets a page of security admin configurations + */ + private List value; + + /* + * Gets the URL to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of SecurityAdminConfigurationListResult class. + */ + public SecurityAdminConfigurationListResult() { + } + + /** + * Get the value property: Gets a page of security admin configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of security admin configurations. + * + * @param value the value value to set. + * @return the SecurityAdminConfigurationListResult object itself. + */ + public SecurityAdminConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the SecurityAdminConfigurationListResult object itself. + */ + public SecurityAdminConfigurationListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityAdminConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityAdminConfigurationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityAdminConfigurationListResult. + */ + public static SecurityAdminConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityAdminConfigurationListResult deserializedSecurityAdminConfigurationListResult + = new SecurityAdminConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecurityAdminConfigurationInner.fromJson(reader1)); + deserializedSecurityAdminConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityAdminConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityAdminConfigurationListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurations.java new file mode 100644 index 0000000000000..6d5675ebaf328 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityAdminConfigurations.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 SecurityAdminConfigurations. + */ +public interface SecurityAdminConfigurations { + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security admin configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager security admin configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security admin configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context); + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context); + + /** + * Retrieves a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security admin configuration. + */ + SecurityAdminConfiguration get(String resourceGroupName, String networkManagerName, String configurationName); + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager security admin configuration. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, Boolean force, + Context context); + + /** + * Retrieves a network manager security admin 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 defines the security admin configuration along with {@link Response}. + */ + SecurityAdminConfiguration getById(String id); + + /** + * Retrieves a network manager security admin 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 defines the security admin configuration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a network manager security admin 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 network manager security admin configuration. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new SecurityAdminConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new SecurityAdminConfiguration definition. + */ + SecurityAdminConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleAccess.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleAccess.java new file mode 100644 index 0000000000000..7e19aa3572879 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleAccess.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether network traffic is allowed or denied. + */ +public final class SecurityConfigurationRuleAccess extends ExpandableStringEnum { + /** + * Static value Allow for SecurityConfigurationRuleAccess. + */ + public static final SecurityConfigurationRuleAccess ALLOW = fromString("Allow"); + + /** + * Static value Deny for SecurityConfigurationRuleAccess. + */ + public static final SecurityConfigurationRuleAccess DENY = fromString("Deny"); + + /** + * Static value AlwaysAllow for SecurityConfigurationRuleAccess. + */ + public static final SecurityConfigurationRuleAccess ALWAYS_ALLOW = fromString("AlwaysAllow"); + + /** + * Creates a new instance of SecurityConfigurationRuleAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityConfigurationRuleAccess() { + } + + /** + * Creates or finds a SecurityConfigurationRuleAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityConfigurationRuleAccess. + */ + public static SecurityConfigurationRuleAccess fromString(String name) { + return fromString(name, SecurityConfigurationRuleAccess.class); + } + + /** + * Gets known SecurityConfigurationRuleAccess values. + * + * @return known SecurityConfigurationRuleAccess values. + */ + public static Collection values() { + return values(SecurityConfigurationRuleAccess.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleDirection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleDirection.java new file mode 100644 index 0000000000000..4fe50d4f28341 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleDirection.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The direction of the rule. The direction specifies if the rule will be evaluated on incoming or outgoing traffic. + */ +public final class SecurityConfigurationRuleDirection extends ExpandableStringEnum { + /** + * Static value Inbound for SecurityConfigurationRuleDirection. + */ + public static final SecurityConfigurationRuleDirection INBOUND = fromString("Inbound"); + + /** + * Static value Outbound for SecurityConfigurationRuleDirection. + */ + public static final SecurityConfigurationRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates a new instance of SecurityConfigurationRuleDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityConfigurationRuleDirection() { + } + + /** + * Creates or finds a SecurityConfigurationRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityConfigurationRuleDirection. + */ + public static SecurityConfigurationRuleDirection fromString(String name) { + return fromString(name, SecurityConfigurationRuleDirection.class); + } + + /** + * Gets known SecurityConfigurationRuleDirection values. + * + * @return known SecurityConfigurationRuleDirection values. + */ + public static Collection values() { + return values(SecurityConfigurationRuleDirection.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleProtocol.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleProtocol.java new file mode 100644 index 0000000000000..0eefd5a42728e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityConfigurationRuleProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network protocol this rule applies to. + */ +public final class SecurityConfigurationRuleProtocol extends ExpandableStringEnum { + /** + * Static value Tcp for SecurityConfigurationRuleProtocol. + */ + public static final SecurityConfigurationRuleProtocol TCP = fromString("Tcp"); + + /** + * Static value Udp for SecurityConfigurationRuleProtocol. + */ + public static final SecurityConfigurationRuleProtocol UDP = fromString("Udp"); + + /** + * Static value Icmp for SecurityConfigurationRuleProtocol. + */ + public static final SecurityConfigurationRuleProtocol ICMP = fromString("Icmp"); + + /** + * Static value Esp for SecurityConfigurationRuleProtocol. + */ + public static final SecurityConfigurationRuleProtocol ESP = fromString("Esp"); + + /** + * Static value Any for SecurityConfigurationRuleProtocol. + */ + public static final SecurityConfigurationRuleProtocol ANY = fromString("Any"); + + /** + * Static value Ah for SecurityConfigurationRuleProtocol. + */ + public static final SecurityConfigurationRuleProtocol AH = fromString("Ah"); + + /** + * Creates a new instance of SecurityConfigurationRuleProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityConfigurationRuleProtocol() { + } + + /** + * Creates or finds a SecurityConfigurationRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityConfigurationRuleProtocol. + */ + public static SecurityConfigurationRuleProtocol fromString(String name) { + return fromString(name, SecurityConfigurationRuleProtocol.class); + } + + /** + * Gets known SecurityConfigurationRuleProtocol values. + * + * @return known SecurityConfigurationRuleProtocol values. + */ + public static Collection values() { + return values(SecurityConfigurationRuleProtocol.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..e677484cec6c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupNetworkInterface.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network interface and all its associated security rules. + */ +@Fluent +public final class SecurityGroupNetworkInterface implements JsonSerializable { + /* + * ID of the network interface. + */ + private String id; + + /* + * All security rules associated with the network interface. + */ + private SecurityRuleAssociations securityRuleAssociations; + + /** + * Creates an instance of SecurityGroupNetworkInterface class. + */ + public SecurityGroupNetworkInterface() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("securityRuleAssociations", this.securityRuleAssociations); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityGroupNetworkInterface from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityGroupNetworkInterface if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityGroupNetworkInterface. + */ + public static SecurityGroupNetworkInterface fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityGroupNetworkInterface deserializedSecurityGroupNetworkInterface + = new SecurityGroupNetworkInterface(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecurityGroupNetworkInterface.id = reader.getString(); + } else if ("securityRuleAssociations".equals(fieldName)) { + deserializedSecurityGroupNetworkInterface.securityRuleAssociations + = SecurityRuleAssociations.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityGroupNetworkInterface; + }); + } +} 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..74f1ff0469585 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewParameters.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the VM to check security groups for. + */ +@Fluent +public final class SecurityGroupViewParameters implements JsonSerializable { + /* + * ID of the target VM. + */ + private String targetResourceId; + + /** + * Creates an instance of SecurityGroupViewParameters class. + */ + public SecurityGroupViewParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model SecurityGroupViewParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityGroupViewParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityGroupViewParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityGroupViewParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityGroupViewParameters. + */ + public static SecurityGroupViewParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityGroupViewParameters deserializedSecurityGroupViewParameters = new SecurityGroupViewParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedSecurityGroupViewParameters.targetResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityGroupViewParameters; + }); + } +} 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..b8a1648f7ccba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityGroupViewResult.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.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..4d284ca6d30a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProvider.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..3ff2a682d365b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderConnectionStatus.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current state of the connection with Security Partner Provider. + */ +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 a new instance of SecurityPartnerProviderConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityPartnerProviderConnectionStatus() { + } + + /** + * Creates or finds a SecurityPartnerProviderConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityPartnerProviderConnectionStatus. + */ + public static SecurityPartnerProviderConnectionStatus fromString(String name) { + return fromString(name, SecurityPartnerProviderConnectionStatus.class); + } + + /** + * Gets known SecurityPartnerProviderConnectionStatus values. + * + * @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..50e63cab463ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviderListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityPartnerProviderInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListSecurityPartnerProviders API service call. + */ +@Fluent +public final class SecurityPartnerProviderListResult implements JsonSerializable { + /* + * List of Security Partner Providers in a resource group. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of SecurityPartnerProviderListResult class. + */ + public SecurityPartnerProviderListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityPartnerProviderListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityPartnerProviderListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityPartnerProviderListResult. + */ + public static SecurityPartnerProviderListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityPartnerProviderListResult deserializedSecurityPartnerProviderListResult + = new SecurityPartnerProviderListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecurityPartnerProviderInner.fromJson(reader1)); + deserializedSecurityPartnerProviderListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityPartnerProviderListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityPartnerProviderListResult; + }); + } +} 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..2b967a96b78fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityPartnerProviders.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..4af25c2c88895 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityProviderName.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Security Providers. + */ +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 a new instance of SecurityProviderName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityProviderName() { + } + + /** + * Creates or finds a SecurityProviderName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityProviderName. + */ + public static SecurityProviderName fromString(String name) { + return fromString(name, SecurityProviderName.class); + } + + /** + * Gets known SecurityProviderName values. + * + * @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..e02af625f163a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRule.java @@ -0,0 +1,784 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + */ + int 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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(int 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(int 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..77684e442a2a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAccess.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether network traffic is allowed or denied. + */ +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 a new instance of SecurityRuleAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityRuleAccess() { + } + + /** + * Creates or finds a SecurityRuleAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleAccess. + */ + public static SecurityRuleAccess fromString(String name) { + return fromString(name, SecurityRuleAccess.class); + } + + /** + * Gets known SecurityRuleAccess values. + * + * @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..b8fb299293eb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleAssociations.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * All security rules associated with the network interface. + */ +@Fluent +public final class SecurityRuleAssociations implements JsonSerializable { + /* + * Network interface and it's custom security rules. + */ + private NetworkInterfaceAssociation networkInterfaceAssociation; + + /* + * Subnet and it's custom security rules. + */ + private SubnetAssociation subnetAssociation; + + /* + * Collection of default security rules of the network security group. + */ + private List defaultSecurityRules; + + /* + * Collection of effective security rules. + */ + private List effectiveSecurityRules; + + /** + * Creates an instance of SecurityRuleAssociations class. + */ + public SecurityRuleAssociations() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkInterfaceAssociation", this.networkInterfaceAssociation); + jsonWriter.writeJsonField("subnetAssociation", this.subnetAssociation); + jsonWriter.writeArrayField("defaultSecurityRules", this.defaultSecurityRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("effectiveSecurityRules", this.effectiveSecurityRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityRuleAssociations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityRuleAssociations if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityRuleAssociations. + */ + public static SecurityRuleAssociations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityRuleAssociations deserializedSecurityRuleAssociations = new SecurityRuleAssociations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkInterfaceAssociation".equals(fieldName)) { + deserializedSecurityRuleAssociations.networkInterfaceAssociation + = NetworkInterfaceAssociation.fromJson(reader); + } else if ("subnetAssociation".equals(fieldName)) { + deserializedSecurityRuleAssociations.subnetAssociation = SubnetAssociation.fromJson(reader); + } else if ("defaultSecurityRules".equals(fieldName)) { + List defaultSecurityRules + = reader.readArray(reader1 -> SecurityRuleInner.fromJson(reader1)); + deserializedSecurityRuleAssociations.defaultSecurityRules = defaultSecurityRules; + } else if ("effectiveSecurityRules".equals(fieldName)) { + List effectiveSecurityRules + = reader.readArray(reader1 -> EffectiveNetworkSecurityRule.fromJson(reader1)); + deserializedSecurityRuleAssociations.effectiveSecurityRules = effectiveSecurityRules; + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityRuleAssociations; + }); + } +} 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..d146fe2b164d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleDirection.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. + */ +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 a new instance of SecurityRuleDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityRuleDirection() { + } + + /** + * Creates or finds a SecurityRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleDirection. + */ + public static SecurityRuleDirection fromString(String name) { + return fromString(name, SecurityRuleDirection.class); + } + + /** + * Gets known SecurityRuleDirection values. + * + * @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..49045025ce910 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The security rules in a network security group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of SecurityRuleListResult class. + */ + public SecurityRuleListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityRuleListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityRuleListResult. + */ + public static SecurityRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityRuleListResult deserializedSecurityRuleListResult = new SecurityRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SecurityRuleInner.fromJson(reader1)); + deserializedSecurityRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityRuleListResult; + }); + } +} 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..df6e4ab42e8bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRuleProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Network protocol this rule applies to. + */ +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 a new instance of SecurityRuleProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SecurityRuleProtocol() { + } + + /** + * Creates or finds a SecurityRuleProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityRuleProtocol. + */ + public static SecurityRuleProtocol fromString(String name) { + return fromString(name, SecurityRuleProtocol.class); + } + + /** + * Gets known SecurityRuleProtocol values. + * + * @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..fb6b9f095c53c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityRules.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/SecurityUserConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfiguration.java new file mode 100644 index 0000000000000..ac420453afcf1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfiguration.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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserConfigurationInner; + +/** + * An immutable client-side representation of SecurityUserConfiguration. + */ +public interface SecurityUserConfiguration { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the security user configuration. + * + * @return the description value. + */ + String description(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityUserConfigurationInner object. + * + * @return the inner object. + */ + SecurityUserConfigurationInner innerModel(); + + /** + * The entirety of the SecurityUserConfiguration definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SecurityUserConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecurityUserConfiguration definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SecurityUserConfiguration definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @return the next definition stage. + */ + WithCreate withExistingNetworkManager(String resourceGroupName, String networkManagerName); + } + + /** + * The stage of the SecurityUserConfiguration 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.WithDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityUserConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityUserConfiguration create(Context context); + } + + /** + * The stage of the SecurityUserConfiguration definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the security user configuration.. + * + * @param description A description of the security user configuration. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + } + + /** + * Begins update for the SecurityUserConfiguration resource. + * + * @return the stage of resource update. + */ + SecurityUserConfiguration.Update update(); + + /** + * The template for SecurityUserConfiguration update. + */ + interface Update extends UpdateStages.WithDescription { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityUserConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityUserConfiguration apply(Context context); + } + + /** + * The SecurityUserConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the SecurityUserConfiguration update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the security user configuration.. + * + * @param description A description of the security user configuration. + * @return the next definition stage. + */ + Update withDescription(String description); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityUserConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityUserConfiguration refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurationListResult.java new file mode 100644 index 0000000000000..680127fe22d76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of network manager security user configurations. + */ +@Fluent +public final class SecurityUserConfigurationListResult + implements JsonSerializable { + /* + * Gets a page of security user configurations + */ + private List value; + + /* + * Gets the URL to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of SecurityUserConfigurationListResult class. + */ + public SecurityUserConfigurationListResult() { + } + + /** + * Get the value property: Gets a page of security user configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of security user configurations. + * + * @param value the value value to set. + * @return the SecurityUserConfigurationListResult object itself. + */ + public SecurityUserConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the SecurityUserConfigurationListResult object itself. + */ + public SecurityUserConfigurationListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserConfigurationListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityUserConfigurationListResult. + */ + public static SecurityUserConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserConfigurationListResult deserializedSecurityUserConfigurationListResult + = new SecurityUserConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecurityUserConfigurationInner.fromJson(reader1)); + deserializedSecurityUserConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityUserConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserConfigurationListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurations.java new file mode 100644 index 0000000000000..29cba001c00e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserConfigurations.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 SecurityUserConfigurations. + */ +public interface SecurityUserConfigurations { + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security user configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName); + + /** + * Lists all the network manager security user configurations in a network manager, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 network manager security user configurations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, Integer top, + String skipToken, Context context); + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, Context context); + + /** + * Retrieves a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 defines the security user configuration. + */ + SecurityUserConfiguration get(String resourceGroupName, String networkManagerName, String configurationName); + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 networkManagerName, String configurationName); + + /** + * Deletes a network manager security user configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, Boolean force, + Context context); + + /** + * Retrieves a network manager security user 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 defines the security user configuration along with {@link Response}. + */ + SecurityUserConfiguration getById(String id); + + /** + * Retrieves a network manager security user 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 defines the security user configuration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a network manager security user 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 network manager security user configuration. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new SecurityUserConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new SecurityUserConfiguration definition. + */ + SecurityUserConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserGroupItem.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserGroupItem.java new file mode 100644 index 0000000000000..8a7ff08ced970 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserGroupItem.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network manager security user group item. + */ +@Fluent +public final class SecurityUserGroupItem implements JsonSerializable { + /* + * Network manager group Id. + */ + private String networkGroupId; + + /** + * Creates an instance of SecurityUserGroupItem class. + */ + public SecurityUserGroupItem() { + } + + /** + * Get the networkGroupId property: Network manager group Id. + * + * @return the networkGroupId value. + */ + public String networkGroupId() { + return this.networkGroupId; + } + + /** + * Set the networkGroupId property: Network manager group Id. + * + * @param networkGroupId the networkGroupId value to set. + * @return the SecurityUserGroupItem object itself. + */ + public SecurityUserGroupItem withNetworkGroupId(String networkGroupId) { + this.networkGroupId = networkGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkGroupId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property networkGroupId in model SecurityUserGroupItem")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecurityUserGroupItem.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("networkGroupId", this.networkGroupId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserGroupItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserGroupItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SecurityUserGroupItem. + */ + public static SecurityUserGroupItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserGroupItem deserializedSecurityUserGroupItem = new SecurityUserGroupItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkGroupId".equals(fieldName)) { + deserializedSecurityUserGroupItem.networkGroupId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserGroupItem; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRule.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRule.java new file mode 100644 index 0000000000000..12273c2eae32d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRule.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleInner; +import java.util.List; + +/** + * An immutable client-side representation of SecurityUserRule. + */ +public interface SecurityUserRule { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description for this rule. + * + * @return the description value. + */ + String description(); + + /** + * Gets the protocol property: Network protocol this rule applies to. + * + * @return the protocol value. + */ + SecurityConfigurationRuleProtocol protocol(); + + /** + * Gets the sources property: The CIDR or source IP ranges. + * + * @return the sources value. + */ + List sources(); + + /** + * Gets the destinations property: The destination address prefixes. CIDR or destination IP ranges. + * + * @return the destinations value. + */ + List destinations(); + + /** + * 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 direction property: Indicates if the traffic matched against the rule in inbound or outbound. + * + * @return the direction value. + */ + SecurityConfigurationRuleDirection direction(); + + /** + * Gets the provisioningState property: The provisioning state of the security configuration user rule resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleInner object. + * + * @return the inner object. + */ + SecurityUserRuleInner innerModel(); + + /** + * The entirety of the SecurityUserRule definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SecurityUserRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecurityUserRule definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SecurityUserRule definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName, configurationName, ruleCollectionName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @return the next definition stage. + */ + WithCreate withExistingRuleCollection(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName); + } + + /** + * The stage of the SecurityUserRule 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.WithDescription, DefinitionStages.WithProtocol, + DefinitionStages.WithSources, DefinitionStages.WithDestinations, DefinitionStages.WithSourcePortRanges, + DefinitionStages.WithDestinationPortRanges, DefinitionStages.WithDirection { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityUserRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityUserRule create(Context context); + } + + /** + * The stage of the SecurityUserRule definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule.. + * + * @param description A description for this rule. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the SecurityUserRule 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(SecurityConfigurationRuleProtocol protocol); + } + + /** + * The stage of the SecurityUserRule definition allowing to specify sources. + */ + interface WithSources { + /** + * Specifies the sources property: The CIDR or source IP ranges.. + * + * @param sources The CIDR or source IP ranges. + * @return the next definition stage. + */ + WithCreate withSources(List sources); + } + + /** + * The stage of the SecurityUserRule definition allowing to specify destinations. + */ + interface WithDestinations { + /** + * Specifies the destinations property: The destination address prefixes. CIDR or destination IP ranges.. + * + * @param destinations The destination address prefixes. CIDR or destination IP ranges. + * @return the next definition stage. + */ + WithCreate withDestinations(List destinations); + } + + /** + * The stage of the SecurityUserRule 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 SecurityUserRule 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 SecurityUserRule definition allowing to specify direction. + */ + interface WithDirection { + /** + * Specifies the direction property: Indicates if the traffic matched against the rule in inbound or + * outbound.. + * + * @param direction Indicates if the traffic matched against the rule in inbound or outbound. + * @return the next definition stage. + */ + WithCreate withDirection(SecurityConfigurationRuleDirection direction); + } + } + + /** + * Begins update for the SecurityUserRule resource. + * + * @return the stage of resource update. + */ + SecurityUserRule.Update update(); + + /** + * The template for SecurityUserRule update. + */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithProtocol, UpdateStages.WithSources, + UpdateStages.WithDestinations, UpdateStages.WithSourcePortRanges, UpdateStages.WithDestinationPortRanges, + UpdateStages.WithDirection { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityUserRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityUserRule apply(Context context); + } + + /** + * The SecurityUserRule update stages. + */ + interface UpdateStages { + /** + * The stage of the SecurityUserRule update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description for this rule.. + * + * @param description A description for this rule. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the SecurityUserRule 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(SecurityConfigurationRuleProtocol protocol); + } + + /** + * The stage of the SecurityUserRule update allowing to specify sources. + */ + interface WithSources { + /** + * Specifies the sources property: The CIDR or source IP ranges.. + * + * @param sources The CIDR or source IP ranges. + * @return the next definition stage. + */ + Update withSources(List sources); + } + + /** + * The stage of the SecurityUserRule update allowing to specify destinations. + */ + interface WithDestinations { + /** + * Specifies the destinations property: The destination address prefixes. CIDR or destination IP ranges.. + * + * @param destinations The destination address prefixes. CIDR or destination IP ranges. + * @return the next definition stage. + */ + Update withDestinations(List destinations); + } + + /** + * The stage of the SecurityUserRule 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 SecurityUserRule 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 SecurityUserRule update allowing to specify direction. + */ + interface WithDirection { + /** + * Specifies the direction property: Indicates if the traffic matched against the rule in inbound or + * outbound.. + * + * @param direction Indicates if the traffic matched against the rule in inbound or outbound. + * @return the next definition stage. + */ + Update withDirection(SecurityConfigurationRuleDirection direction); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityUserRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityUserRule refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollection.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollection.java new file mode 100644 index 0000000000000..09d383ec64310 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollection.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.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleCollectionInner; +import java.util.List; + +/** + * An immutable client-side representation of SecurityUserRuleCollection. + */ +public interface SecurityUserRuleCollection { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: A description of the security user rule collection. + * + * @return the description value. + */ + String description(); + + /** + * Gets the appliesToGroups property: Groups for configuration. + * + * @return the appliesToGroups value. + */ + List appliesToGroups(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the resourceGuid property: Unique identifier for this resource. + * + * @return the resourceGuid value. + */ + String resourceGuid(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleCollectionInner object. + * + * @return the inner object. + */ + SecurityUserRuleCollectionInner innerModel(); + + /** + * The entirety of the SecurityUserRuleCollection definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SecurityUserRuleCollection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SecurityUserRuleCollection definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SecurityUserRuleCollection definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName, configurationName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @return the next definition stage. + */ + WithCreate withExistingSecurityUserConfiguration(String resourceGroupName, String networkManagerName, + String configurationName); + } + + /** + * The stage of the SecurityUserRuleCollection 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.WithDescription, DefinitionStages.WithAppliesToGroups { + /** + * Executes the create request. + * + * @return the created resource. + */ + SecurityUserRuleCollection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SecurityUserRuleCollection create(Context context); + } + + /** + * The stage of the SecurityUserRuleCollection definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the security user rule collection.. + * + * @param description A description of the security user rule collection. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the SecurityUserRuleCollection definition allowing to specify appliesToGroups. + */ + interface WithAppliesToGroups { + /** + * Specifies the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups Groups for configuration. + * @return the next definition stage. + */ + WithCreate withAppliesToGroups(List appliesToGroups); + } + } + + /** + * Begins update for the SecurityUserRuleCollection resource. + * + * @return the stage of resource update. + */ + SecurityUserRuleCollection.Update update(); + + /** + * The template for SecurityUserRuleCollection update. + */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithAppliesToGroups { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SecurityUserRuleCollection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SecurityUserRuleCollection apply(Context context); + } + + /** + * The SecurityUserRuleCollection update stages. + */ + interface UpdateStages { + /** + * The stage of the SecurityUserRuleCollection update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: A description of the security user rule collection.. + * + * @param description A description of the security user rule collection. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the SecurityUserRuleCollection update allowing to specify appliesToGroups. + */ + interface WithAppliesToGroups { + /** + * Specifies the appliesToGroups property: Groups for configuration. + * + * @param appliesToGroups Groups for configuration. + * @return the next definition stage. + */ + Update withAppliesToGroups(List appliesToGroups); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SecurityUserRuleCollection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SecurityUserRuleCollection refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollectionListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollectionListResult.java new file mode 100644 index 0000000000000..4132c32e92f50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollectionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleCollectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Security user configuration rule collection list result. + */ +@Fluent +public final class SecurityUserRuleCollectionListResult + implements JsonSerializable { + /* + * A list of network manager security user configuration rule collections + */ + private List value; + + /* + * Gets the URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of SecurityUserRuleCollectionListResult class. + */ + public SecurityUserRuleCollectionListResult() { + } + + /** + * Get the value property: A list of network manager security user configuration rule collections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of network manager security user configuration rule collections. + * + * @param value the value value to set. + * @return the SecurityUserRuleCollectionListResult object itself. + */ + public SecurityUserRuleCollectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the SecurityUserRuleCollectionListResult object itself. + */ + public SecurityUserRuleCollectionListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserRuleCollectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserRuleCollectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityUserRuleCollectionListResult. + */ + public static SecurityUserRuleCollectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserRuleCollectionListResult deserializedSecurityUserRuleCollectionListResult + = new SecurityUserRuleCollectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecurityUserRuleCollectionInner.fromJson(reader1)); + deserializedSecurityUserRuleCollectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityUserRuleCollectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserRuleCollectionListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollections.java new file mode 100644 index 0000000000000..07cb14c925325 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleCollections.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SecurityUserRuleCollections. + */ +public interface SecurityUserRuleCollections { + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security 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 security user configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName); + + /** + * Lists all the security user rule collections in a security configuration, in a paginated format. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user configuration rule collection list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, + String configurationName, Integer top, String skipToken, Context context); + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security user configuration rule collection along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, Context context); + + /** + * Gets a network manager security user configuration rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 manager security user configuration rule collection. + */ + SecurityUserRuleCollection get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Deletes a Security User Rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName, Boolean force, Context context); + + /** + * Gets a network manager security user configuration rule collection. + * + * @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 network manager security user configuration rule collection along with {@link Response}. + */ + SecurityUserRuleCollection getById(String id); + + /** + * Gets a network manager security user configuration rule collection. + * + * @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 network manager security user configuration rule collection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Security User Rule collection. + * + * @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 Security User Rule collection. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new SecurityUserRuleCollection resource. + * + * @param name resource name. + * @return the first stage of the new SecurityUserRuleCollection definition. + */ + SecurityUserRuleCollection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleListResult.java new file mode 100644 index 0000000000000..8aff2e3bc4519 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRuleListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityUserRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * security user rule list result. + */ +@Fluent +public final class SecurityUserRuleListResult implements JsonSerializable { + /* + * A list of security user rules + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of SecurityUserRuleListResult class. + */ + public SecurityUserRuleListResult() { + } + + /** + * Get the value property: A list of security user rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of security user rules. + * + * @param value the value value to set. + * @return the SecurityUserRuleListResult object itself. + */ + public SecurityUserRuleListResult 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 SecurityUserRuleListResult object itself. + */ + public SecurityUserRuleListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecurityUserRuleListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecurityUserRuleListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SecurityUserRuleListResult. + */ + public static SecurityUserRuleListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecurityUserRuleListResult deserializedSecurityUserRuleListResult = new SecurityUserRuleListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SecurityUserRuleInner.fromJson(reader1)); + deserializedSecurityUserRuleListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecurityUserRuleListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecurityUserRuleListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRules.java new file mode 100644 index 0000000000000..6d2305cca8f62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SecurityUserRules.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 SecurityUserRules. + */ +public interface SecurityUserRules { + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName); + + /** + * Lists all Security User Rules in a rule collection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 user rule list result as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, Integer top, String skipToken, Context context); + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, + String configurationName, String ruleCollectionName, String ruleName, Context context); + + /** + * Gets a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 a security user rule. + */ + SecurityUserRule get(String resourceGroupName, String networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName); + + /** + * Deletes a security user rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param networkManagerName The name of the network manager. + * @param configurationName The name of the network manager Security Configuration. + * @param ruleCollectionName The name of the network manager security Configuration rule collection. + * @param ruleName The name of the rule. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String configurationName, + String ruleCollectionName, String ruleName, Boolean force, Context context); + + /** + * Gets a security user 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 a security user rule along with {@link Response}. + */ + SecurityUserRule getById(String id); + + /** + * Gets a security user 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 a security user rule along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a security user 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 security user rule. + * + * @param id the resource ID. + * @param force Deletes the resource even if it is part of a deployed configuration. If the configuration has been + * deployed, the service will do a cleanup deployment in the background, prior to the delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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, Boolean force, Context context); + + /** + * Begins definition for a new SecurityUserRule resource. + * + * @param name resource name. + * @return the first stage of the new SecurityUserRule definition. + */ + SecurityUserRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SensitivityType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SensitivityType.java new file mode 100644 index 0000000000000..2af853349b62d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SensitivityType.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 java.util.Collection; + +/** + * Defines the sensitivity for the rule. + */ +public final class SensitivityType extends ExpandableStringEnum { + /** + * Static value None for SensitivityType. + */ + public static final SensitivityType NONE = fromString("None"); + + /** + * Static value Low for SensitivityType. + */ + public static final SensitivityType LOW = fromString("Low"); + + /** + * Static value Medium for SensitivityType. + */ + public static final SensitivityType MEDIUM = fromString("Medium"); + + /** + * Static value High for SensitivityType. + */ + public static final SensitivityType HIGH = fromString("High"); + + /** + * Creates a new instance of SensitivityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SensitivityType() { + } + + /** + * Creates or finds a SensitivityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SensitivityType. + */ + public static SensitivityType fromString(String name) { + return fromString(name, SensitivityType.class); + } + + /** + * Gets known SensitivityType values. + * + * @return known SensitivityType values. + */ + public static Collection values() { + return values(SensitivityType.class); + } +} 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..5a3b3727951b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLink.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceAssociationLinkPropertiesFormat; +import java.io.IOException; +import java.util.List; + +/** + * ServiceAssociationLink resource. + */ +@Fluent +public final class ServiceAssociationLink extends SubResource { + /* + * Resource navigation link properties format. + */ + private ServiceAssociationLinkPropertiesFormat innerProperties; + + /* + * Name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Resource type. + */ + private String type; + + /** + * Creates an instance of ServiceAssociationLink class. + */ + public ServiceAssociationLink() { + } + + /** + * Get the innerProperties property: Resource navigation link properties format. + * + * @return the innerProperties value. + */ + private ServiceAssociationLinkPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceAssociationLink withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the linkedResourceType property: Resource type of the linked resource. + * + * @return the linkedResourceType value. + */ + public String linkedResourceType() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceAssociationLinkPropertiesFormat(); + } + this.innerProperties().withLinkedResourceType(linkedResourceType); + return this; + } + + /** + * Get the link property: Link to the external resource. + * + * @return the link value. + */ + public String link() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceAssociationLinkPropertiesFormat(); + } + this.innerProperties().withLink(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the allowDelete property: If true, the resource can be deleted. + * + * @return the allowDelete value. + */ + public Boolean allowDelete() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceAssociationLinkPropertiesFormat(); + } + this.innerProperties().withAllowDelete(allowDelete); + return this; + } + + /** + * Get the locations property: A list of locations. + * + * @return the locations value. + */ + public List locations() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceAssociationLinkPropertiesFormat(); + } + this.innerProperties().withLocations(locations); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceAssociationLink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceAssociationLink if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceAssociationLink. + */ + public static ServiceAssociationLink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceAssociationLink deserializedServiceAssociationLink = new ServiceAssociationLink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedServiceAssociationLink.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedServiceAssociationLink.innerProperties + = ServiceAssociationLinkPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedServiceAssociationLink.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedServiceAssociationLink.etag = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedServiceAssociationLink.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceAssociationLink; + }); + } +} 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..c3c9d2e845865 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinks.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String virtualNetworkName, + String subnetName, 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 com.azure.core.management.exception.ManagementException 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); +} 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..9bcec09104b1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceAssociationLinksListResult.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.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..f51eb7c97d3ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicies.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.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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String serviceEndpointPolicyName, String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..eeb9b0a5da6e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicy.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 serviceAlias property: The alias indicating if the policy belongs to a service. + * + * @return the serviceAlias value. + */ + String serviceAlias(); + + /** + * Gets the contextualServiceEndpointPolicies property: A collection of contextual service endpoint policy. + * + * @return the contextualServiceEndpointPolicies value. + */ + List contextualServiceEndpointPolicies(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithServiceAlias, DefinitionStages.WithContextualServiceEndpointPolicies { + /** + * 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); + } + + /** + * The stage of the ServiceEndpointPolicy definition allowing to specify serviceAlias. + */ + interface WithServiceAlias { + /** + * Specifies the serviceAlias property: The alias indicating if the policy belongs to a service. + * + * @param serviceAlias The alias indicating if the policy belongs to a service. + * @return the next definition stage. + */ + WithCreate withServiceAlias(String serviceAlias); + } + + /** + * The stage of the ServiceEndpointPolicy definition allowing to specify contextualServiceEndpointPolicies. + */ + interface WithContextualServiceEndpointPolicies { + /** + * Specifies the contextualServiceEndpointPolicies property: A collection of contextual service endpoint + * policy.. + * + * @param contextualServiceEndpointPolicies A collection of contextual service endpoint policy. + * @return the next definition stage. + */ + WithCreate withContextualServiceEndpointPolicies(List contextualServiceEndpointPolicies); + } + } + + /** + * 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..1d3c650d76eb5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinition.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 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 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner + * object. + * + * @return the inner object. + */ + ServiceEndpointPolicyDefinitionInner innerModel(); + + /** + * The entirety of the ServiceEndpointPolicyDefinition definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ServiceEndpointPolicyDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ServiceEndpointPolicyDefinition definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ServiceEndpointPolicyDefinition definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceEndpointPolicyName. + * + * @param resourceGroupName The name of the resource group. + * @param serviceEndpointPolicyName The name of the service endpoint policy. + * @return the next definition stage. + */ + WithCreate withExistingServiceEndpointPolicy(String resourceGroupName, String serviceEndpointPolicyName); + } + + /** + * The stage of the ServiceEndpointPolicyDefinition 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.WithService, DefinitionStages.WithServiceResources { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServiceEndpointPolicyDefinition create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServiceEndpointPolicyDefinition create(Context context); + } + + /** + * The stage of the ServiceEndpointPolicyDefinition 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 ServiceEndpointPolicyDefinition 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 ServiceEndpointPolicyDefinition 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 ServiceEndpointPolicyDefinition definition allowing to specify service. + */ + interface WithService { + /** + * Specifies the service property: Service endpoint name.. + * + * @param service Service endpoint name. + * @return the next definition stage. + */ + WithCreate withService(String service); + } + + /** + * The stage of the ServiceEndpointPolicyDefinition definition allowing to specify serviceResources. + */ + interface WithServiceResources { + /** + * Specifies the serviceResources property: A list of service resources.. + * + * @param serviceResources A list of service resources. + * @return the next definition stage. + */ + WithCreate withServiceResources(List serviceResources); + } + } + + /** + * Begins update for the ServiceEndpointPolicyDefinition resource. + * + * @return the stage of resource update. + */ + ServiceEndpointPolicyDefinition.Update update(); + + /** + * The template for ServiceEndpointPolicyDefinition update. + */ + interface Update extends UpdateStages.WithName, UpdateStages.WithType, UpdateStages.WithDescription, + UpdateStages.WithService, UpdateStages.WithServiceResources { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServiceEndpointPolicyDefinition apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServiceEndpointPolicyDefinition apply(Context context); + } + + /** + * The ServiceEndpointPolicyDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the ServiceEndpointPolicyDefinition 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 ServiceEndpointPolicyDefinition 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 ServiceEndpointPolicyDefinition 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 ServiceEndpointPolicyDefinition update allowing to specify service. + */ + interface WithService { + /** + * Specifies the service property: Service endpoint name.. + * + * @param service Service endpoint name. + * @return the next definition stage. + */ + Update withService(String service); + } + + /** + * The stage of the ServiceEndpointPolicyDefinition update allowing to specify serviceResources. + */ + interface WithServiceResources { + /** + * Specifies the serviceResources property: A list of service resources.. + * + * @param serviceResources A list of service resources. + * @return the next definition stage. + */ + Update withServiceResources(List serviceResources); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServiceEndpointPolicyDefinition refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServiceEndpointPolicyDefinition refresh(Context context); +} 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..37c24736b6d4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitionListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * The service endpoint policy definition in a service endpoint policy. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ServiceEndpointPolicyDefinitionListResult class. + */ + public ServiceEndpointPolicyDefinitionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceEndpointPolicyDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceEndpointPolicyDefinitionListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceEndpointPolicyDefinitionListResult. + */ + public static ServiceEndpointPolicyDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceEndpointPolicyDefinitionListResult deserializedServiceEndpointPolicyDefinitionListResult + = new ServiceEndpointPolicyDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServiceEndpointPolicyDefinitionInner.fromJson(reader1)); + deserializedServiceEndpointPolicyDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServiceEndpointPolicyDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceEndpointPolicyDefinitionListResult; + }); + } +} 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..4516e44f624e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyDefinitions.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with + * {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + String serviceEndpointPolicyName, Context context); + + /** + * Get the specified service endpoint policy definitions from 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. + * @return the specified service endpoint policy definitions from service endpoint policy along with + * {@link Response}. + */ + ServiceEndpointPolicyDefinition getById(String id); + + /** + * Get the specified service endpoint policy definitions from 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. + * @return the specified service endpoint policy definitions from service endpoint policy along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified ServiceEndpoint policy definitions. + * + * @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 ServiceEndpoint policy definitions. + * + * @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 ServiceEndpointPolicyDefinition resource. + * + * @param name resource name. + * @return the first stage of the new ServiceEndpointPolicyDefinition definition. + */ + ServiceEndpointPolicyDefinition.DefinitionStages.Blank define(String name); +} 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..884d81fe18945 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPolicyListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListServiceEndpointPolicies API service call. + */ +@Fluent +public final class ServiceEndpointPolicyListResult implements JsonSerializable { + /* + * A list of ServiceEndpointPolicy resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ServiceEndpointPolicyListResult class. + */ + public ServiceEndpointPolicyListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceEndpointPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceEndpointPolicyListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceEndpointPolicyListResult. + */ + public static ServiceEndpointPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceEndpointPolicyListResult deserializedServiceEndpointPolicyListResult + = new ServiceEndpointPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServiceEndpointPolicyInner.fromJson(reader1)); + deserializedServiceEndpointPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServiceEndpointPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceEndpointPolicyListResult; + }); + } +} 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..fe81bab17c5ba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceEndpointPropertiesFormat.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The service endpoint properties. + */ +@Fluent +public final class ServiceEndpointPropertiesFormat implements JsonSerializable { + /* + * The type of the endpoint service. + */ + private String service; + + /* + * SubResource as network identifier. + */ + private SubResource networkIdentifier; + + /* + * A list of locations. + */ + private List locations; + + /* + * The provisioning state of the service endpoint resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of ServiceEndpointPropertiesFormat class. + */ + public ServiceEndpointPropertiesFormat() { + } + + /** + * 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 networkIdentifier property: SubResource as network identifier. + * + * @return the networkIdentifier value. + */ + public SubResource networkIdentifier() { + return this.networkIdentifier; + } + + /** + * Set the networkIdentifier property: SubResource as network identifier. + * + * @param networkIdentifier the networkIdentifier value to set. + * @return the ServiceEndpointPropertiesFormat object itself. + */ + public ServiceEndpointPropertiesFormat withNetworkIdentifier(SubResource networkIdentifier) { + this.networkIdentifier = networkIdentifier; + 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("service", this.service); + jsonWriter.writeJsonField("networkIdentifier", this.networkIdentifier); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceEndpointPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceEndpointPropertiesFormat if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceEndpointPropertiesFormat. + */ + public static ServiceEndpointPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceEndpointPropertiesFormat deserializedServiceEndpointPropertiesFormat + = new ServiceEndpointPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("service".equals(fieldName)) { + deserializedServiceEndpointPropertiesFormat.service = reader.getString(); + } else if ("networkIdentifier".equals(fieldName)) { + deserializedServiceEndpointPropertiesFormat.networkIdentifier = SubResource.fromJson(reader); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceEndpointPropertiesFormat.locations = locations; + } else if ("provisioningState".equals(fieldName)) { + deserializedServiceEndpointPropertiesFormat.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceEndpointPropertiesFormat; + }); + } +} 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..0405375850aa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceProviderProvisioningState.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 java.util.Collection; + +/** + * The ServiceProviderProvisioningState state of the resource. + */ +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 a new instance of ServiceProviderProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServiceProviderProvisioningState() { + } + + /** + * Creates or finds a ServiceProviderProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceProviderProvisioningState. + */ + public static ServiceProviderProvisioningState fromString(String name) { + return fromString(name, ServiceProviderProvisioningState.class); + } + + /** + * Gets known ServiceProviderProvisioningState values. + * + * @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..a10a8f4968819 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformation.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.ServiceTagInformationInner; + +/** + * An immutable client-side representation of ServiceTagInformation. + */ +public interface ServiceTagInformation { + /** + * Gets the properties property: Properties of the service tag information. + * + * @return the properties value. + */ + ServiceTagInformationPropertiesFormat properties(); + + /** + * Gets the name property: The name of service tag. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: The ID of service tag. + * + * @return the id value. + */ + String id(); + + /** + * Gets the serviceTagChangeNumber property: The iteration number of service tag object for region. + * + * @return the serviceTagChangeNumber value. + */ + String serviceTagChangeNumber(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.ServiceTagInformationInner object. + * + * @return the inner object. + */ + ServiceTagInformationInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationListResult.java new file mode 100644 index 0000000000000..d0c68102b5942 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.ServiceTagInformationInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for Get ServiceTagInformation API service call. Retrieves the list of service tag information resources. + */ +@Fluent +public final class ServiceTagInformationListResult implements JsonSerializable { + /* + * The list of service tag information resources. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of ServiceTagInformationListResult class. + */ + public ServiceTagInformationListResult() { + } + + /** + * Get the value property: The list of service tag information resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of service tag information resources. + * + * @param value the value value to set. + * @return the ServiceTagInformationListResult object itself. + */ + public ServiceTagInformationListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagInformationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagInformationListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagInformationListResult. + */ + public static ServiceTagInformationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagInformationListResult deserializedServiceTagInformationListResult + = new ServiceTagInformationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ServiceTagInformationInner.fromJson(reader1)); + deserializedServiceTagInformationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServiceTagInformationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagInformationListResult; + }); + } +} 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..88e25baadd696 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformationPropertiesFormat.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the service tag information. + */ +@Immutable +public final class ServiceTagInformationPropertiesFormat + implements JsonSerializable { + /* + * The iteration number of service tag. + */ + private String changeNumber; + + /* + * The region of service tag. + */ + private String region; + + /* + * The name of system service. + */ + private String systemService; + + /* + * The list of IP address prefixes. + */ + private List addressPrefixes; + + /* + * The state of the service tag. + */ + private String state; + + /** + * Creates an instance of ServiceTagInformationPropertiesFormat class. + */ + public ServiceTagInformationPropertiesFormat() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagInformationPropertiesFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagInformationPropertiesFormat if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagInformationPropertiesFormat. + */ + public static ServiceTagInformationPropertiesFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagInformationPropertiesFormat deserializedServiceTagInformationPropertiesFormat + = new ServiceTagInformationPropertiesFormat(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("changeNumber".equals(fieldName)) { + deserializedServiceTagInformationPropertiesFormat.changeNumber = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedServiceTagInformationPropertiesFormat.region = reader.getString(); + } else if ("systemService".equals(fieldName)) { + deserializedServiceTagInformationPropertiesFormat.systemService = reader.getString(); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceTagInformationPropertiesFormat.addressPrefixes = addressPrefixes; + } else if ("state".equals(fieldName)) { + deserializedServiceTagInformationPropertiesFormat.state = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagInformationPropertiesFormat; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformations.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformations.java new file mode 100644 index 0000000000000..8df91c4b02d14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagInformations.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.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of ServiceTagInformations. + */ +public interface ServiceTagInformations { + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 with pagination as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location); + + /** + * Gets a list of service tag information resources with pagination. + * + * @param location The location that will be used as a reference for cloud (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 noAddressPrefixes Do not return address prefixes for the tag(s). + * @param tagName Return tag information for a particular tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 with pagination as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String location, Boolean noAddressPrefixes, String tagName, + Context context); +} 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..2540c3f96e7e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTags.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.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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response listWithResponse(String location, 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 com.azure.core.management.exception.ManagementException 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); +} 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..c1e9778a4a294 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/ServiceTagsListResult.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.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..ff7772470d13b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SessionIds.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of session IDs. + */ +@Fluent +public final class SessionIds implements JsonSerializable { + /* + * List of session IDs. + */ + private List sessionIds; + + /** + * Creates an instance of SessionIds class. + */ + public 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sessionIds", this.sessionIds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SessionIds from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SessionIds if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the SessionIds. + */ + public static SessionIds fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SessionIds deserializedSessionIds = new SessionIds(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sessionIds".equals(fieldName)) { + List sessionIds = reader.readArray(reader1 -> reader1.getString()); + deserializedSessionIds.sessionIds = sessionIds; + } else { + reader.skipChildren(); + } + } + + return deserializedSessionIds; + }); + } +} 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..0d21aec6ae409 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Severity.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The severity of the issue. + */ +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 a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @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/SharedKeyProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SharedKeyProperties.java new file mode 100644 index 0000000000000..97e67c816c478 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SharedKeyProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters for SharedKey. + */ +@Fluent +public final class SharedKeyProperties implements JsonSerializable { + /* + * The value of the shared key for the vpn link connection. + */ + private String sharedKey; + + /* + * The length of the shared key for the vpn link connection. + */ + private Integer sharedKeyLength; + + /* + * The provisioning state of the SharedKey resource. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of SharedKeyProperties class. + */ + public SharedKeyProperties() { + } + + /** + * Get the sharedKey property: The value of the shared key for the vpn link connection. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: The value of the shared key for the vpn link connection. + * + * @param sharedKey the sharedKey value to set. + * @return the SharedKeyProperties object itself. + */ + public SharedKeyProperties withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Get the sharedKeyLength property: The length of the shared key for the vpn link connection. + * + * @return the sharedKeyLength value. + */ + public Integer sharedKeyLength() { + return this.sharedKeyLength; + } + + /** + * Set the sharedKeyLength property: The length of the shared key for the vpn link connection. + * + * @param sharedKeyLength the sharedKeyLength value to set. + * @return the SharedKeyProperties object itself. + */ + public SharedKeyProperties withSharedKeyLength(Integer sharedKeyLength) { + this.sharedKeyLength = sharedKeyLength; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the SharedKey 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sharedKey", this.sharedKey); + jsonWriter.writeNumberField("sharedKeyLength", this.sharedKeyLength); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SharedKeyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SharedKeyProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SharedKeyProperties. + */ + public static SharedKeyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SharedKeyProperties deserializedSharedKeyProperties = new SharedKeyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sharedKey".equals(fieldName)) { + deserializedSharedKeyProperties.sharedKey = reader.getString(); + } else if ("sharedKeyLength".equals(fieldName)) { + deserializedSharedKeyProperties.sharedKeyLength = reader.getNullable(JsonReader::getInt); + } else if ("provisioningState".equals(fieldName)) { + deserializedSharedKeyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSharedKeyProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SharingScope.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SharingScope.java new file mode 100644 index 0000000000000..af7e9a691fe7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SharingScope.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 java.util.Collection; + +/** + * Set this property to Tenant to allow sharing subnet with other subscriptions in your AAD tenant. This property can + * only be set if defaultOutboundAccess is set to false, both properties can only be set if subnet is empty. + */ +public final class SharingScope extends ExpandableStringEnum { + /** + * Static value Tenant for SharingScope. + */ + public static final SharingScope TENANT = fromString("Tenant"); + + /** + * Static value DelegatedServices for SharingScope. + */ + public static final SharingScope DELEGATED_SERVICES = fromString("DelegatedServices"); + + /** + * Creates a new instance of SharingScope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SharingScope() { + } + + /** + * Creates or finds a SharingScope from its string representation. + * + * @param name a name to look for. + * @return the corresponding SharingScope. + */ + public static SharingScope fromString(String name) { + return fromString(name, SharingScope.class); + } + + /** + * Gets known SharingScope values. + * + * @return known SharingScope values. + */ + public static Collection values() { + return values(SharingScope.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesQuery.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesQuery.java new file mode 100644 index 0000000000000..57a6c83d734f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesQuery.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes the filter values possibles for a given column. + */ +@Fluent +public final class SignatureOverridesFilterValuesQuery + implements JsonSerializable { + /* + * Describes the name of the column which values will be returned + */ + private String filterName; + + /** + * Creates an instance of SignatureOverridesFilterValuesQuery class. + */ + public SignatureOverridesFilterValuesQuery() { + } + + /** + * Get the filterName property: Describes the name of the column which values will be returned. + * + * @return the filterName value. + */ + public String filterName() { + return this.filterName; + } + + /** + * Set the filterName property: Describes the name of the column which values will be returned. + * + * @param filterName the filterName value to set. + * @return the SignatureOverridesFilterValuesQuery object itself. + */ + public SignatureOverridesFilterValuesQuery withFilterName(String filterName) { + this.filterName = filterName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterName", this.filterName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SignatureOverridesFilterValuesQuery from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SignatureOverridesFilterValuesQuery if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SignatureOverridesFilterValuesQuery. + */ + public static SignatureOverridesFilterValuesQuery fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SignatureOverridesFilterValuesQuery deserializedSignatureOverridesFilterValuesQuery + = new SignatureOverridesFilterValuesQuery(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterName".equals(fieldName)) { + deserializedSignatureOverridesFilterValuesQuery.filterName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSignatureOverridesFilterValuesQuery; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesResponse.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesResponse.java new file mode 100644 index 0000000000000..5c76612471678 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignatureOverridesFilterValuesResponse.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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.SignatureOverridesFilterValuesResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of SignatureOverridesFilterValuesResponse. + */ +public interface SignatureOverridesFilterValuesResponse { + /** + * Gets the filterValues property: Describes the possible values. + * + * @return the filterValues value. + */ + List filterValues(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.SignatureOverridesFilterValuesResponseInner object. + * + * @return the inner object. + */ + SignatureOverridesFilterValuesResponseInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverrides.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverrides.java new file mode 100644 index 0000000000000..24d1da94a2e80 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverrides.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.models; + +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; + +/** + * An immutable client-side representation of SignaturesOverrides. + */ +public interface SignaturesOverrides { + /** + * Gets the name property: Contains the name of the resource (default). + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Will contain the resource id of the signature override resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Will contain the type of the resource: + * Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Will contain the properties of the resource (the actual signature overrides). + * + * @return the properties value. + */ + SignaturesOverridesProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner object. + * + * @return the inner object. + */ + SignaturesOverridesInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesList.java new file mode 100644 index 0000000000000..a9ba0fd1c2727 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesList.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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.SignaturesOverridesListInner; +import java.util.List; + +/** + * An immutable client-side representation of SignaturesOverridesList. + */ +public interface SignaturesOverridesList { + /** + * Gets the value property: Describes a list consisting exactly one item describing the policy's signature override + * status. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesListInner object. + * + * @return the inner object. + */ + SignaturesOverridesListInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesProperties.java new file mode 100644 index 0000000000000..0e1af347044a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SignaturesOverridesProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Will contain the properties of the resource (the actual signature overrides). + */ +@Fluent +public final class SignaturesOverridesProperties implements JsonSerializable { + /* + * Dictionary of + */ + private Map signatures; + + /** + * Creates an instance of SignaturesOverridesProperties class. + */ + public SignaturesOverridesProperties() { + } + + /** + * Get the signatures property: Dictionary of <string>. + * + * @return the signatures value. + */ + public Map signatures() { + return this.signatures; + } + + /** + * Set the signatures property: Dictionary of <string>. + * + * @param signatures the signatures value to set. + * @return the SignaturesOverridesProperties object itself. + */ + public SignaturesOverridesProperties withSignatures(Map signatures) { + this.signatures = signatures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("signatures", this.signatures, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SignaturesOverridesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SignaturesOverridesProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SignaturesOverridesProperties. + */ + public static SignaturesOverridesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SignaturesOverridesProperties deserializedSignaturesOverridesProperties + = new SignaturesOverridesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("signatures".equals(fieldName)) { + Map signatures = reader.readMap(reader1 -> reader1.getString()); + deserializedSignaturesOverridesProperties.signatures = signatures; + } else { + reader.skipChildren(); + } + } + + return deserializedSignaturesOverridesProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResult.java new file mode 100644 index 0000000000000..5fe5909ae6473 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SingleQueryResult.java @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The SingleQueryResult model. + */ +@Fluent +public final class SingleQueryResult implements JsonSerializable { + /* + * The ID of the signature + */ + private Integer signatureId; + + /* + * The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny + */ + private FirewallPolicyIdpsSignatureMode mode; + + /* + * Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low + */ + private FirewallPolicyIdpsSignatureSeverity severity; + + /* + * Describes in which direction signature is being enforced: 0 - OutBound, 1 - InBound, 2 - Any, 3 - Internal, 4 - + * InternalOutbound + */ + private FirewallPolicyIdpsSignatureDirection direction; + + /* + * Describes the groups the signature belongs to + */ + private String group; + + /* + * Describes what is the signature enforces + */ + private String description; + + /* + * Describes the protocol the signatures is being enforced in + */ + private String protocol; + + /* + * Describes the list of source ports related to this signature + */ + private List sourcePorts; + + /* + * Describes the list of destination ports related to this signature + */ + private List destinationPorts; + + /* + * Describes the last updated time of the signature (provided from 3rd party vendor) + */ + private String lastUpdated; + + /* + * Describes if this override is inherited from base policy or not + */ + private Boolean inheritedFromParentPolicy; + + /** + * Creates an instance of SingleQueryResult class. + */ + public SingleQueryResult() { + } + + /** + * Get the signatureId property: The ID of the signature. + * + * @return the signatureId value. + */ + public Integer signatureId() { + return this.signatureId; + } + + /** + * Set the signatureId property: The ID of the signature. + * + * @param signatureId the signatureId value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withSignatureId(Integer signatureId) { + this.signatureId = signatureId; + return this; + } + + /** + * Get the mode property: The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny. + * + * @return the mode value. + */ + public FirewallPolicyIdpsSignatureMode mode() { + return this.mode; + } + + /** + * Set the mode property: The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny. + * + * @param mode the mode value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withMode(FirewallPolicyIdpsSignatureMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the severity property: Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low. + * + * @return the severity value. + */ + public FirewallPolicyIdpsSignatureSeverity severity() { + return this.severity; + } + + /** + * Set the severity property: Describes the severity of signature: 1 - High, 2 - Medium, 3 - Low. + * + * @param severity the severity value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withSeverity(FirewallPolicyIdpsSignatureSeverity severity) { + this.severity = severity; + return this; + } + + /** + * Get the direction property: Describes in which direction signature is being enforced: 0 - OutBound, 1 - InBound, + * 2 - Any, 3 - Internal, 4 - InternalOutbound. + * + * @return the direction value. + */ + public FirewallPolicyIdpsSignatureDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Describes in which direction signature is being enforced: 0 - OutBound, 1 - InBound, + * 2 - Any, 3 - Internal, 4 - InternalOutbound. + * + * @param direction the direction value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withDirection(FirewallPolicyIdpsSignatureDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the group property: Describes the groups the signature belongs to. + * + * @return the group value. + */ + public String group() { + return this.group; + } + + /** + * Set the group property: Describes the groups the signature belongs to. + * + * @param group the group value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withGroup(String group) { + this.group = group; + return this; + } + + /** + * Get the description property: Describes what is the signature enforces. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Describes what is the signature enforces. + * + * @param description the description value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the protocol property: Describes the protocol the signatures is being enforced in. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Describes the protocol the signatures is being enforced in. + * + * @param protocol the protocol value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the sourcePorts property: Describes the list of source ports related to this signature. + * + * @return the sourcePorts value. + */ + public List sourcePorts() { + return this.sourcePorts; + } + + /** + * Set the sourcePorts property: Describes the list of source ports related to this signature. + * + * @param sourcePorts the sourcePorts value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withSourcePorts(List sourcePorts) { + this.sourcePorts = sourcePorts; + return this; + } + + /** + * Get the destinationPorts property: Describes the list of destination ports related to this signature. + * + * @return the destinationPorts value. + */ + public List destinationPorts() { + return this.destinationPorts; + } + + /** + * Set the destinationPorts property: Describes the list of destination ports related to this signature. + * + * @param destinationPorts the destinationPorts value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withDestinationPorts(List destinationPorts) { + this.destinationPorts = destinationPorts; + return this; + } + + /** + * Get the lastUpdated property: Describes the last updated time of the signature (provided from 3rd party vendor). + * + * @return the lastUpdated value. + */ + public String lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the lastUpdated property: Describes the last updated time of the signature (provided from 3rd party vendor). + * + * @param lastUpdated the lastUpdated value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withLastUpdated(String lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the inheritedFromParentPolicy property: Describes if this override is inherited from base policy or not. + * + * @return the inheritedFromParentPolicy value. + */ + public Boolean inheritedFromParentPolicy() { + return this.inheritedFromParentPolicy; + } + + /** + * Set the inheritedFromParentPolicy property: Describes if this override is inherited from base policy or not. + * + * @param inheritedFromParentPolicy the inheritedFromParentPolicy value to set. + * @return the SingleQueryResult object itself. + */ + public SingleQueryResult withInheritedFromParentPolicy(Boolean inheritedFromParentPolicy) { + this.inheritedFromParentPolicy = inheritedFromParentPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("signatureId", this.signatureId); + jsonWriter.writeNumberField("mode", this.mode == null ? null : this.mode.toInt()); + jsonWriter.writeNumberField("severity", this.severity == null ? null : this.severity.toInt()); + jsonWriter.writeNumberField("direction", this.direction == null ? null : this.direction.toInt()); + jsonWriter.writeStringField("group", this.group); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeArrayField("sourcePorts", this.sourcePorts, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationPorts", this.destinationPorts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("lastUpdated", this.lastUpdated); + jsonWriter.writeBooleanField("inheritedFromParentPolicy", this.inheritedFromParentPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SingleQueryResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SingleQueryResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SingleQueryResult. + */ + public static SingleQueryResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SingleQueryResult deserializedSingleQueryResult = new SingleQueryResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("signatureId".equals(fieldName)) { + deserializedSingleQueryResult.signatureId = reader.getNullable(JsonReader::getInt); + } else if ("mode".equals(fieldName)) { + deserializedSingleQueryResult.mode = FirewallPolicyIdpsSignatureMode.fromInt(reader.getInt()); + } else if ("severity".equals(fieldName)) { + deserializedSingleQueryResult.severity + = FirewallPolicyIdpsSignatureSeverity.fromInt(reader.getInt()); + } else if ("direction".equals(fieldName)) { + deserializedSingleQueryResult.direction + = FirewallPolicyIdpsSignatureDirection.fromInt(reader.getInt()); + } else if ("group".equals(fieldName)) { + deserializedSingleQueryResult.group = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedSingleQueryResult.description = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedSingleQueryResult.protocol = reader.getString(); + } else if ("sourcePorts".equals(fieldName)) { + List sourcePorts = reader.readArray(reader1 -> reader1.getString()); + deserializedSingleQueryResult.sourcePorts = sourcePorts; + } else if ("destinationPorts".equals(fieldName)) { + List destinationPorts = reader.readArray(reader1 -> reader1.getString()); + deserializedSingleQueryResult.destinationPorts = destinationPorts; + } else if ("lastUpdated".equals(fieldName)) { + deserializedSingleQueryResult.lastUpdated = reader.getString(); + } else if ("inheritedFromParentPolicy".equals(fieldName)) { + deserializedSingleQueryResult.inheritedFromParentPolicy + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSingleQueryResult; + }); + } +} 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..2c5d81195963f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Sku.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The sku of this Bastion Host. + */ +@Fluent +public final class Sku implements JsonSerializable { + /* + * The name of the sku of this Bastion Host. + */ + private BastionHostSkuName name; + + /** + * Creates an instance of Sku class. + */ + public Sku() { + } + + /** + * Get the name property: The name of the sku of this Bastion Host. + * + * @return the name value. + */ + public BastionHostSkuName name() { + return this.name; + } + + /** + * Set the name property: The name of the sku 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = BastionHostSkuName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SlotType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SlotType.java new file mode 100644 index 0000000000000..164daf7d61823 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SlotType.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; + +/** + * Specifies slot info on a cloud service. + */ +public enum SlotType { + /** + * Enum value Production. + */ + PRODUCTION("Production"), + + /** + * Enum value Staging. + */ + STAGING("Staging"); + + /** + * The actual serialized value for a SlotType instance. + */ + private final String value; + + SlotType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SlotType instance. + * + * @param value the serialized value to parse. + * @return the parsed SlotType object, or null if unable to parse. + */ + public static SlotType fromString(String value) { + if (value == null) { + return null; + } + SlotType[] items = SlotType.values(); + for (SlotType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @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/StaticMember.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMember.java new file mode 100644 index 0000000000000..fcdd5f8cca1bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMember.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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.StaticMemberInner; + +/** + * An immutable client-side representation of StaticMember. + */ +public interface StaticMember { + /** + * 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 etag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: The system metadata related to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the resourceId property: Resource Id. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the region property: Resource region. + * + * @return the region value. + */ + String region(); + + /** + * Gets the provisioningState property: The provisioning state of the scope assignment resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.StaticMemberInner object. + * + * @return the inner object. + */ + StaticMemberInner innerModel(); + + /** + * The entirety of the StaticMember definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The StaticMember definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the StaticMember definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the StaticMember definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, networkManagerName, networkGroupName. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @return the next definition stage. + */ + WithCreate withExistingNetworkGroup(String resourceGroupName, String networkManagerName, + String networkGroupName); + } + + /** + * The stage of the StaticMember 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.WithResourceId { + /** + * Executes the create request. + * + * @return the created resource. + */ + StaticMember create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StaticMember create(Context context); + } + + /** + * The stage of the StaticMember definition allowing to specify resourceId. + */ + interface WithResourceId { + /** + * Specifies the resourceId property: Resource Id.. + * + * @param resourceId Resource Id. + * @return the next definition stage. + */ + WithCreate withResourceId(String resourceId); + } + } + + /** + * Begins update for the StaticMember resource. + * + * @return the stage of resource update. + */ + StaticMember.Update update(); + + /** + * The template for StaticMember update. + */ + interface Update extends UpdateStages.WithResourceId { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StaticMember apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StaticMember apply(Context context); + } + + /** + * The StaticMember update stages. + */ + interface UpdateStages { + /** + * The stage of the StaticMember update allowing to specify resourceId. + */ + interface WithResourceId { + /** + * Specifies the resourceId property: Resource Id.. + * + * @param resourceId Resource Id. + * @return the next definition stage. + */ + Update withResourceId(String resourceId); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StaticMember refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StaticMember refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMemberListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMemberListResult.java new file mode 100644 index 0000000000000..7df0429b14086 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMemberListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.StaticMemberInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of the request to list StaticMember. It contains a list of groups and a URL link to get the next set of + * results. + */ +@Fluent +public final class StaticMemberListResult implements JsonSerializable { + /* + * Gets a page of StaticMember + */ + private List value; + + /* + * Gets the URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of StaticMemberListResult class. + */ + public StaticMemberListResult() { + } + + /** + * Get the value property: Gets a page of StaticMember. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets a page of StaticMember. + * + * @param value the value value to set. + * @return the StaticMemberListResult object itself. + */ + public StaticMemberListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the URL to get the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the URL to get the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the StaticMemberListResult object itself. + */ + public StaticMemberListResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StaticMemberListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StaticMemberListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the StaticMemberListResult. + */ + public static StaticMemberListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StaticMemberListResult deserializedStaticMemberListResult = new StaticMemberListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> StaticMemberInner.fromJson(reader1)); + deserializedStaticMemberListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStaticMemberListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStaticMemberListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMembers.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMembers.java new file mode 100644 index 0000000000000..b570bf57ebd95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticMembers.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of StaticMembers. + */ +public interface StaticMembers { + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName, Context context); + + /** + * Gets the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified static member. + */ + StaticMember get(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName); + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String networkManagerName, String networkGroupName, + String staticMemberName, Context context); + + /** + * Deletes a static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param staticMemberName The name of the static member. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 networkManagerName, String networkGroupName, String staticMemberName); + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network 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 StaticMember as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String networkGroupName); + + /** + * Lists the specified static member. + * + * @param resourceGroupName The name of the resource group. + * @param networkManagerName The name of the network manager. + * @param networkGroupName The name of the network group. + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 StaticMember as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String networkManagerName, String networkGroupName, + Integer top, String skipToken, Context context); + + /** + * Gets the specified static member. + * + * @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 static member along with {@link Response}. + */ + StaticMember getById(String id); + + /** + * Gets the specified static member. + * + * @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 static member along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a static member. + * + * @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 static member. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StaticMember resource. + * + * @param name resource name. + * @return the first stage of the new StaticMember definition. + */ + StaticMember.DefinitionStages.Blank define(String name); +} 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..9fb7bd4f065cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoute.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of all Static Routes. + */ +@Fluent +public final class StaticRoute implements JsonSerializable { + /* + * The name of the StaticRoute that is unique within a VnetRoute. + */ + private String name; + + /* + * List of all address prefixes. + */ + private List addressPrefixes; + + /* + * The ip address of the next hop. + */ + private String nextHopIpAddress; + + /** + * Creates an instance of StaticRoute class. + */ + public StaticRoute() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextHopIpAddress", this.nextHopIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StaticRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StaticRoute if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StaticRoute. + */ + public static StaticRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StaticRoute deserializedStaticRoute = new StaticRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedStaticRoute.name = reader.getString(); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedStaticRoute.addressPrefixes = addressPrefixes; + } else if ("nextHopIpAddress".equals(fieldName)) { + deserializedStaticRoute.nextHopIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStaticRoute; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoutesConfig.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoutesConfig.java new file mode 100644 index 0000000000000..326598a43e1b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/StaticRoutesConfig.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Configuration for static routes on this HubVnetConnectionConfiguration for static routes on this HubVnetConnection. + */ +@Fluent +public final class StaticRoutesConfig implements JsonSerializable { + /* + * Boolean indicating whether static routes on this connection are automatically propagate to route tables which + * this connection propagates to. + */ + private Boolean propagateStaticRoutes; + + /* + * Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in spoke. + */ + private VnetLocalRouteOverrideCriteria vnetLocalRouteOverrideCriteria; + + /** + * Creates an instance of StaticRoutesConfig class. + */ + public StaticRoutesConfig() { + } + + /** + * Get the propagateStaticRoutes property: Boolean indicating whether static routes on this connection are + * automatically propagate to route tables which this connection propagates to. + * + * @return the propagateStaticRoutes value. + */ + public Boolean propagateStaticRoutes() { + return this.propagateStaticRoutes; + } + + /** + * Get the vnetLocalRouteOverrideCriteria property: Parameter determining whether NVA in spoke vnet is bypassed for + * traffic with destination in spoke. + * + * @return the vnetLocalRouteOverrideCriteria value. + */ + public VnetLocalRouteOverrideCriteria vnetLocalRouteOverrideCriteria() { + return this.vnetLocalRouteOverrideCriteria; + } + + /** + * Set the vnetLocalRouteOverrideCriteria property: Parameter determining whether NVA in spoke vnet is bypassed for + * traffic with destination in spoke. + * + * @param vnetLocalRouteOverrideCriteria the vnetLocalRouteOverrideCriteria value to set. + * @return the StaticRoutesConfig object itself. + */ + public StaticRoutesConfig + withVnetLocalRouteOverrideCriteria(VnetLocalRouteOverrideCriteria vnetLocalRouteOverrideCriteria) { + this.vnetLocalRouteOverrideCriteria = vnetLocalRouteOverrideCriteria; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vnetLocalRouteOverrideCriteria", + this.vnetLocalRouteOverrideCriteria == null ? null : this.vnetLocalRouteOverrideCriteria.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StaticRoutesConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StaticRoutesConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the StaticRoutesConfig. + */ + public static StaticRoutesConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StaticRoutesConfig deserializedStaticRoutesConfig = new StaticRoutesConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("propagateStaticRoutes".equals(fieldName)) { + deserializedStaticRoutesConfig.propagateStaticRoutes = reader.getNullable(JsonReader::getBoolean); + } else if ("vnetLocalRouteOverrideCriteria".equals(fieldName)) { + deserializedStaticRoutesConfig.vnetLocalRouteOverrideCriteria + = VnetLocalRouteOverrideCriteria.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStaticRoutesConfig; + }); + } +} 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..dd35c01144823 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnet.java @@ -0,0 +1,830 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 sharingScope property: Set this property to Tenant to allow sharing subnet with other subscriptions in + * your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can only + * be set if subnet is empty. + * + * @return the sharingScope value. + */ + SharingScope sharingScope(); + + /** + * Gets the defaultOutboundAccess property: Set this property to false to disable default outbound connectivity for + * all VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for an + * existing subnet. + * + * @return the defaultOutboundAccess value. + */ + Boolean defaultOutboundAccess(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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, DefinitionStages.WithSharingScope, + DefinitionStages.WithDefaultOutboundAccess { + /** + * 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); + } + + /** + * The stage of the Subnet definition allowing to specify sharingScope. + */ + interface WithSharingScope { + /** + * Specifies the sharingScope property: Set this property to Tenant to allow sharing subnet with other + * subscriptions in your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, + * both properties can only be set if subnet is empty.. + * + * @param sharingScope Set this property to Tenant to allow sharing subnet with other subscriptions in your + * AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can + * only be set if subnet is empty. + * @return the next definition stage. + */ + WithCreate withSharingScope(SharingScope sharingScope); + } + + /** + * The stage of the Subnet definition allowing to specify defaultOutboundAccess. + */ + interface WithDefaultOutboundAccess { + /** + * Specifies the defaultOutboundAccess property: Set this property to false to disable default outbound + * connectivity for all VMs in the subnet. This property can only be set at the time of subnet creation and + * cannot be updated for an existing subnet.. + * + * @param defaultOutboundAccess Set this property to false to disable default outbound connectivity for all + * VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for + * an existing subnet. + * @return the next definition stage. + */ + WithCreate withDefaultOutboundAccess(Boolean defaultOutboundAccess); + } + } + + /** + * 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, + UpdateStages.WithSharingScope, UpdateStages.WithDefaultOutboundAccess { + /** + * 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); + } + + /** + * The stage of the Subnet update allowing to specify sharingScope. + */ + interface WithSharingScope { + /** + * Specifies the sharingScope property: Set this property to Tenant to allow sharing subnet with other + * subscriptions in your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, + * both properties can only be set if subnet is empty.. + * + * @param sharingScope Set this property to Tenant to allow sharing subnet with other subscriptions in your + * AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can + * only be set if subnet is empty. + * @return the next definition stage. + */ + Update withSharingScope(SharingScope sharingScope); + } + + /** + * The stage of the Subnet update allowing to specify defaultOutboundAccess. + */ + interface WithDefaultOutboundAccess { + /** + * Specifies the defaultOutboundAccess property: Set this property to false to disable default outbound + * connectivity for all VMs in the subnet. This property can only be set at the time of subnet creation and + * cannot be updated for an existing subnet.. + * + * @param defaultOutboundAccess Set this property to false to disable default outbound connectivity for all + * VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for + * an existing subnet. + * @return the next definition stage. + */ + Update withDefaultOutboundAccess(Boolean defaultOutboundAccess); + } + } + + /** + * 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..cdf13d389492d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetAssociation.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +import java.io.IOException; +import java.util.List; + +/** + * Subnet and it's custom security rules. + */ +@Fluent +public final class SubnetAssociation implements JsonSerializable { + /* + * Subnet ID. + */ + private String id; + + /* + * Collection of custom security rules. + */ + private List securityRules; + + /** + * Creates an instance of SubnetAssociation class. + */ + public SubnetAssociation() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("securityRules", this.securityRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetAssociation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetAssociation. + */ + public static SubnetAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubnetAssociation deserializedSubnetAssociation = new SubnetAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSubnetAssociation.id = reader.getString(); + } else if ("securityRules".equals(fieldName)) { + List securityRules + = reader.readArray(reader1 -> SecurityRuleInner.fromJson(reader1)); + deserializedSubnetAssociation.securityRules = securityRules; + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetAssociation; + }); + } +} 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..2ab920aa29e64 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. + */ +@Fluent +public final class SubnetListResult implements JsonSerializable { + /* + * The subnets in a virtual network. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of SubnetListResult class. + */ + public SubnetListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubnetListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubnetListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SubnetListResult. + */ + public static SubnetListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubnetListResult deserializedSubnetListResult = new SubnetListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SubnetInner.fromJson(reader1)); + deserializedSubnetListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSubnetListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubnetListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetPropertiesFormat.java new file mode 100644 index 0000000000000..c9148319008b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubnetPropertiesFormat.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.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of SubnetPropertiesFormat. + */ +public interface SubnetPropertiesFormat { + /** + * 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 sharingScope property: Set this property to Tenant to allow sharing subnet with other subscriptions in + * your AAD tenant. This property can only be set if defaultOutboundAccess is set to false, both properties can only + * be set if subnet is empty. + * + * @return the sharingScope value. + */ + SharingScope sharingScope(); + + /** + * Gets the defaultOutboundAccess property: Set this property to false to disable default outbound connectivity for + * all VMs in the subnet. This property can only be set at the time of subnet creation and cannot be updated for an + * existing subnet. + * + * @return the defaultOutboundAccess value. + */ + Boolean defaultOutboundAccess(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SubnetPropertiesFormatInner object. + * + * @return the inner object. + */ + SubnetPropertiesFormatInner innerModel(); +} 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..c66b18219b0f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Subnets.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.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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualNetworkName, String subnetName, + String expand, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/SubscriptionNetworkManagerConnections.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubscriptionNetworkManagerConnections.java new file mode 100644 index 0000000000000..6040480bf2e6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SubscriptionNetworkManagerConnections.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of SubscriptionNetworkManagerConnections. + */ +public interface SubscriptionNetworkManagerConnections { + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription along with {@link Response}. + */ + Response getWithResponse(String networkManagerConnectionName, Context context); + + /** + * Get a specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 a specified connection created by this subscription. + */ + NetworkManagerConnection get(String networkManagerConnectionName); + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 {@link Response}. + */ + Response deleteWithResponse(String networkManagerConnectionName, Context context); + + /** + * Delete specified connection created by this subscription. + * + * @param networkManagerConnectionName Name for the network manager 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 networkManagerConnectionName); + + /** + * List all network manager connections created by this 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 network manager connections as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all network manager connections created by this subscription. + * + * @param top An optional query parameter which specifies the maximum number of records to be returned by the + * server. + * @param skipToken SkipToken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies + * a starting point to use for subsequent calls. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 network manager connections as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Integer top, String skipToken, Context context); + + /** + * Get a specified connection created by this subscription. + * + * @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 specified connection created by this subscription along with {@link Response}. + */ + NetworkManagerConnection getById(String id); + + /** + * Get a specified connection created by this subscription. + * + * @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 specified connection created by this subscription along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete specified connection created by this subscription. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete specified connection created by this subscription. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NetworkManagerConnection resource. + * + * @param name resource name. + * @return the first stage of the new NetworkManagerConnection definition. + */ + NetworkManagerConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResource.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResource.java new file mode 100644 index 0000000000000..085c3b6b07545 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResource.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.SwapResourceInner; + +/** + * An immutable client-side representation of SwapResource. + */ +public interface SwapResource { + /** + * 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 properties property: Swap resource properties. + * + * @return the properties value. + */ + SwapResourceProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SwapResourceInner object. + * + * @return the inner object. + */ + SwapResourceInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceListResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceListResult.java new file mode 100644 index 0000000000000..9f94fe399086e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceListResult.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.SwapResourceListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of SwapResourceListResult. + */ +public interface SwapResourceListResult { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.SwapResourceListResultInner object. + * + * @return the inner object. + */ + SwapResourceListResultInner innerModel(); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceProperties.java new file mode 100644 index 0000000000000..039928071e4fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SwapResourceProperties.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Swap resource properties. + */ +@Fluent +public final class SwapResourceProperties implements JsonSerializable { + /* + * Specifies slot info on a cloud service + */ + private SlotType slotType; + + /** + * Creates an instance of SwapResourceProperties class. + */ + public SwapResourceProperties() { + } + + /** + * Get the slotType property: Specifies slot info on a cloud service. + * + * @return the slotType value. + */ + public SlotType slotType() { + return this.slotType; + } + + /** + * Set the slotType property: Specifies slot info on a cloud service. + * + * @param slotType the slotType value to set. + * @return the SwapResourceProperties object itself. + */ + public SwapResourceProperties withSlotType(SlotType slotType) { + this.slotType = slotType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("slotType", this.slotType == null ? null : this.slotType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SwapResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SwapResourceProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SwapResourceProperties. + */ + public static SwapResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SwapResourceProperties deserializedSwapResourceProperties = new SwapResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("slotType".equals(fieldName)) { + deserializedSwapResourceProperties.slotType = SlotType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSwapResourceProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncMode.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncMode.java new file mode 100644 index 0000000000000..7463178ac71ed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Backend address synchronous mode for the backend pool. + */ +public final class SyncMode extends ExpandableStringEnum { + /** + * Static value Automatic for SyncMode. + */ + public static final SyncMode AUTOMATIC = fromString("Automatic"); + + /** + * Static value Manual for SyncMode. + */ + public static final SyncMode MANUAL = fromString("Manual"); + + /** + * Creates a new instance of SyncMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SyncMode() { + } + + /** + * Creates or finds a SyncMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding SyncMode. + */ + public static SyncMode fromString(String name) { + return fromString(name, SyncMode.class); + } + + /** + * Gets known SyncMode values. + * + * @return known SyncMode values. + */ + public static Collection values() { + return values(SyncMode.class); + } +} 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..b3b1ac1bedbc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/SyncRemoteAddressSpace.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 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 a new instance of SyncRemoteAddressSpace value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SyncRemoteAddressSpace() { + } + + /** + * Creates or finds a SyncRemoteAddressSpace from its string representation. + * + * @param name a name to look for. + * @return the corresponding SyncRemoteAddressSpace. + */ + public static SyncRemoteAddressSpace fromString(String name) { + return fromString(name, SyncRemoteAddressSpace.class); + } + + /** + * Gets known SyncRemoteAddressSpace values. + * + * @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..86edc63bf4d09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TagsObject.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Tags object for patch operations. + */ +@Fluent +public final class TagsObject implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of TagsObject class. + */ + public TagsObject() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagsObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagsObject if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the TagsObject. + */ + public static TagsObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagsObject deserializedTagsObject = new TagsObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTagsObject.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedTagsObject; + }); + } +} 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..1acacb7aff59f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Topology.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.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..a18ec7d656470 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyAssociation.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Resources that have an association with the parent resource. + */ +@Fluent +public final class TopologyAssociation implements JsonSerializable { + /* + * The name of the resource that is associated with the parent resource. + */ + private String name; + + /* + * The ID of the resource that is associated with the parent resource. + */ + private String resourceId; + + /* + * The association type of the child resource to the parent resource. + */ + private AssociationType associationType; + + /** + * Creates an instance of TopologyAssociation class. + */ + public TopologyAssociation() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("associationType", + this.associationType == null ? null : this.associationType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TopologyAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TopologyAssociation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TopologyAssociation. + */ + public static TopologyAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TopologyAssociation deserializedTopologyAssociation = new TopologyAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedTopologyAssociation.name = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedTopologyAssociation.resourceId = reader.getString(); + } else if ("associationType".equals(fieldName)) { + deserializedTopologyAssociation.associationType = AssociationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedTopologyAssociation; + }); + } +} 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..8adba6d92ed91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyParameters.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the representation of topology. + */ +@Fluent +public final class TopologyParameters implements JsonSerializable { + /* + * The name of the target resource group to perform topology on. + */ + private String targetResourceGroupName; + + /* + * The reference to the Virtual Network resource. + */ + private SubResource targetVirtualNetwork; + + /* + * The reference to the Subnet resource. + */ + private SubResource targetSubnet; + + /** + * Creates an instance of TopologyParameters class. + */ + public TopologyParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceGroupName", this.targetResourceGroupName); + jsonWriter.writeJsonField("targetVirtualNetwork", this.targetVirtualNetwork); + jsonWriter.writeJsonField("targetSubnet", this.targetSubnet); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TopologyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TopologyParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TopologyParameters. + */ + public static TopologyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TopologyParameters deserializedTopologyParameters = new TopologyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceGroupName".equals(fieldName)) { + deserializedTopologyParameters.targetResourceGroupName = reader.getString(); + } else if ("targetVirtualNetwork".equals(fieldName)) { + deserializedTopologyParameters.targetVirtualNetwork = SubResource.fromJson(reader); + } else if ("targetSubnet".equals(fieldName)) { + deserializedTopologyParameters.targetSubnet = SubResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTopologyParameters; + }); + } +} 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..9ebd21da7410f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TopologyResource.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The network resource topology information for the given resource group. + */ +@Fluent +public final class TopologyResource implements JsonSerializable { + /* + * Name of the resource. + */ + private String name; + + /* + * ID of the resource. + */ + private String id; + + /* + * Resource location. + */ + private String location; + + /* + * Holds the associations the resource has with other resources in the resource group. + */ + private List associations; + + /** + * Creates an instance of TopologyResource class. + */ + public TopologyResource() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeArrayField("associations", this.associations, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TopologyResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TopologyResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TopologyResource. + */ + public static TopologyResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TopologyResource deserializedTopologyResource = new TopologyResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedTopologyResource.name = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedTopologyResource.id = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedTopologyResource.location = reader.getString(); + } else if ("associations".equals(fieldName)) { + List associations + = reader.readArray(reader1 -> TopologyAssociation.fromJson(reader1)); + deserializedTopologyResource.associations = associations; + } else { + reader.skipChildren(); + } + } + + return deserializedTopologyResource; + }); + } +} 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..85dcc25bb2168 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsConfigurationProperties.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the configuration of traffic analytics. + */ +@Fluent +public final class TrafficAnalyticsConfigurationProperties + implements JsonSerializable { + /* + * Flag to enable/disable traffic analytics. + */ + private Boolean enabled; + + /* + * The resource guid of the attached workspace. + */ + private String workspaceId; + + /* + * The location of the attached workspace. + */ + private String workspaceRegion; + + /* + * Resource Id of the attached workspace. + */ + private String workspaceResourceId; + + /* + * The interval in minutes which would decide how frequently TA service should do flow analytics. + */ + private Integer trafficAnalyticsInterval; + + /** + * Creates an instance of TrafficAnalyticsConfigurationProperties class. + */ + public TrafficAnalyticsConfigurationProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("workspaceId", this.workspaceId); + jsonWriter.writeStringField("workspaceRegion", this.workspaceRegion); + jsonWriter.writeStringField("workspaceResourceId", this.workspaceResourceId); + jsonWriter.writeNumberField("trafficAnalyticsInterval", this.trafficAnalyticsInterval); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrafficAnalyticsConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrafficAnalyticsConfigurationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TrafficAnalyticsConfigurationProperties. + */ + public static TrafficAnalyticsConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrafficAnalyticsConfigurationProperties deserializedTrafficAnalyticsConfigurationProperties + = new TrafficAnalyticsConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedTrafficAnalyticsConfigurationProperties.enabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("workspaceId".equals(fieldName)) { + deserializedTrafficAnalyticsConfigurationProperties.workspaceId = reader.getString(); + } else if ("workspaceRegion".equals(fieldName)) { + deserializedTrafficAnalyticsConfigurationProperties.workspaceRegion = reader.getString(); + } else if ("workspaceResourceId".equals(fieldName)) { + deserializedTrafficAnalyticsConfigurationProperties.workspaceResourceId = reader.getString(); + } else if ("trafficAnalyticsInterval".equals(fieldName)) { + deserializedTrafficAnalyticsConfigurationProperties.trafficAnalyticsInterval + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTrafficAnalyticsConfigurationProperties; + }); + } +} 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..e8e8404427b90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficAnalyticsProperties.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the configuration of traffic analytics. + */ +@Fluent +public final class TrafficAnalyticsProperties implements JsonSerializable { + /* + * Parameters that define the configuration of traffic analytics. + */ + private TrafficAnalyticsConfigurationProperties networkWatcherFlowAnalyticsConfiguration; + + /** + * Creates an instance of TrafficAnalyticsProperties class. + */ + public TrafficAnalyticsProperties() { + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkWatcherFlowAnalyticsConfiguration", + this.networkWatcherFlowAnalyticsConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrafficAnalyticsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrafficAnalyticsProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TrafficAnalyticsProperties. + */ + public static TrafficAnalyticsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrafficAnalyticsProperties deserializedTrafficAnalyticsProperties = new TrafficAnalyticsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("networkWatcherFlowAnalyticsConfiguration".equals(fieldName)) { + deserializedTrafficAnalyticsProperties.networkWatcherFlowAnalyticsConfiguration + = TrafficAnalyticsConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTrafficAnalyticsProperties; + }); + } +} 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..e93a76a652cbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TrafficSelectorPolicy.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An traffic selector policy for a virtual network gateway connection. + */ +@Fluent +public final class TrafficSelectorPolicy implements JsonSerializable { + /* + * A collection of local address spaces in CIDR format. + */ + private List localAddressRanges; + + /* + * A collection of remote address spaces in CIDR format. + */ + private List remoteAddressRanges; + + /** + * Creates an instance of TrafficSelectorPolicy class. + */ + public TrafficSelectorPolicy() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property localAddressRanges in model TrafficSelectorPolicy")); + } + if (remoteAddressRanges() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property remoteAddressRanges in model TrafficSelectorPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TrafficSelectorPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("localAddressRanges", this.localAddressRanges, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("remoteAddressRanges", this.remoteAddressRanges, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrafficSelectorPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrafficSelectorPolicy if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TrafficSelectorPolicy. + */ + public static TrafficSelectorPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrafficSelectorPolicy deserializedTrafficSelectorPolicy = new TrafficSelectorPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("localAddressRanges".equals(fieldName)) { + List localAddressRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedTrafficSelectorPolicy.localAddressRanges = localAddressRanges; + } else if ("remoteAddressRanges".equals(fieldName)) { + List remoteAddressRanges = reader.readArray(reader1 -> reader1.getString()); + deserializedTrafficSelectorPolicy.remoteAddressRanges = remoteAddressRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedTrafficSelectorPolicy; + }); + } +} 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..90567be90959a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TransportProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The transport protocol for the endpoint. + */ +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 a new instance of TransportProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TransportProtocol() { + } + + /** + * Creates or finds a TransportProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransportProtocol. + */ + public static TransportProtocol fromString(String name) { + return fromString(name, TransportProtocol.class); + } + + /** + * Gets known TransportProtocol values. + * + * @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..036417e513af5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingDetails.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Information gained from troubleshooting of specified resource. + */ +@Fluent +public final class TroubleshootingDetails implements JsonSerializable { + /* + * The id of the get troubleshoot operation. + */ + private String id; + + /* + * Reason type of failure. + */ + private String reasonType; + + /* + * A summary of troubleshooting. + */ + private String summary; + + /* + * Details on troubleshooting results. + */ + private String detail; + + /* + * List of recommended actions. + */ + private List recommendedActions; + + /** + * Creates an instance of TroubleshootingDetails class. + */ + public TroubleshootingDetails() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("reasonType", this.reasonType); + jsonWriter.writeStringField("summary", this.summary); + jsonWriter.writeStringField("detail", this.detail); + jsonWriter.writeArrayField("recommendedActions", this.recommendedActions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TroubleshootingDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TroubleshootingDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TroubleshootingDetails. + */ + public static TroubleshootingDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TroubleshootingDetails deserializedTroubleshootingDetails = new TroubleshootingDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTroubleshootingDetails.id = reader.getString(); + } else if ("reasonType".equals(fieldName)) { + deserializedTroubleshootingDetails.reasonType = reader.getString(); + } else if ("summary".equals(fieldName)) { + deserializedTroubleshootingDetails.summary = reader.getString(); + } else if ("detail".equals(fieldName)) { + deserializedTroubleshootingDetails.detail = reader.getString(); + } else if ("recommendedActions".equals(fieldName)) { + List recommendedActions + = reader.readArray(reader1 -> TroubleshootingRecommendedActions.fromJson(reader1)); + deserializedTroubleshootingDetails.recommendedActions = recommendedActions; + } else { + reader.skipChildren(); + } + } + + return deserializedTroubleshootingDetails; + }); + } +} 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..e1c78c2868ccd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.TroubleshootingProperties; +import java.io.IOException; + +/** + * Parameters that define the resource to troubleshoot. + */ +@Fluent +public final class TroubleshootingParameters implements JsonSerializable { + /* + * The target resource to troubleshoot. + */ + private String targetResourceId; + + /* + * Properties of the troubleshooting resource. + */ + private TroubleshootingProperties innerProperties = new TroubleshootingProperties(); + + /** + * Creates an instance of TroubleshootingParameters class. + */ + public TroubleshootingParameters() { + } + + /** + * 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 innerProperties property: Properties of the troubleshooting resource. + * + * @return the innerProperties value. + */ + private TroubleshootingProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the storageId property: The ID for the storage account to save the troubleshoot result. + * + * @return the storageId value. + */ + public String storageId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TroubleshootingProperties(); + } + this.innerProperties().withStorageId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new TroubleshootingProperties(); + } + this.innerProperties().withStoragePath(storagePath); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (targetResourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model TroubleshootingParameters")); + } + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model TroubleshootingParameters")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TroubleshootingParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TroubleshootingParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TroubleshootingParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TroubleshootingParameters. + */ + public static TroubleshootingParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TroubleshootingParameters deserializedTroubleshootingParameters = new TroubleshootingParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedTroubleshootingParameters.targetResourceId = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTroubleshootingParameters.innerProperties = TroubleshootingProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTroubleshootingParameters; + }); + } +} 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..e88ac0fd2f150 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingRecommendedActions.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Recommended actions based on discovered issues. + */ +@Fluent +public final class TroubleshootingRecommendedActions implements JsonSerializable { + /* + * ID of the recommended action. + */ + private String actionId; + + /* + * Description of recommended actions. + */ + private String actionText; + + /* + * The uri linking to a documentation for the recommended troubleshooting actions. + */ + private String actionUri; + + /* + * The information from the URI for the recommended troubleshooting actions. + */ + private String actionUriText; + + /** + * Creates an instance of TroubleshootingRecommendedActions class. + */ + public TroubleshootingRecommendedActions() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionId", this.actionId); + jsonWriter.writeStringField("actionText", this.actionText); + jsonWriter.writeStringField("actionUri", this.actionUri); + jsonWriter.writeStringField("actionUriText", this.actionUriText); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TroubleshootingRecommendedActions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TroubleshootingRecommendedActions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TroubleshootingRecommendedActions. + */ + public static TroubleshootingRecommendedActions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TroubleshootingRecommendedActions deserializedTroubleshootingRecommendedActions + = new TroubleshootingRecommendedActions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionId".equals(fieldName)) { + deserializedTroubleshootingRecommendedActions.actionId = reader.getString(); + } else if ("actionText".equals(fieldName)) { + deserializedTroubleshootingRecommendedActions.actionText = reader.getString(); + } else if ("actionUri".equals(fieldName)) { + deserializedTroubleshootingRecommendedActions.actionUri = reader.getString(); + } else if ("actionUriText".equals(fieldName)) { + deserializedTroubleshootingRecommendedActions.actionUriText = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTroubleshootingRecommendedActions; + }); + } +} 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..5d0d6d6a262e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TroubleshootingResult.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.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..ccb680d8a7e6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/TunnelConnectionHealth.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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VirtualNetworkGatewayConnection properties. + */ +@Immutable +public final class TunnelConnectionHealth implements JsonSerializable { + /* + * Tunnel name. + */ + private String tunnel; + + /* + * Virtual Network Gateway connection status. + */ + private VirtualNetworkGatewayConnectionStatus connectionStatus; + + /* + * The Ingress Bytes Transferred in this connection. + */ + private Long ingressBytesTransferred; + + /* + * The Egress Bytes Transferred in this connection. + */ + private Long egressBytesTransferred; + + /* + * The time at which connection was established in Utc format. + */ + private String lastConnectionEstablishedUtcTime; + + /** + * Creates an instance of TunnelConnectionHealth class. + */ + public TunnelConnectionHealth() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TunnelConnectionHealth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TunnelConnectionHealth if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the TunnelConnectionHealth. + */ + public static TunnelConnectionHealth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TunnelConnectionHealth deserializedTunnelConnectionHealth = new TunnelConnectionHealth(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tunnel".equals(fieldName)) { + deserializedTunnelConnectionHealth.tunnel = reader.getString(); + } else if ("connectionStatus".equals(fieldName)) { + deserializedTunnelConnectionHealth.connectionStatus + = VirtualNetworkGatewayConnectionStatus.fromString(reader.getString()); + } else if ("ingressBytesTransferred".equals(fieldName)) { + deserializedTunnelConnectionHealth.ingressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("egressBytesTransferred".equals(fieldName)) { + deserializedTunnelConnectionHealth.egressBytesTransferred = reader.getNullable(JsonReader::getLong); + } else if ("lastConnectionEstablishedUtcTime".equals(fieldName)) { + deserializedTunnelConnectionHealth.lastConnectionEstablishedUtcTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTunnelConnectionHealth; + }); + } +} 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..bf5c8e95cf842 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UnprepareNetworkPoliciesRequest.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.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Details of UnprepareNetworkPolicies for Subnet. + */ +@Fluent +public final class UnprepareNetworkPoliciesRequest implements JsonSerializable { + /* + * The name of the service for which subnet is being unprepared for. + */ + private String serviceName; + + /** + * Creates an instance of UnprepareNetworkPoliciesRequest class. + */ + public UnprepareNetworkPoliciesRequest() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceName", this.serviceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UnprepareNetworkPoliciesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UnprepareNetworkPoliciesRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the UnprepareNetworkPoliciesRequest. + */ + public static UnprepareNetworkPoliciesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UnprepareNetworkPoliciesRequest deserializedUnprepareNetworkPoliciesRequest + = new UnprepareNetworkPoliciesRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceName".equals(fieldName)) { + deserializedUnprepareNetworkPoliciesRequest.serviceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUnprepareNetworkPoliciesRequest; + }); + } +} 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..f9a2c0cb71339 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usage.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.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..db97c520ff578 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageName.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The usage names. + */ +@Fluent +public final class UsageName implements JsonSerializable { + /* + * A string describing the resource name. + */ + private String value; + + /* + * A localized string describing the resource name. + */ + private String localizedValue; + + /** + * Creates an instance of UsageName class. + */ + public UsageName() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("localizedValue", this.localizedValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageName if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UsageName. + */ + public static UsageName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageName deserializedUsageName = new UsageName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedUsageName.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedUsageName.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageName; + }); + } +} 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..4c3be1a8606c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsageUnit.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 java.util.Collection; + +/** + * An enum describing the unit of measurement. + */ +public final class UsageUnit extends ExpandableStringEnum { + /** + * Static value Count for UsageUnit. + */ + public static final UsageUnit COUNT = fromString("Count"); + + /** + * Creates a new instance of UsageUnit value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UsageUnit() { + } + + /** + * Creates or finds a UsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding UsageUnit. + */ + public static UsageUnit fromString(String name) { + return fromString(name, UsageUnit.class); + } + + /** + * Gets known UsageUnit values. + * + * @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..b3cb94a2e7523 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/Usages.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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..a09136c8adf7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UsagesListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.UsageInner; +import java.io.IOException; +import java.util.List; + +/** + * The list usages operation response. + */ +@Fluent +public final class UsagesListResult implements JsonSerializable { + /* + * The list network resource usages. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of UsagesListResult class. + */ + public UsagesListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsagesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsagesListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the UsagesListResult. + */ + public static UsagesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsagesListResult deserializedUsagesListResult = new UsagesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); + deserializedUsagesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUsagesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsagesListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UseHubGateway.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UseHubGateway.java new file mode 100644 index 0000000000000..e5ede5f48515f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/UseHubGateway.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Flag if need to use hub gateway. + */ +public final class UseHubGateway extends ExpandableStringEnum { + /** + * Static value False for UseHubGateway. + */ + public static final UseHubGateway FALSE = fromString("False"); + + /** + * Static value True for UseHubGateway. + */ + public static final UseHubGateway TRUE = fromString("True"); + + /** + * Creates a new instance of UseHubGateway value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UseHubGateway() { + } + + /** + * Creates or finds a UseHubGateway from its string representation. + * + * @param name a name to look for. + * @return the corresponding UseHubGateway. + */ + public static UseHubGateway fromString(String name) { + return fromString(name, UseHubGateway.class); + } + + /** + * Gets known UseHubGateway values. + * + * @return known UseHubGateway values. + */ + public static Collection values() { + return values(UseHubGateway.class); + } +} 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..3df95b9b4df52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VM.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.management.Resource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Describes a Virtual Machine. + */ +@Fluent +public final class VM extends Resource { + /* + * Resource ID. + */ + private String id; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /** + * Creates an instance of VM class. + */ + public VM() { + } + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * {@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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VM from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VM if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON + * null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VM. + */ + public static VM fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VM deserializedVM = new VM(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVM.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVM.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVM.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVM.withTags(tags); + } else if ("id".equals(fieldName)) { + deserializedVM.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVM; + }); + } +} 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..a18b58cb868b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerbosityLevel.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Verbosity level. + */ +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 a new instance of VerbosityLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VerbosityLevel() { + } + + /** + * Creates or finds a VerbosityLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding VerbosityLevel. + */ + public static VerbosityLevel fromString(String name) { + return fromString(name, VerbosityLevel.class); + } + + /** + * Gets known VerbosityLevel values. + * + * @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..5f9dd1925ceef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters that define the IP flow to be verified. + */ +@Fluent +public final class VerificationIpFlowParameters implements JsonSerializable { + /* + * The ID of the target resource to perform next-hop on. + */ + private String targetResourceId; + + /* + * The direction of the packet represented as a 5-tuple. + */ + private Direction direction; + + /* + * Protocol to be verified on. + */ + 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. + */ + 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. + */ + private String remotePort; + + /* + * The local IP address. Acceptable values are valid IPv4 addresses. + */ + private String localIpAddress; + + /* + * The remote IP address. Acceptable values are valid IPv4 addresses. + */ + 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). + */ + private String targetNicResourceId; + + /** + * Creates an instance of VerificationIpFlowParameters class. + */ + public VerificationIpFlowParameters() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property targetResourceId in model VerificationIpFlowParameters")); + } + if (direction() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property direction in model VerificationIpFlowParameters")); + } + if (protocol() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property protocol in model VerificationIpFlowParameters")); + } + if (localPort() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property localPort in model VerificationIpFlowParameters")); + } + if (remotePort() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property remotePort in model VerificationIpFlowParameters")); + } + if (localIpAddress() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property localIpAddress in model VerificationIpFlowParameters")); + } + if (remoteIpAddress() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property remoteIpAddress in model VerificationIpFlowParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VerificationIpFlowParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetResourceId", this.targetResourceId); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("localPort", this.localPort); + jsonWriter.writeStringField("remotePort", this.remotePort); + jsonWriter.writeStringField("localIPAddress", this.localIpAddress); + jsonWriter.writeStringField("remoteIPAddress", this.remoteIpAddress); + jsonWriter.writeStringField("targetNicResourceId", this.targetNicResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VerificationIpFlowParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VerificationIpFlowParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VerificationIpFlowParameters. + */ + public static VerificationIpFlowParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VerificationIpFlowParameters deserializedVerificationIpFlowParameters = new VerificationIpFlowParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetResourceId".equals(fieldName)) { + deserializedVerificationIpFlowParameters.targetResourceId = reader.getString(); + } else if ("direction".equals(fieldName)) { + deserializedVerificationIpFlowParameters.direction = Direction.fromString(reader.getString()); + } else if ("protocol".equals(fieldName)) { + deserializedVerificationIpFlowParameters.protocol = IpFlowProtocol.fromString(reader.getString()); + } else if ("localPort".equals(fieldName)) { + deserializedVerificationIpFlowParameters.localPort = reader.getString(); + } else if ("remotePort".equals(fieldName)) { + deserializedVerificationIpFlowParameters.remotePort = reader.getString(); + } else if ("localIPAddress".equals(fieldName)) { + deserializedVerificationIpFlowParameters.localIpAddress = reader.getString(); + } else if ("remoteIPAddress".equals(fieldName)) { + deserializedVerificationIpFlowParameters.remoteIpAddress = reader.getString(); + } else if ("targetNicResourceId".equals(fieldName)) { + deserializedVerificationIpFlowParameters.targetNicResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVerificationIpFlowParameters; + }); + } +} 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..70fabf97b0247 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VerificationIpFlowResult.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.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/VipSwaps.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VipSwaps.java new file mode 100644 index 0000000000000..83f27dd60645c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VipSwaps.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SwapResourceInner; + +/** + * Resource collection API of VipSwaps. + */ +public interface VipSwaps { + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response}. + */ + Response getWithResponse(String groupName, String resourceName, Context context); + + /** + * Gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud + * service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the SwapResource which identifies the slot type for the specified cloud service. + */ + SwapResource get(String groupName, String resourceName); + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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. + */ + void create(String groupName, String resourceName, SwapResourceInner parameters); + + /** + * Performs vip swap operation on swappable cloud services. + * + * @param groupName The name of the resource group. + * @param resourceName The name of the cloud service. + * @param parameters SwapResource object where slot type should be the target slot after vip swap for the specified + * 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. + */ + void create(String groupName, String resourceName, SwapResourceInner parameters, Context context); + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service along with + * {@link Response}. + */ + Response listWithResponse(String groupName, String resourceName, Context context); + + /** + * Gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on a + * cloud service can either be Staging or Production. + * + * @param groupName The name of the resource group. + * @param resourceName 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 the list of SwapResource which identifies the slot type for the specified cloud service. + */ + SwapResourceListResult list(String groupName, String resourceName); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceAdditionalNicProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceAdditionalNicProperties.java new file mode 100644 index 0000000000000..d1107e4ce0345 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceAdditionalNicProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network Virtual Appliance Additional Nic Properties + * + * Network Virtual Appliance Additional NIC properties. + */ +@Fluent +public final class VirtualApplianceAdditionalNicProperties + implements JsonSerializable { + /* + * Name of additional nic + */ + private String name; + + /* + * Flag (true or false) for Intent for Public Ip on additional nic + */ + private Boolean hasPublicIp; + + /** + * Creates an instance of VirtualApplianceAdditionalNicProperties class. + */ + public VirtualApplianceAdditionalNicProperties() { + } + + /** + * Get the name property: Name of additional nic. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of additional nic. + * + * @param name the name value to set. + * @return the VirtualApplianceAdditionalNicProperties object itself. + */ + public VirtualApplianceAdditionalNicProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the hasPublicIp property: Flag (true or false) for Intent for Public Ip on additional nic. + * + * @return the hasPublicIp value. + */ + public Boolean hasPublicIp() { + return this.hasPublicIp; + } + + /** + * Set the hasPublicIp property: Flag (true or false) for Intent for Public Ip on additional nic. + * + * @param hasPublicIp the hasPublicIp value to set. + * @return the VirtualApplianceAdditionalNicProperties object itself. + */ + public VirtualApplianceAdditionalNicProperties withHasPublicIp(Boolean hasPublicIp) { + this.hasPublicIp = hasPublicIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("hasPublicIp", this.hasPublicIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceAdditionalNicProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceAdditionalNicProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceAdditionalNicProperties. + */ + public static VirtualApplianceAdditionalNicProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceAdditionalNicProperties deserializedVirtualApplianceAdditionalNicProperties + = new VirtualApplianceAdditionalNicProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualApplianceAdditionalNicProperties.name = reader.getString(); + } else if ("hasPublicIp".equals(fieldName)) { + deserializedVirtualApplianceAdditionalNicProperties.hasPublicIp + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceAdditionalNicProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfiguration.java new file mode 100644 index 0000000000000..d1659a1d85f1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a single IP configuration. + */ +@Fluent +public final class VirtualApplianceIpConfiguration implements JsonSerializable { + /* + * Name of the IP configuration. + */ + private String name; + + /* + * Represents a single IP configuration properties. + */ + private VirtualApplianceIpConfigurationProperties properties; + + /** + * Creates an instance of VirtualApplianceIpConfiguration class. + */ + public VirtualApplianceIpConfiguration() { + } + + /** + * 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 VirtualApplianceIpConfiguration object itself. + */ + public VirtualApplianceIpConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Represents a single IP configuration properties. + * + * @return the properties value. + */ + public VirtualApplianceIpConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Represents a single IP configuration properties. + * + * @param properties the properties value to set. + * @return the VirtualApplianceIpConfiguration object itself. + */ + public VirtualApplianceIpConfiguration withProperties(VirtualApplianceIpConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceIpConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceIpConfiguration. + */ + public static VirtualApplianceIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceIpConfiguration deserializedVirtualApplianceIpConfiguration + = new VirtualApplianceIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualApplianceIpConfiguration.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVirtualApplianceIpConfiguration.properties + = VirtualApplianceIpConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceIpConfiguration; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfigurationProperties.java new file mode 100644 index 0000000000000..bc4940cd614cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceIpConfigurationProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a single IP configuration properties. + */ +@Fluent +public final class VirtualApplianceIpConfigurationProperties + implements JsonSerializable { + /* + * Whether or not this is primary IP configuration of the NIC. + */ + private Boolean primary; + + /** + * Creates an instance of VirtualApplianceIpConfigurationProperties class. + */ + public VirtualApplianceIpConfigurationProperties() { + } + + /** + * Get the primary property: Whether or not this is primary IP configuration of the NIC. + * + * @return the primary value. + */ + public Boolean primary() { + return this.primary; + } + + /** + * Set the primary property: Whether or not this is primary IP configuration of the NIC. + * + * @param primary the primary value to set. + * @return the VirtualApplianceIpConfigurationProperties object itself. + */ + public VirtualApplianceIpConfigurationProperties withPrimary(Boolean primary) { + this.primary = primary; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("primary", this.primary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceIpConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceIpConfigurationProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceIpConfigurationProperties. + */ + public static VirtualApplianceIpConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceIpConfigurationProperties deserializedVirtualApplianceIpConfigurationProperties + = new VirtualApplianceIpConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("primary".equals(fieldName)) { + deserializedVirtualApplianceIpConfigurationProperties.primary + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceIpConfigurationProperties; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfiguration.java new file mode 100644 index 0000000000000..8a06cf768e19f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a single NIC configuration. + */ +@Fluent +public final class VirtualApplianceNetworkInterfaceConfiguration + implements JsonSerializable { + /* + * NIC type. This should be either PublicNic or PrivateNic. + */ + private NicTypeInRequest nicType; + + /* + * Represents a single NIC configuration properties. + */ + private VirtualApplianceNetworkInterfaceConfigurationProperties properties; + + /** + * Creates an instance of VirtualApplianceNetworkInterfaceConfiguration class. + */ + public VirtualApplianceNetworkInterfaceConfiguration() { + } + + /** + * Get the nicType property: NIC type. This should be either PublicNic or PrivateNic. + * + * @return the nicType value. + */ + public NicTypeInRequest nicType() { + return this.nicType; + } + + /** + * Set the nicType property: NIC type. This should be either PublicNic or PrivateNic. + * + * @param nicType the nicType value to set. + * @return the VirtualApplianceNetworkInterfaceConfiguration object itself. + */ + public VirtualApplianceNetworkInterfaceConfiguration withNicType(NicTypeInRequest nicType) { + this.nicType = nicType; + return this; + } + + /** + * Get the properties property: Represents a single NIC configuration properties. + * + * @return the properties value. + */ + public VirtualApplianceNetworkInterfaceConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Represents a single NIC configuration properties. + * + * @param properties the properties value to set. + * @return the VirtualApplianceNetworkInterfaceConfiguration object itself. + */ + public VirtualApplianceNetworkInterfaceConfiguration + withProperties(VirtualApplianceNetworkInterfaceConfigurationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.nicType == null ? null : this.nicType.toString()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceNetworkInterfaceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceNetworkInterfaceConfiguration if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceNetworkInterfaceConfiguration. + */ + public static VirtualApplianceNetworkInterfaceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceNetworkInterfaceConfiguration deserializedVirtualApplianceNetworkInterfaceConfiguration + = new VirtualApplianceNetworkInterfaceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedVirtualApplianceNetworkInterfaceConfiguration.nicType + = NicTypeInRequest.fromString(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualApplianceNetworkInterfaceConfiguration.properties + = VirtualApplianceNetworkInterfaceConfigurationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceNetworkInterfaceConfiguration; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfigurationProperties.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfigurationProperties.java new file mode 100644 index 0000000000000..6de0bc79fca59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNetworkInterfaceConfigurationProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents a single NIC configuration properties. + */ +@Fluent +public final class VirtualApplianceNetworkInterfaceConfigurationProperties + implements JsonSerializable { + /* + * The ipConfigurations property. + */ + private List ipConfigurations; + + /** + * Creates an instance of VirtualApplianceNetworkInterfaceConfigurationProperties class. + */ + public VirtualApplianceNetworkInterfaceConfigurationProperties() { + } + + /** + * Get the ipConfigurations property: The ipConfigurations property. + * + * @return the ipConfigurations value. + */ + public List ipConfigurations() { + return this.ipConfigurations; + } + + /** + * Set the ipConfigurations property: The ipConfigurations property. + * + * @param ipConfigurations the ipConfigurations value to set. + * @return the VirtualApplianceNetworkInterfaceConfigurationProperties object itself. + */ + public VirtualApplianceNetworkInterfaceConfigurationProperties + withIpConfigurations(List ipConfigurations) { + this.ipConfigurations = ipConfigurations; + 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipConfigurations", this.ipConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceNetworkInterfaceConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceNetworkInterfaceConfigurationProperties if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceNetworkInterfaceConfigurationProperties. + */ + public static VirtualApplianceNetworkInterfaceConfigurationProperties fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceNetworkInterfaceConfigurationProperties deserializedVirtualApplianceNetworkInterfaceConfigurationProperties + = new VirtualApplianceNetworkInterfaceConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipConfigurations".equals(fieldName)) { + List ipConfigurations + = reader.readArray(reader1 -> VirtualApplianceIpConfiguration.fromJson(reader1)); + deserializedVirtualApplianceNetworkInterfaceConfigurationProperties.ipConfigurations + = ipConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceNetworkInterfaceConfigurationProperties; + }); + } +} 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..7fd23232f3a39 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceNicProperties.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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network Virtual Appliance NIC properties. + */ +@Immutable +public final class VirtualApplianceNicProperties implements JsonSerializable { + /* + * NIC type - PublicNic, PrivateNic, or AdditionalNic. + */ + private NicTypeInResponse nicType; + + /* + * NIC name. + */ + private String name; + + /* + * Public IP address. + */ + private String publicIpAddress; + + /* + * Private IP address. + */ + private String privateIpAddress; + + /* + * Instance on which nic is attached. + */ + private String instanceName; + + /** + * Creates an instance of VirtualApplianceNicProperties class. + */ + public VirtualApplianceNicProperties() { + } + + /** + * Get the nicType property: NIC type - PublicNic, PrivateNic, or AdditionalNic. + * + * @return the nicType value. + */ + public NicTypeInResponse nicType() { + return this.nicType; + } + + /** + * 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; + } + + /** + * Get the instanceName property: Instance on which nic is attached. + * + * @return the instanceName value. + */ + public String instanceName() { + return this.instanceName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceNicProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceNicProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceNicProperties. + */ + public static VirtualApplianceNicProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceNicProperties deserializedVirtualApplianceNicProperties + = new VirtualApplianceNicProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nicType".equals(fieldName)) { + deserializedVirtualApplianceNicProperties.nicType + = NicTypeInResponse.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedVirtualApplianceNicProperties.name = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedVirtualApplianceNicProperties.publicIpAddress = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedVirtualApplianceNicProperties.privateIpAddress = reader.getString(); + } else if ("instanceName".equals(fieldName)) { + deserializedVirtualApplianceNicProperties.instanceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceNicProperties; + }); + } +} 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..e634490222a20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSite.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..27dc66bf98db8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSites.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..a695b0c50ccbe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkuProperties.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.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Network Virtual Appliance Sku Properties. + */ +@Fluent +public final class VirtualApplianceSkuProperties implements JsonSerializable { + /* + * Virtual Appliance Vendor. + */ + private String vendor; + + /* + * Virtual Appliance Scale Unit. + */ + private String bundledScaleUnit; + + /* + * Virtual Appliance Version. + */ + private String marketPlaceVersion; + + /** + * Creates an instance of VirtualApplianceSkuProperties class. + */ + public VirtualApplianceSkuProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vendor", this.vendor); + jsonWriter.writeStringField("bundledScaleUnit", this.bundledScaleUnit); + jsonWriter.writeStringField("marketPlaceVersion", this.marketPlaceVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualApplianceSkuProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualApplianceSkuProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualApplianceSkuProperties. + */ + public static VirtualApplianceSkuProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualApplianceSkuProperties deserializedVirtualApplianceSkuProperties + = new VirtualApplianceSkuProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vendor".equals(fieldName)) { + deserializedVirtualApplianceSkuProperties.vendor = reader.getString(); + } else if ("bundledScaleUnit".equals(fieldName)) { + deserializedVirtualApplianceSkuProperties.bundledScaleUnit = reader.getString(); + } else if ("marketPlaceVersion".equals(fieldName)) { + deserializedVirtualApplianceSkuProperties.marketPlaceVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualApplianceSkuProperties; + }); + } +} 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..d54c1155442ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualApplianceSkus.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 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * 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 available NetworkVirtualApplianceSkus along with {@link Response}. + */ + Response getWithResponse(String skuName, 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 available NetworkVirtualApplianceSkus. + */ + NetworkVirtualApplianceSku get(String skuName); +} 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..5d9725fd5e819 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHub.java @@ -0,0 +1,699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 kind property: Kind of service virtual hub. This is metadata used for the Azure portal experience for + * Route Server. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 routeMaps property: List of references to RouteMaps. + * + * @return the routeMaps value. + */ + List routeMaps(); + + /** + * 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 hubRoutingPreference property: The hubRoutingPreference of this VirtualHub. + * + * @return the hubRoutingPreference value. + */ + HubRoutingPreference hubRoutingPreference(); + + /** + * Gets the virtualRouterAutoScaleConfiguration property: The VirtualHub Router autoscale configuration. + * + * @return the virtualRouterAutoScaleConfiguration value. + */ + VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, + DefinitionStages.WithHubRoutingPreference, DefinitionStages.WithVirtualRouterAutoScaleConfiguration { + /** + * 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); + } + + /** + * The stage of the VirtualHub definition allowing to specify hubRoutingPreference. + */ + interface WithHubRoutingPreference { + /** + * Specifies the hubRoutingPreference property: The hubRoutingPreference of this VirtualHub.. + * + * @param hubRoutingPreference The hubRoutingPreference of this VirtualHub. + * @return the next definition stage. + */ + WithCreate withHubRoutingPreference(HubRoutingPreference hubRoutingPreference); + } + + /** + * The stage of the VirtualHub definition allowing to specify virtualRouterAutoScaleConfiguration. + */ + interface WithVirtualRouterAutoScaleConfiguration { + /** + * Specifies the virtualRouterAutoScaleConfiguration property: The VirtualHub Router autoscale + * configuration.. + * + * @param virtualRouterAutoScaleConfiguration The VirtualHub Router autoscale configuration. + * @return the next definition stage. + */ + WithCreate withVirtualRouterAutoScaleConfiguration( + VirtualRouterAutoScaleConfiguration virtualRouterAutoScaleConfiguration); + } + } + + /** + * 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 . + * + * @throws com.azure.core.management.exception.ManagementException 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. + */ + VirtualHubEffectiveRouteList 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. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + VirtualHubEffectiveRouteList getEffectiveVirtualHubRoutes(EffectiveRoutesParameters effectiveRoutesParameters, + Context context); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getInboundRoutes(GetInboundRoutesParameters getInboundRoutesParameters); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getInboundRoutes(GetInboundRoutesParameters getInboundRoutesParameters, Context context); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getOutboundRoutes(GetOutboundRoutesParameters getOutboundRoutesParameters); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getOutboundRoutes(GetOutboundRoutesParameters getOutboundRoutesParameters, + 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..bd2ae1daf4361 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubBgpConnections.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.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; +import java.util.Map; + +/** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualHubName, String connectionName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 map from virtual router instance to list of peer routes. + */ + Map> 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 map from virtual router instance to list of peer routes. + */ + Map> 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 map from virtual router instance to list of peer routes. + */ + Map> 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 map from virtual router instance to list of peer routes. + */ + Map> 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..d28d97a05e12d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRoute.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The effective route configured on the virtual hub or specified resource. + */ +@Fluent +public final class VirtualHubEffectiveRoute implements JsonSerializable { + /* + * The list of address prefixes. + */ + private List addressPrefixes; + + /* + * The list of next hops. + */ + private List nextHops; + + /* + * The type of the next hop. + */ + private String nextHopType; + + /* + * The ASPath of this route. + */ + private String asPath; + + /* + * The origin of this route. + */ + private String routeOrigin; + + /** + * Creates an instance of VirtualHubEffectiveRoute class. + */ + public VirtualHubEffectiveRoute() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("nextHops", this.nextHops, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextHopType", this.nextHopType); + jsonWriter.writeStringField("asPath", this.asPath); + jsonWriter.writeStringField("routeOrigin", this.routeOrigin); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubEffectiveRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubEffectiveRoute if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubEffectiveRoute. + */ + public static VirtualHubEffectiveRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubEffectiveRoute deserializedVirtualHubEffectiveRoute = new VirtualHubEffectiveRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualHubEffectiveRoute.addressPrefixes = addressPrefixes; + } else if ("nextHops".equals(fieldName)) { + List nextHops = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualHubEffectiveRoute.nextHops = nextHops; + } else if ("nextHopType".equals(fieldName)) { + deserializedVirtualHubEffectiveRoute.nextHopType = reader.getString(); + } else if ("asPath".equals(fieldName)) { + deserializedVirtualHubEffectiveRoute.asPath = reader.getString(); + } else if ("routeOrigin".equals(fieldName)) { + deserializedVirtualHubEffectiveRoute.routeOrigin = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubEffectiveRoute; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRouteList.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRouteList.java new file mode 100644 index 0000000000000..18833ae15c4a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubEffectiveRouteList.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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.VirtualHubEffectiveRouteListInner; +import java.util.List; + +/** + * An immutable client-side representation of VirtualHubEffectiveRouteList. + */ +public interface VirtualHubEffectiveRouteList { + /** + * Gets the value property: The list of effective routes configured on the virtual hub or the specified resource. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VirtualHubEffectiveRouteListInner + * object. + * + * @return the inner object. + */ + VirtualHubEffectiveRouteListInner innerModel(); +} 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..f5b7bc20614a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubId.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Virtual Hub identifier. + */ +@Fluent +public final class VirtualHubId implements JsonSerializable { + /* + * 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. + */ + private String id; + + /** + * Creates an instance of VirtualHubId class. + */ + public VirtualHubId() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubId if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubId. + */ + public static VirtualHubId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubId deserializedVirtualHubId = new VirtualHubId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualHubId.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubId; + }); + } +} 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..e169387565094 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubIpConfigurations.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualHubName, String ipConfigName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..1a74bd5a0bece --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRoute.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VirtualHub route. + */ +@Fluent +public final class VirtualHubRoute implements JsonSerializable { + /* + * List of all addressPrefixes. + */ + private List addressPrefixes; + + /* + * NextHop ip address. + */ + private String nextHopIpAddress; + + /** + * Creates an instance of VirtualHubRoute class. + */ + public VirtualHubRoute() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextHopIpAddress", this.nextHopIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubRoute if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubRoute. + */ + public static VirtualHubRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubRoute deserializedVirtualHubRoute = new VirtualHubRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualHubRoute.addressPrefixes = addressPrefixes; + } else if ("nextHopIpAddress".equals(fieldName)) { + deserializedVirtualHubRoute.nextHopIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubRoute; + }); + } +} 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..8a2759258d0b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTable.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VirtualHub route table. + */ +@Fluent +public final class VirtualHubRouteTable implements JsonSerializable { + /* + * List of all routes. + */ + private List routes; + + /** + * Creates an instance of VirtualHubRouteTable class. + */ + public VirtualHubRouteTable() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("routes", this.routes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubRouteTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubRouteTable if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubRouteTable. + */ + public static VirtualHubRouteTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubRouteTable deserializedVirtualHubRouteTable = new VirtualHubRouteTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routes".equals(fieldName)) { + List routes = reader.readArray(reader1 -> VirtualHubRoute.fromJson(reader1)); + deserializedVirtualHubRouteTable.routes = routes; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubRouteTable; + }); + } +} 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..fa8512a36b4b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2.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.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..bd960df86e353 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteTableV2S.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.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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualHubName, + String routeTableName, 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 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); + + /** + * 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 as paginated response + * with {@link PagedIterable}. + */ + 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 as paginated response + * with {@link PagedIterable}. + */ + 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..91ee30e109fbf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubRouteV2.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VirtualHubRouteTableV2 route. + */ +@Fluent +public final class VirtualHubRouteV2 implements JsonSerializable { + /* + * The type of destinations. + */ + private String destinationType; + + /* + * List of all destinations. + */ + private List destinations; + + /* + * The type of next hops. + */ + private String nextHopType; + + /* + * NextHops ip address. + */ + private List nextHops; + + /** + * Creates an instance of VirtualHubRouteV2 class. + */ + public VirtualHubRouteV2() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("destinationType", this.destinationType); + jsonWriter.writeArrayField("destinations", this.destinations, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("nextHopType", this.nextHopType); + jsonWriter.writeArrayField("nextHops", this.nextHops, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualHubRouteV2 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualHubRouteV2 if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualHubRouteV2. + */ + public static VirtualHubRouteV2 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualHubRouteV2 deserializedVirtualHubRouteV2 = new VirtualHubRouteV2(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationType".equals(fieldName)) { + deserializedVirtualHubRouteV2.destinationType = reader.getString(); + } else if ("destinations".equals(fieldName)) { + List destinations = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualHubRouteV2.destinations = destinations; + } else if ("nextHopType".equals(fieldName)) { + deserializedVirtualHubRouteV2.nextHopType = reader.getString(); + } else if ("nextHops".equals(fieldName)) { + List nextHops = reader.readArray(reader1 -> reader1.getString()); + deserializedVirtualHubRouteV2.nextHops = nextHops; + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualHubRouteV2; + }); + } +} 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..7044b2df2fff9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualHubs.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualHubName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + */ + VirtualHubEffectiveRouteList 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. + * @return the effective routes configured for the Virtual Hub resource or the specified resource. + */ + VirtualHubEffectiveRouteList getEffectiveVirtualHubRoutes(String resourceGroupName, String virtualHubName, + EffectiveRoutesParameters effectiveRoutesParameters, Context context); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters); + + /** + * Gets the inbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getInboundRoutesParameters Parameters supplied to get the inbound routes for a connection 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 inbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getInboundRoutes(String resourceGroupName, String virtualHubName, + GetInboundRoutesParameters getInboundRoutesParameters, Context context); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters); + + /** + * Gets the outbound routes configured for the Virtual Hub on a particular connection. + * + * @param resourceGroupName The resource group name of the VirtualHub. + * @param virtualHubName The name of the VirtualHub. + * @param getOutboundRoutesParameters Parameters supplied to get the outbound routes for a connection 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 outbound routes configured for the Virtual Hub on a particular connection. + */ + EffectiveRouteMapRouteList getOutboundRoutes(String resourceGroupName, String virtualHubName, + GetOutboundRoutesParameters getOutboundRoutesParameters, 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..692fca365b2f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetwork.java @@ -0,0 +1,567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 encryption property: Indicates if encryption is enabled on virtual network and if VM without encryption + * is allowed in encrypted VNet. + * + * @return the encryption value. + */ + VirtualNetworkEncryption encryption(); + + /** + * Gets the ipAllocations property: Array of IpAllocation which reference this VNET. + * + * @return the ipAllocations value. + */ + List ipAllocations(); + + /** + * Gets the flowLogs property: A collection of references to flow log resources. + * + * @return the flowLogs value. + */ + List flowLogs(); + + /** + * Gets the privateEndpointVNetPolicies property: Private Endpoint VNet Policies. + * + * @return the privateEndpointVNetPolicies value. + */ + PrivateEndpointVNetPolicies privateEndpointVNetPolicies(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithEncryption, DefinitionStages.WithIpAllocations, + DefinitionStages.WithPrivateEndpointVNetPolicies { + /** + * 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 encryption. + */ + interface WithEncryption { + /** + * Specifies the encryption property: Indicates if encryption is enabled on virtual network and if VM + * without encryption is allowed in encrypted VNet.. + * + * @param encryption Indicates if encryption is enabled on virtual network and if VM without encryption is + * allowed in encrypted VNet. + * @return the next definition stage. + */ + WithCreate withEncryption(VirtualNetworkEncryption encryption); + } + + /** + * 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); + } + + /** + * The stage of the VirtualNetwork definition allowing to specify privateEndpointVNetPolicies. + */ + interface WithPrivateEndpointVNetPolicies { + /** + * Specifies the privateEndpointVNetPolicies property: Private Endpoint VNet Policies.. + * + * @param privateEndpointVNetPolicies Private Endpoint VNet Policies. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointVNetPolicies(PrivateEndpointVNetPolicies privateEndpointVNetPolicies); + } + } + + /** + * 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); + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listDdosProtectionStatus(); + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listDdosProtectionStatus(Integer top, String skipToken, + 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..fa3230f556c5e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkBgpCommunities.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. + */ +@Fluent +public final class VirtualNetworkBgpCommunities implements JsonSerializable { + /* + * The BGP community associated with the virtual network. + */ + private String virtualNetworkCommunity; + + /* + * The BGP community associated with the region of the virtual network. + */ + private String regionalCommunity; + + /** + * Creates an instance of VirtualNetworkBgpCommunities class. + */ + public VirtualNetworkBgpCommunities() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property virtualNetworkCommunity in model VirtualNetworkBgpCommunities")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkBgpCommunities.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("virtualNetworkCommunity", this.virtualNetworkCommunity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkBgpCommunities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkBgpCommunities if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkBgpCommunities. + */ + public static VirtualNetworkBgpCommunities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkBgpCommunities deserializedVirtualNetworkBgpCommunities = new VirtualNetworkBgpCommunities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("virtualNetworkCommunity".equals(fieldName)) { + deserializedVirtualNetworkBgpCommunities.virtualNetworkCommunity = reader.getString(); + } else if ("regionalCommunity".equals(fieldName)) { + deserializedVirtualNetworkBgpCommunities.regionalCommunity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkBgpCommunities; + }); + } +} 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..eb703900fb6f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkConnectionGatewayReference.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A reference to VirtualNetworkGateway or LocalNetworkGateway resource. + */ +@Fluent +public final class VirtualNetworkConnectionGatewayReference + implements JsonSerializable { + /* + * The ID of VirtualNetworkGateway or LocalNetworkGateway resource. + */ + private String id; + + /** + * Creates an instance of VirtualNetworkConnectionGatewayReference class. + */ + public VirtualNetworkConnectionGatewayReference() { + } + + /** + * 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.atError() + .log(new IllegalArgumentException( + "Missing required property id in model VirtualNetworkConnectionGatewayReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkConnectionGatewayReference.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkConnectionGatewayReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkConnectionGatewayReference if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkConnectionGatewayReference. + */ + public static VirtualNetworkConnectionGatewayReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkConnectionGatewayReference deserializedVirtualNetworkConnectionGatewayReference + = new VirtualNetworkConnectionGatewayReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkConnectionGatewayReference.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkConnectionGatewayReference; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkDdosProtectionStatusResult.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkDdosProtectionStatusResult.java new file mode 100644 index 0000000000000..1e6abd02568d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkDdosProtectionStatusResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.PublicIpDdosProtectionStatusResultInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for GetVirtualNetworkDdosProtectionStatusOperation. + */ +@Fluent +public final class VirtualNetworkDdosProtectionStatusResult + implements JsonSerializable { + /* + * The Ddos Protection Status Result for each public ip under a virtual network. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkDdosProtectionStatusResult class. + */ + public VirtualNetworkDdosProtectionStatusResult() { + } + + /** + * Get the value property: The Ddos Protection Status Result for each public ip under a virtual network. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Ddos Protection Status Result for each public ip under a virtual network. + * + * @param value the value value to set. + * @return the VirtualNetworkDdosProtectionStatusResult object itself. + */ + public VirtualNetworkDdosProtectionStatusResult 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 VirtualNetworkDdosProtectionStatusResult object itself. + */ + public VirtualNetworkDdosProtectionStatusResult 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkDdosProtectionStatusResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkDdosProtectionStatusResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkDdosProtectionStatusResult. + */ + public static VirtualNetworkDdosProtectionStatusResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkDdosProtectionStatusResult deserializedVirtualNetworkDdosProtectionStatusResult + = new VirtualNetworkDdosProtectionStatusResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PublicIpDdosProtectionStatusResultInner.fromJson(reader1)); + deserializedVirtualNetworkDdosProtectionStatusResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkDdosProtectionStatusResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkDdosProtectionStatusResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryption.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryption.java new file mode 100644 index 0000000000000..e4e1e50e871ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryption.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. + */ +@Fluent +public final class VirtualNetworkEncryption implements JsonSerializable { + /* + * Indicates if encryption is enabled on the virtual network. + */ + private boolean enabled; + + /* + * If the encrypted VNet allows VM that does not support encryption. This field is for future support, + * AllowUnencrypted is the only supported value at general availability. + */ + private VirtualNetworkEncryptionEnforcement enforcement; + + /** + * Creates an instance of VirtualNetworkEncryption class. + */ + public VirtualNetworkEncryption() { + } + + /** + * Get the enabled property: Indicates if encryption is enabled on the virtual network. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates if encryption is enabled on the virtual network. + * + * @param enabled the enabled value to set. + * @return the VirtualNetworkEncryption object itself. + */ + public VirtualNetworkEncryption withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the enforcement property: If the encrypted VNet allows VM that does not support encryption. This field is for + * future support, AllowUnencrypted is the only supported value at general availability. + * + * @return the enforcement value. + */ + public VirtualNetworkEncryptionEnforcement enforcement() { + return this.enforcement; + } + + /** + * Set the enforcement property: If the encrypted VNet allows VM that does not support encryption. This field is for + * future support, AllowUnencrypted is the only supported value at general availability. + * + * @param enforcement the enforcement value to set. + * @return the VirtualNetworkEncryption object itself. + */ + public VirtualNetworkEncryption withEnforcement(VirtualNetworkEncryptionEnforcement enforcement) { + this.enforcement = enforcement; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("enforcement", this.enforcement == null ? null : this.enforcement.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkEncryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkEncryption if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VirtualNetworkEncryption. + */ + public static VirtualNetworkEncryption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkEncryption deserializedVirtualNetworkEncryption = new VirtualNetworkEncryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedVirtualNetworkEncryption.enabled = reader.getBoolean(); + } else if ("enforcement".equals(fieldName)) { + deserializedVirtualNetworkEncryption.enforcement + = VirtualNetworkEncryptionEnforcement.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkEncryption; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryptionEnforcement.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryptionEnforcement.java new file mode 100644 index 0000000000000..0334ad8332e8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkEncryptionEnforcement.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 java.util.Collection; + +/** + * If the encrypted VNet allows VM that does not support encryption. This field is for future support, AllowUnencrypted + * is the only supported value at general availability. + */ +public final class VirtualNetworkEncryptionEnforcement + extends ExpandableStringEnum { + /** + * Static value DropUnencrypted for VirtualNetworkEncryptionEnforcement. + */ + public static final VirtualNetworkEncryptionEnforcement DROP_UNENCRYPTED = fromString("DropUnencrypted"); + + /** + * Static value AllowUnencrypted for VirtualNetworkEncryptionEnforcement. + */ + public static final VirtualNetworkEncryptionEnforcement ALLOW_UNENCRYPTED = fromString("AllowUnencrypted"); + + /** + * Creates a new instance of VirtualNetworkEncryptionEnforcement value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkEncryptionEnforcement() { + } + + /** + * Creates or finds a VirtualNetworkEncryptionEnforcement from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkEncryptionEnforcement. + */ + public static VirtualNetworkEncryptionEnforcement fromString(String name) { + return fromString(name, VirtualNetworkEncryptionEnforcement.class); + } + + /** + * Gets known VirtualNetworkEncryptionEnforcement values. + * + * @return known VirtualNetworkEncryptionEnforcement values. + */ + public static Collection values() { + return values(VirtualNetworkEncryptionEnforcement.class); + } +} 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..dd57a1000df89 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateway.java @@ -0,0 +1,1124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 identity property: The identity of the virtual network gateway, if configured. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the autoScaleConfiguration property: Autoscale configuration for virutal network gateway. + * + * @return the autoScaleConfiguration value. + */ + VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration(); + + /** + * 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 disableIpSecReplayProtection property: disableIPSecReplayProtection flag. + * + * @return the disableIpSecReplayProtection value. + */ + Boolean disableIpSecReplayProtection(); + + /** + * 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 virtualNetworkGatewayPolicyGroups property: The reference to the VirtualNetworkGatewayPolicyGroup + * resource which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + * + * @return the virtualNetworkGatewayPolicyGroups value. + */ + List virtualNetworkGatewayPolicyGroups(); + + /** + * 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 allowVirtualWanTraffic property: Configures this gateway to accept traffic from remote Virtual WAN + * networks. + * + * @return the allowVirtualWanTraffic value. + */ + Boolean allowVirtualWanTraffic(); + + /** + * Gets the allowRemoteVnetTraffic property: Configure this gateway to accept traffic from other Azure Virtual + * Networks. This configuration does not support connectivity to Azure Virtual WAN. + * + * @return the allowRemoteVnetTraffic value. + */ + Boolean allowRemoteVnetTraffic(); + + /** + * Gets the adminState property: Property to indicate if the Express Route Gateway serves traffic when there are + * multiple Express Route Gateways in the vnet. + * + * @return the adminState value. + */ + AdminState adminState(); + + /** + * Gets the resiliencyModel property: Property to indicate if the Express Route Gateway has resiliency model of + * MultiHomed or SingleHomed. + * + * @return the resiliencyModel value. + */ + ResiliencyModel resiliencyModel(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithIdentity, + DefinitionStages.WithAutoScaleConfiguration, DefinitionStages.WithIpConfigurations, + DefinitionStages.WithGatewayType, DefinitionStages.WithVpnType, DefinitionStages.WithVpnGatewayGeneration, + DefinitionStages.WithEnableBgp, DefinitionStages.WithEnablePrivateIpAddress, DefinitionStages.WithActive, + DefinitionStages.WithDisableIpSecReplayProtection, DefinitionStages.WithGatewayDefaultSite, + DefinitionStages.WithSku, DefinitionStages.WithVpnClientConfiguration, + DefinitionStages.WithVirtualNetworkGatewayPolicyGroups, DefinitionStages.WithBgpSettings, + DefinitionStages.WithCustomRoutes, DefinitionStages.WithEnableDnsForwarding, + DefinitionStages.WithVNetExtendedLocationResourceId, DefinitionStages.WithNatRules, + DefinitionStages.WithEnableBgpRouteTranslationForNat, DefinitionStages.WithAllowVirtualWanTraffic, + DefinitionStages.WithAllowRemoteVnetTraffic, DefinitionStages.WithAdminState, + DefinitionStages.WithResiliencyModel { + /** + * 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 identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the virtual network gateway, if configured.. + * + * @param identity The identity of the virtual network gateway, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify autoScaleConfiguration. + */ + interface WithAutoScaleConfiguration { + /** + * Specifies the autoScaleConfiguration property: Autoscale configuration for virutal network gateway. + * + * @param autoScaleConfiguration Autoscale configuration for virutal network gateway. + * @return the next definition stage. + */ + WithCreate withAutoScaleConfiguration(VirtualNetworkGatewayAutoScaleConfiguration autoScaleConfiguration); + } + + /** + * 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 disableIpSecReplayProtection. + */ + interface WithDisableIpSecReplayProtection { + /** + * Specifies the disableIpSecReplayProtection property: disableIPSecReplayProtection flag.. + * + * @param disableIpSecReplayProtection disableIPSecReplayProtection flag. + * @return the next definition stage. + */ + WithCreate withDisableIpSecReplayProtection(Boolean disableIpSecReplayProtection); + } + + /** + * 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 virtualNetworkGatewayPolicyGroups. + */ + interface WithVirtualNetworkGatewayPolicyGroups { + /** + * Specifies the virtualNetworkGatewayPolicyGroups property: The reference to the + * VirtualNetworkGatewayPolicyGroup resource which represents the available VirtualNetworkGatewayPolicyGroup + * for the gateway.. + * + * @param virtualNetworkGatewayPolicyGroups The reference to the VirtualNetworkGatewayPolicyGroup resource + * which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkGatewayPolicyGroups( + List virtualNetworkGatewayPolicyGroups); + } + + /** + * 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); + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify allowVirtualWanTraffic. + */ + interface WithAllowVirtualWanTraffic { + /** + * Specifies the allowVirtualWanTraffic property: Configures this gateway to accept traffic from remote + * Virtual WAN networks.. + * + * @param allowVirtualWanTraffic Configures this gateway to accept traffic from remote Virtual WAN networks. + * @return the next definition stage. + */ + WithCreate withAllowVirtualWanTraffic(Boolean allowVirtualWanTraffic); + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify allowRemoteVnetTraffic. + */ + interface WithAllowRemoteVnetTraffic { + /** + * Specifies the allowRemoteVnetTraffic property: Configure this gateway to accept traffic from other Azure + * Virtual Networks. This configuration does not support connectivity to Azure Virtual WAN.. + * + * @param allowRemoteVnetTraffic Configure this gateway to accept traffic from other Azure Virtual Networks. + * This configuration does not support connectivity to Azure Virtual WAN. + * @return the next definition stage. + */ + WithCreate withAllowRemoteVnetTraffic(Boolean allowRemoteVnetTraffic); + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify adminState. + */ + interface WithAdminState { + /** + * Specifies the adminState property: Property to indicate if the Express Route Gateway serves traffic when + * there are multiple Express Route Gateways in the vnet. + * + * @param adminState Property to indicate if the Express Route Gateway serves traffic when there are + * multiple Express Route Gateways in the vnet. + * @return the next definition stage. + */ + WithCreate withAdminState(AdminState adminState); + } + + /** + * The stage of the VirtualNetworkGateway definition allowing to specify resiliencyModel. + */ + interface WithResiliencyModel { + /** + * Specifies the resiliencyModel property: Property to indicate if the Express Route Gateway has resiliency + * model of MultiHomed or SingleHomed. + * + * @param resiliencyModel Property to indicate if the Express Route Gateway has resiliency model of + * MultiHomed or SingleHomed. + * @return the next definition stage. + */ + WithCreate withResiliencyModel(ResiliencyModel resiliencyModel); + } + } + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown 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. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response supportedVpnDevicesWithResponse(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(); + + /** + * 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. + * + * @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/VirtualNetworkGatewayAutoScaleBounds.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayAutoScaleBounds.java new file mode 100644 index 0000000000000..6cb34ab66b67d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayAutoScaleBounds.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualNetworkGatewayAutoScaleBounds model. + */ +@Fluent +public final class VirtualNetworkGatewayAutoScaleBounds + implements JsonSerializable { + /* + * Minimum scale Units for Autoscale configuration + */ + private Integer min; + + /* + * Maximum Scale Units for Autoscale configuration + */ + private Integer max; + + /** + * Creates an instance of VirtualNetworkGatewayAutoScaleBounds class. + */ + public VirtualNetworkGatewayAutoScaleBounds() { + } + + /** + * Get the min property: Minimum scale Units for Autoscale configuration. + * + * @return the min value. + */ + public Integer min() { + return this.min; + } + + /** + * Set the min property: Minimum scale Units for Autoscale configuration. + * + * @param min the min value to set. + * @return the VirtualNetworkGatewayAutoScaleBounds object itself. + */ + public VirtualNetworkGatewayAutoScaleBounds withMin(Integer min) { + this.min = min; + return this; + } + + /** + * Get the max property: Maximum Scale Units for Autoscale configuration. + * + * @return the max value. + */ + public Integer max() { + return this.max; + } + + /** + * Set the max property: Maximum Scale Units for Autoscale configuration. + * + * @param max the max value to set. + * @return the VirtualNetworkGatewayAutoScaleBounds object itself. + */ + public VirtualNetworkGatewayAutoScaleBounds withMax(Integer max) { + this.max = max; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("min", this.min); + jsonWriter.writeNumberField("max", this.max); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayAutoScaleBounds from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayAutoScaleBounds if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayAutoScaleBounds. + */ + public static VirtualNetworkGatewayAutoScaleBounds fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayAutoScaleBounds deserializedVirtualNetworkGatewayAutoScaleBounds + = new VirtualNetworkGatewayAutoScaleBounds(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("min".equals(fieldName)) { + deserializedVirtualNetworkGatewayAutoScaleBounds.min = reader.getNullable(JsonReader::getInt); + } else if ("max".equals(fieldName)) { + deserializedVirtualNetworkGatewayAutoScaleBounds.max = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayAutoScaleBounds; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayAutoScaleConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayAutoScaleConfiguration.java new file mode 100644 index 0000000000000..99bd2e65758ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayAutoScaleConfiguration.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Virtual Network Gateway Autoscale Configuration details. + */ +@Fluent +public final class VirtualNetworkGatewayAutoScaleConfiguration + implements JsonSerializable { + /* + * The bounds of the autoscale configuration + */ + private VirtualNetworkGatewayAutoScaleBounds bounds; + + /** + * Creates an instance of VirtualNetworkGatewayAutoScaleConfiguration class. + */ + public VirtualNetworkGatewayAutoScaleConfiguration() { + } + + /** + * Get the bounds property: The bounds of the autoscale configuration. + * + * @return the bounds value. + */ + public VirtualNetworkGatewayAutoScaleBounds bounds() { + return this.bounds; + } + + /** + * Set the bounds property: The bounds of the autoscale configuration. + * + * @param bounds the bounds value to set. + * @return the VirtualNetworkGatewayAutoScaleConfiguration object itself. + */ + public VirtualNetworkGatewayAutoScaleConfiguration withBounds(VirtualNetworkGatewayAutoScaleBounds 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("bounds", this.bounds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayAutoScaleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayAutoScaleConfiguration if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayAutoScaleConfiguration. + */ + public static VirtualNetworkGatewayAutoScaleConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayAutoScaleConfiguration deserializedVirtualNetworkGatewayAutoScaleConfiguration + = new VirtualNetworkGatewayAutoScaleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bounds".equals(fieldName)) { + deserializedVirtualNetworkGatewayAutoScaleConfiguration.bounds + = VirtualNetworkGatewayAutoScaleBounds.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayAutoScaleConfiguration; + }); + } +} 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..7bd98b13ce75e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnection.java @@ -0,0 +1,805 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @return the gatewayCustomBgpIpAddresses value. + */ + List gatewayCustomBgpIpAddresses(); + + /** + * 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 enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + Boolean enablePrivateLinkFastPath(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithGatewayCustomBgpIpAddresses, + DefinitionStages.WithUseLocalAzureIpAddress, DefinitionStages.WithUsePolicyBasedTrafficSelectors, + DefinitionStages.WithIpsecPolicies, DefinitionStages.WithTrafficSelectorPolicies, + DefinitionStages.WithExpressRouteGatewayBypass, DefinitionStages.WithEnablePrivateLinkFastPath { + /** + * 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 gatewayCustomBgpIpAddresses. + */ + interface WithGatewayCustomBgpIpAddresses { + /** + * Specifies the gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual + * network gateway Connection.. + * + * @param gatewayCustomBgpIpAddresses GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * @return the next definition stage. + */ + WithCreate withGatewayCustomBgpIpAddresses( + List gatewayCustomBgpIpAddresses); + } + + /** + * 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); + } + + /** + * The stage of the VirtualNetworkGatewayConnection definition allowing to specify enablePrivateLinkFastPath. + */ + interface WithEnablePrivateLinkFastPath { + /** + * Specifies the enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing + * private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled.. + * + * @param enablePrivateLinkFastPath Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * @return the next definition stage. + */ + WithCreate withEnablePrivateLinkFastPath(Boolean enablePrivateLinkFastPath); + } + } + + /** + * 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. + * + * @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..e098224aa32a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListEntity.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @return the gatewayCustomBgpIpAddresses value. + */ + List gatewayCustomBgpIpAddresses(); + + /** + * 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 enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + Boolean enablePrivateLinkFastPath(); + + /** + * 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..22af27f81b71b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListVirtualNetworkGatewayConnections API service call. + */ +@Fluent +public final class VirtualNetworkGatewayConnectionListResult + implements JsonSerializable { + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkGatewayConnectionListResult class. + */ + public VirtualNetworkGatewayConnectionListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayConnectionListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayConnectionListResult. + */ + public static VirtualNetworkGatewayConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayConnectionListResult deserializedVirtualNetworkGatewayConnectionListResult + = new VirtualNetworkGatewayConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkGatewayConnectionInner.fromJson(reader1)); + deserializedVirtualNetworkGatewayConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkGatewayConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayConnectionListResult; + }); + } +} 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..25d4f05dceb5c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionMode.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gateway connection type. + */ +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 a new instance of VirtualNetworkGatewayConnectionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkGatewayConnectionMode() { + } + + /** + * Creates or finds a VirtualNetworkGatewayConnectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionMode. + */ + public static VirtualNetworkGatewayConnectionMode fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionMode.class); + } + + /** + * Gets known VirtualNetworkGatewayConnectionMode values. + * + * @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/VirtualNetworkGatewayConnectionPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionPropertiesFormat.java new file mode 100644 index 0000000000000..a564bebe67bf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionPropertiesFormat.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.models; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of VirtualNetworkGatewayConnectionPropertiesFormat. + */ +public interface VirtualNetworkGatewayConnectionPropertiesFormat { + /** + * 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 gatewayCustomBgpIpAddresses property: GatewayCustomBgpIpAddresses to be used for virtual network gateway + * Connection. + * + * @return the gatewayCustomBgpIpAddresses value. + */ + List gatewayCustomBgpIpAddresses(); + + /** + * 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 enablePrivateLinkFastPath property: Bypass the ExpressRoute gateway when accessing private-links. + * ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + * + * @return the enablePrivateLinkFastPath value. + */ + Boolean enablePrivateLinkFastPath(); + + /** + * Gets the inner + * com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionPropertiesFormatInner + * object. + * + * @return the inner object. + */ + VirtualNetworkGatewayConnectionPropertiesFormatInner innerModel(); +} 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..ee39e4e52e53a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionProtocol.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 java.util.Collection; + +/** + * Gateway connection protocol. + */ +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 a new instance of VirtualNetworkGatewayConnectionProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkGatewayConnectionProtocol() { + } + + /** + * Creates or finds a VirtualNetworkGatewayConnectionProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionProtocol. + */ + public static VirtualNetworkGatewayConnectionProtocol fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionProtocol.class); + } + + /** + * Gets known VirtualNetworkGatewayConnectionProtocol values. + * + * @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..c2d78df9fb807 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionStatus.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Virtual Network Gateway connection status. + */ +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 a new instance of VirtualNetworkGatewayConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkGatewayConnectionStatus() { + } + + /** + * Creates or finds a VirtualNetworkGatewayConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionStatus. + */ + public static VirtualNetworkGatewayConnectionStatus fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionStatus.class); + } + + /** + * Gets known VirtualNetworkGatewayConnectionStatus values. + * + * @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..54b34931f6899 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnectionType.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.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gateway connection type. + */ +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 a new instance of VirtualNetworkGatewayConnectionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkGatewayConnectionType() { + } + + /** + * Creates or finds a VirtualNetworkGatewayConnectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayConnectionType. + */ + public static VirtualNetworkGatewayConnectionType fromString(String name) { + return fromString(name, VirtualNetworkGatewayConnectionType.class); + } + + /** + * Gets known VirtualNetworkGatewayConnectionType values. + * + * @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..3820aada838a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayConnections.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, 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. + */ + VirtualNetworkGatewayConnection getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getSharedKeyWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, 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 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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. + * @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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..5fae197cf135d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayIpConfiguration.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayIpConfigurationPropertiesFormat; +import java.io.IOException; + +/** + * IP configuration for virtual network gateway. + */ +@Fluent +public final class VirtualNetworkGatewayIpConfiguration extends SubResource { + /* + * Properties of the virtual network gateway ip configuration. + */ + private VirtualNetworkGatewayIpConfigurationPropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VirtualNetworkGatewayIpConfiguration class. + */ + public VirtualNetworkGatewayIpConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the virtual network gateway ip configuration. + * + * @return the innerProperties value. + */ + private VirtualNetworkGatewayIpConfigurationPropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayIpConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the privateIpAllocationMethod property: The private IP address allocation method. + * + * @return the privateIpAllocationMethod value. + */ + public IpAllocationMethod privateIpAllocationMethod() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPrivateIpAllocationMethod(privateIpAllocationMethod); + return this; + } + + /** + * Get the subnet property: The reference to the subnet resource. + * + * @return the subnet value. + */ + public SubResource subnet() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayIpConfigurationPropertiesFormat(); + } + this.innerProperties().withSubnet(subnet); + return this; + } + + /** + * Get the publicIpAddress property: The reference to the public IP resource. + * + * @return the publicIpAddress value. + */ + public SubResource publicIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayIpConfigurationPropertiesFormat(); + } + this.innerProperties().withPublicIpAddress(publicIpAddress); + return this; + } + + /** + * Get the privateIpAddress property: Private IP Address for this gateway. + * + * @return the privateIpAddress value. + */ + public String privateIpAddress() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayIpConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayIpConfiguration. + */ + public static VirtualNetworkGatewayIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayIpConfiguration deserializedVirtualNetworkGatewayIpConfiguration + = new VirtualNetworkGatewayIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfiguration.innerProperties + = VirtualNetworkGatewayIpConfigurationPropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkGatewayIpConfiguration.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayIpConfiguration; + }); + } +} 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..0e4462de8cc15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListConnectionsResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayConnectionListEntityInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the VirtualNetworkGatewayListConnections API service call. + */ +@Fluent +public final class VirtualNetworkGatewayListConnectionsResult + implements JsonSerializable { + /* + * A list of VirtualNetworkGatewayConnection resources that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkGatewayListConnectionsResult class. + */ + public VirtualNetworkGatewayListConnectionsResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayListConnectionsResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayListConnectionsResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayListConnectionsResult. + */ + public static VirtualNetworkGatewayListConnectionsResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayListConnectionsResult deserializedVirtualNetworkGatewayListConnectionsResult + = new VirtualNetworkGatewayListConnectionsResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkGatewayConnectionListEntityInner.fromJson(reader1)); + deserializedVirtualNetworkGatewayListConnectionsResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkGatewayListConnectionsResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayListConnectionsResult; + }); + } +} 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..c30ebf6dd9548 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListVirtualNetworkGateways API service call. + */ +@Fluent +public final class VirtualNetworkGatewayListResult implements JsonSerializable { + /* + * A list of VirtualNetworkGateway resources that exists in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkGatewayListResult class. + */ + public VirtualNetworkGatewayListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayListResult. + */ + public static VirtualNetworkGatewayListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayListResult deserializedVirtualNetworkGatewayListResult + = new VirtualNetworkGatewayListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkGatewayInner.fromJson(reader1)); + deserializedVirtualNetworkGatewayListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkGatewayListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayListResult; + }); + } +} 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..d2f3cd50a314c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRule.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..c5008962a96c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayNatRules.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String virtualNetworkGatewayName, + String natRuleName, 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/VirtualNetworkGatewayPolicyGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroup.java new file mode 100644 index 0000000000000..8163a5abd550a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroup.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayPolicyGroupProperties; +import java.io.IOException; +import java.util.List; + +/** + * Parameters for VirtualNetworkGatewayPolicyGroup. + */ +@Fluent +public final class VirtualNetworkGatewayPolicyGroup extends SubResource { + /* + * Properties of tVirtualNetworkGatewayPolicyGroup. + */ + private VirtualNetworkGatewayPolicyGroupProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VirtualNetworkGatewayPolicyGroup class. + */ + public VirtualNetworkGatewayPolicyGroup() { + } + + /** + * Get the innerProperties property: Properties of tVirtualNetworkGatewayPolicyGroup. + * + * @return the innerProperties value. + */ + private VirtualNetworkGatewayPolicyGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 VirtualNetworkGatewayPolicyGroup object itself. + */ + public VirtualNetworkGatewayPolicyGroup 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VirtualNetworkGatewayPolicyGroup withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the isDefault property: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.innerProperties() == null ? null : this.innerProperties().isDefault(); + } + + /** + * Set the isDefault property: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + * + * @param isDefault the isDefault value to set. + * @return the VirtualNetworkGatewayPolicyGroup object itself. + */ + public VirtualNetworkGatewayPolicyGroup withIsDefault(Boolean isDefault) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPolicyGroupProperties(); + } + this.innerProperties().withIsDefault(isDefault); + return this; + } + + /** + * Get the priority property: Priority for VirtualNetworkGatewayPolicyGroup. + * + * @return the priority value. + */ + public Integer priority() { + return this.innerProperties() == null ? null : this.innerProperties().priority(); + } + + /** + * Set the priority property: Priority for VirtualNetworkGatewayPolicyGroup. + * + * @param priority the priority value to set. + * @return the VirtualNetworkGatewayPolicyGroup object itself. + */ + public VirtualNetworkGatewayPolicyGroup withPriority(Integer priority) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPolicyGroupProperties(); + } + this.innerProperties().withPriority(priority); + return this; + } + + /** + * Get the policyMembers property: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + * + * @return the policyMembers value. + */ + public List policyMembers() { + return this.innerProperties() == null ? null : this.innerProperties().policyMembers(); + } + + /** + * Set the policyMembers property: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + * + * @param policyMembers the policyMembers value to set. + * @return the VirtualNetworkGatewayPolicyGroup object itself. + */ + public VirtualNetworkGatewayPolicyGroup + withPolicyMembers(List policyMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new VirtualNetworkGatewayPolicyGroupProperties(); + } + this.innerProperties().withPolicyMembers(policyMembers); + return this; + } + + /** + * Get the vngClientConnectionConfigurations property: List of references to vngClientConnectionConfigurations. + * + * @return the vngClientConnectionConfigurations value. + */ + public List vngClientConnectionConfigurations() { + return this.innerProperties() == null ? null : this.innerProperties().vngClientConnectionConfigurations(); + } + + /** + * Get the provisioningState property: The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayPolicyGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayPolicyGroup if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayPolicyGroup. + */ + public static VirtualNetworkGatewayPolicyGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayPolicyGroup deserializedVirtualNetworkGatewayPolicyGroup + = new VirtualNetworkGatewayPolicyGroup(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroup.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroup.innerProperties + = VirtualNetworkGatewayPolicyGroupProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroup.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroup.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayPolicyGroup; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroupMember.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroupMember.java new file mode 100644 index 0000000000000..100e9b46a5b50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayPolicyGroupMember.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Vpn Client Connection configuration PolicyGroup member. + */ +@Fluent +public final class VirtualNetworkGatewayPolicyGroupMember + implements JsonSerializable { + /* + * Name of the VirtualNetworkGatewayPolicyGroupMember. + */ + private String name; + + /* + * The Vpn Policy member attribute type. + */ + private VpnPolicyMemberAttributeType attributeType; + + /* + * The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember. + */ + private String attributeValue; + + /** + * Creates an instance of VirtualNetworkGatewayPolicyGroupMember class. + */ + public VirtualNetworkGatewayPolicyGroupMember() { + } + + /** + * Get the name property: Name of the VirtualNetworkGatewayPolicyGroupMember. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the VirtualNetworkGatewayPolicyGroupMember. + * + * @param name the name value to set. + * @return the VirtualNetworkGatewayPolicyGroupMember object itself. + */ + public VirtualNetworkGatewayPolicyGroupMember withName(String name) { + this.name = name; + return this; + } + + /** + * Get the attributeType property: The Vpn Policy member attribute type. + * + * @return the attributeType value. + */ + public VpnPolicyMemberAttributeType attributeType() { + return this.attributeType; + } + + /** + * Set the attributeType property: The Vpn Policy member attribute type. + * + * @param attributeType the attributeType value to set. + * @return the VirtualNetworkGatewayPolicyGroupMember object itself. + */ + public VirtualNetworkGatewayPolicyGroupMember withAttributeType(VpnPolicyMemberAttributeType attributeType) { + this.attributeType = attributeType; + return this; + } + + /** + * Get the attributeValue property: The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember. + * + * @return the attributeValue value. + */ + public String attributeValue() { + return this.attributeValue; + } + + /** + * Set the attributeValue property: The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember. + * + * @param attributeValue the attributeValue value to set. + * @return the VirtualNetworkGatewayPolicyGroupMember object itself. + */ + public VirtualNetworkGatewayPolicyGroupMember withAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("attributeType", this.attributeType == null ? null : this.attributeType.toString()); + jsonWriter.writeStringField("attributeValue", this.attributeValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewayPolicyGroupMember from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewayPolicyGroupMember if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewayPolicyGroupMember. + */ + public static VirtualNetworkGatewayPolicyGroupMember fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewayPolicyGroupMember deserializedVirtualNetworkGatewayPolicyGroupMember + = new VirtualNetworkGatewayPolicyGroupMember(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroupMember.name = reader.getString(); + } else if ("attributeType".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroupMember.attributeType + = VpnPolicyMemberAttributeType.fromString(reader.getString()); + } else if ("attributeValue".equals(fieldName)) { + deserializedVirtualNetworkGatewayPolicyGroupMember.attributeValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewayPolicyGroupMember; + }); + } +} 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..5b021ba42a17e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySku.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VirtualNetworkGatewaySku details. + */ +@Fluent +public final class VirtualNetworkGatewaySku implements JsonSerializable { + /* + * Gateway SKU name. + */ + private VirtualNetworkGatewaySkuName name; + + /* + * Gateway SKU tier. + */ + private VirtualNetworkGatewaySkuTier tier; + + /* + * The capacity. + */ + private Integer capacity; + + /** + * Creates an instance of VirtualNetworkGatewaySku class. + */ + public VirtualNetworkGatewaySku() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkGatewaySku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkGatewaySku if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkGatewaySku. + */ + public static VirtualNetworkGatewaySku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkGatewaySku deserializedVirtualNetworkGatewaySku = new VirtualNetworkGatewaySku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualNetworkGatewaySku.name + = VirtualNetworkGatewaySkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedVirtualNetworkGatewaySku.tier + = VirtualNetworkGatewaySkuTier.fromString(reader.getString()); + } else if ("capacity".equals(fieldName)) { + deserializedVirtualNetworkGatewaySku.capacity = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkGatewaySku; + }); + } +} 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..fd9417ff0f8d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuName.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gateway SKU name. + */ +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"); + + /** + * Static value ErGwScale for VirtualNetworkGatewaySkuName. + */ + public static final VirtualNetworkGatewaySkuName ER_GW_SCALE = fromString("ErGwScale"); + + /** + * Creates a new instance of VirtualNetworkGatewaySkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkGatewaySkuName() { + } + + /** + * Creates or finds a VirtualNetworkGatewaySkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewaySkuName. + */ + public static VirtualNetworkGatewaySkuName fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuName.class); + } + + /** + * Gets known VirtualNetworkGatewaySkuName values. + * + * @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..81569fa7f4eaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewaySkuTier.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gateway SKU tier. + */ +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"); + + /** + * Static value ErGwScale for VirtualNetworkGatewaySkuTier. + */ + public static final VirtualNetworkGatewaySkuTier ER_GW_SCALE = fromString("ErGwScale"); + + /** + * Creates a new instance of VirtualNetworkGatewaySkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkGatewaySkuTier() { + } + + /** + * Creates or finds a VirtualNetworkGatewaySkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewaySkuTier. + */ + public static VirtualNetworkGatewaySkuTier fromString(String name) { + return fromString(name, VirtualNetworkGatewaySkuTier.class); + } + + /** + * Gets known VirtualNetworkGatewaySkuTier values. + * + * @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..416702304afd6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGatewayType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of this virtual network gateway. + */ +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 a new instance of VirtualNetworkGatewayType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkGatewayType() { + } + + /** + * Creates or finds a VirtualNetworkGatewayType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkGatewayType. + */ + public static VirtualNetworkGatewayType fromString(String name) { + return fromString(name, VirtualNetworkGatewayType.class); + } + + /** + * Gets known VirtualNetworkGatewayType values. + * + * @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..ae3df275a8a82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkGateways.java @@ -0,0 +1,623 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String virtualNetworkGatewayName, 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. + */ + VirtualNetworkGateway getByResourceGroup(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response supportedVpnDevicesWithResponse(String resourceGroupName, String virtualNetworkGatewayName, + 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); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + */ + Response vpnDeviceConfigurationScriptWithResponse(String resourceGroupName, + String virtualNetworkGatewayConnectionName, VpnDeviceScriptParameters parameters, 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..74ea5740c43fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the ListVirtualNetworks API service call. + */ +@Fluent +public final class VirtualNetworkListResult implements JsonSerializable { + /* + * A list of VirtualNetwork resources in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkListResult class. + */ + public VirtualNetworkListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkListResult. + */ + public static VirtualNetworkListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkListResult deserializedVirtualNetworkListResult = new VirtualNetworkListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkInner.fromJson(reader1)); + deserializedVirtualNetworkListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkListResult; + }); + } +} 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..7a7ebabff91f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkListUsageResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkUsageInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for the virtual networks GetUsage API service call. + */ +@Fluent +public final class VirtualNetworkListUsageResult implements JsonSerializable { + /* + * VirtualNetwork usage stats. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkListUsageResult class. + */ + public VirtualNetworkListUsageResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkListUsageResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkListUsageResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkListUsageResult. + */ + public static VirtualNetworkListUsageResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkListUsageResult deserializedVirtualNetworkListUsageResult + = new VirtualNetworkListUsageResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkUsageInner.fromJson(reader1)); + deserializedVirtualNetworkListUsageResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkListUsageResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkListUsageResult; + }); + } +} 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..61a61190194fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeering.java @@ -0,0 +1,908 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import java.util.List; + +/** + * 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 localAddressSpace property: The local address space of the local virtual network that is peered. + * + * @return the localAddressSpace value. + */ + AddressSpace localAddressSpace(); + + /** + * Gets the localVirtualNetworkAddressSpace property: The current local address space of the local virtual network + * that is peered. + * + * @return the localVirtualNetworkAddressSpace value. + */ + AddressSpace localVirtualNetworkAddressSpace(); + + /** + * 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 remoteVirtualNetworkEncryption property: The reference to the remote virtual network's encryption. + * + * @return the remoteVirtualNetworkEncryption value. + */ + VirtualNetworkEncryption remoteVirtualNetworkEncryption(); + + /** + * 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 peerCompleteVnets property: Whether complete virtual network address space is peered. + * + * @return the peerCompleteVnets value. + */ + Boolean peerCompleteVnets(); + + /** + * Gets the enableOnlyIPv6Peering property: Whether only Ipv6 address space is peered for subnet peering. + * + * @return the enableOnlyIPv6Peering value. + */ + Boolean enableOnlyIPv6Peering(); + + /** + * Gets the localSubnetNames property: List of local subnet names that are subnet peered with remote virtual + * network. + * + * @return the localSubnetNames value. + */ + List localSubnetNames(); + + /** + * Gets the remoteSubnetNames property: List of remote subnet names from remote virtual network that are subnet + * peered. + * + * @return the remoteSubnetNames value. + */ + List remoteSubnetNames(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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.WithLocalAddressSpace, + DefinitionStages.WithLocalVirtualNetworkAddressSpace, DefinitionStages.WithRemoteAddressSpace, + DefinitionStages.WithRemoteVirtualNetworkAddressSpace, DefinitionStages.WithRemoteBgpCommunities, + DefinitionStages.WithPeeringState, DefinitionStages.WithPeeringSyncLevel, + DefinitionStages.WithDoNotVerifyRemoteGateways, DefinitionStages.WithPeerCompleteVnets, + DefinitionStages.WithEnableOnlyIPv6Peering, DefinitionStages.WithLocalSubnetNames, + DefinitionStages.WithRemoteSubnetNames, 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 localAddressSpace. + */ + interface WithLocalAddressSpace { + /** + * Specifies the localAddressSpace property: The local address space of the local virtual network that is + * peered.. + * + * @param localAddressSpace The local address space of the local virtual network that is peered. + * @return the next definition stage. + */ + WithCreate withLocalAddressSpace(AddressSpace localAddressSpace); + } + + /** + * The stage of the VirtualNetworkPeering definition allowing to specify localVirtualNetworkAddressSpace. + */ + interface WithLocalVirtualNetworkAddressSpace { + /** + * Specifies the localVirtualNetworkAddressSpace property: The current local address space of the local + * virtual network that is peered.. + * + * @param localVirtualNetworkAddressSpace The current local address space of the local virtual network that + * is peered. + * @return the next definition stage. + */ + WithCreate withLocalVirtualNetworkAddressSpace(AddressSpace localVirtualNetworkAddressSpace); + } + + /** + * 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 peerCompleteVnets. + */ + interface WithPeerCompleteVnets { + /** + * Specifies the peerCompleteVnets property: Whether complete virtual network address space is peered.. + * + * @param peerCompleteVnets Whether complete virtual network address space is peered. + * @return the next definition stage. + */ + WithCreate withPeerCompleteVnets(Boolean peerCompleteVnets); + } + + /** + * The stage of the VirtualNetworkPeering definition allowing to specify enableOnlyIPv6Peering. + */ + interface WithEnableOnlyIPv6Peering { + /** + * Specifies the enableOnlyIPv6Peering property: Whether only Ipv6 address space is peered for subnet + * peering.. + * + * @param enableOnlyIPv6Peering Whether only Ipv6 address space is peered for subnet peering. + * @return the next definition stage. + */ + WithCreate withEnableOnlyIPv6Peering(Boolean enableOnlyIPv6Peering); + } + + /** + * The stage of the VirtualNetworkPeering definition allowing to specify localSubnetNames. + */ + interface WithLocalSubnetNames { + /** + * Specifies the localSubnetNames property: List of local subnet names that are subnet peered with remote + * virtual network.. + * + * @param localSubnetNames List of local subnet names that are subnet peered with remote virtual network. + * @return the next definition stage. + */ + WithCreate withLocalSubnetNames(List localSubnetNames); + } + + /** + * The stage of the VirtualNetworkPeering definition allowing to specify remoteSubnetNames. + */ + interface WithRemoteSubnetNames { + /** + * Specifies the remoteSubnetNames property: List of remote subnet names from remote virtual network that + * are subnet peered.. + * + * @param remoteSubnetNames List of remote subnet names from remote virtual network that are subnet peered. + * @return the next definition stage. + */ + WithCreate withRemoteSubnetNames(List remoteSubnetNames); + } + + /** + * 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.WithLocalAddressSpace, + UpdateStages.WithLocalVirtualNetworkAddressSpace, UpdateStages.WithRemoteAddressSpace, + UpdateStages.WithRemoteVirtualNetworkAddressSpace, UpdateStages.WithRemoteBgpCommunities, + UpdateStages.WithPeeringState, UpdateStages.WithPeeringSyncLevel, UpdateStages.WithDoNotVerifyRemoteGateways, + UpdateStages.WithPeerCompleteVnets, UpdateStages.WithEnableOnlyIPv6Peering, UpdateStages.WithLocalSubnetNames, + UpdateStages.WithRemoteSubnetNames, 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 localAddressSpace. + */ + interface WithLocalAddressSpace { + /** + * Specifies the localAddressSpace property: The local address space of the local virtual network that is + * peered.. + * + * @param localAddressSpace The local address space of the local virtual network that is peered. + * @return the next definition stage. + */ + Update withLocalAddressSpace(AddressSpace localAddressSpace); + } + + /** + * The stage of the VirtualNetworkPeering update allowing to specify localVirtualNetworkAddressSpace. + */ + interface WithLocalVirtualNetworkAddressSpace { + /** + * Specifies the localVirtualNetworkAddressSpace property: The current local address space of the local + * virtual network that is peered.. + * + * @param localVirtualNetworkAddressSpace The current local address space of the local virtual network that + * is peered. + * @return the next definition stage. + */ + Update withLocalVirtualNetworkAddressSpace(AddressSpace localVirtualNetworkAddressSpace); + } + + /** + * 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 peerCompleteVnets. + */ + interface WithPeerCompleteVnets { + /** + * Specifies the peerCompleteVnets property: Whether complete virtual network address space is peered.. + * + * @param peerCompleteVnets Whether complete virtual network address space is peered. + * @return the next definition stage. + */ + Update withPeerCompleteVnets(Boolean peerCompleteVnets); + } + + /** + * The stage of the VirtualNetworkPeering update allowing to specify enableOnlyIPv6Peering. + */ + interface WithEnableOnlyIPv6Peering { + /** + * Specifies the enableOnlyIPv6Peering property: Whether only Ipv6 address space is peered for subnet + * peering.. + * + * @param enableOnlyIPv6Peering Whether only Ipv6 address space is peered for subnet peering. + * @return the next definition stage. + */ + Update withEnableOnlyIPv6Peering(Boolean enableOnlyIPv6Peering); + } + + /** + * The stage of the VirtualNetworkPeering update allowing to specify localSubnetNames. + */ + interface WithLocalSubnetNames { + /** + * Specifies the localSubnetNames property: List of local subnet names that are subnet peered with remote + * virtual network.. + * + * @param localSubnetNames List of local subnet names that are subnet peered with remote virtual network. + * @return the next definition stage. + */ + Update withLocalSubnetNames(List localSubnetNames); + } + + /** + * The stage of the VirtualNetworkPeering update allowing to specify remoteSubnetNames. + */ + interface WithRemoteSubnetNames { + /** + * Specifies the remoteSubnetNames property: List of remote subnet names from remote virtual network that + * are subnet peered.. + * + * @param remoteSubnetNames List of remote subnet names from remote virtual network that are subnet peered. + * @return the next definition stage. + */ + Update withRemoteSubnetNames(List remoteSubnetNames); + } + + /** + * 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..82536e7afb1bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringLevel.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 java.util.Collection; + +/** + * The peering sync status of the virtual network peering. + */ +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 a new instance of VirtualNetworkPeeringLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkPeeringLevel() { + } + + /** + * Creates or finds a VirtualNetworkPeeringLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPeeringLevel. + */ + public static VirtualNetworkPeeringLevel fromString(String name) { + return fromString(name, VirtualNetworkPeeringLevel.class); + } + + /** + * Gets known VirtualNetworkPeeringLevel values. + * + * @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..00196c6b148c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkPeeringInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. + */ +@Fluent +public final class VirtualNetworkPeeringListResult implements JsonSerializable { + /* + * The peerings in a virtual network. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkPeeringListResult class. + */ + public VirtualNetworkPeeringListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkPeeringListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkPeeringListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkPeeringListResult. + */ + public static VirtualNetworkPeeringListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkPeeringListResult deserializedVirtualNetworkPeeringListResult + = new VirtualNetworkPeeringListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkPeeringInner.fromJson(reader1)); + deserializedVirtualNetworkPeeringListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkPeeringListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkPeeringListResult; + }); + } +} 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..f08f2741bf084 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeeringState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the virtual network peering. + */ +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 a new instance of VirtualNetworkPeeringState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkPeeringState() { + } + + /** + * Creates or finds a VirtualNetworkPeeringState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPeeringState. + */ + public static VirtualNetworkPeeringState fromString(String name) { + return fromString(name, VirtualNetworkPeeringState.class); + } + + /** + * Gets known VirtualNetworkPeeringState values. + * + * @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..895cefacfc0ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPeerings.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response getWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..b1aa743bbdf1b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateEndpointNetworkPolicies.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enable or Disable apply network policies on private end point in the subnet. + */ +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"); + + /** + * Static value NetworkSecurityGroupEnabled for VirtualNetworkPrivateEndpointNetworkPolicies. + */ + public static final VirtualNetworkPrivateEndpointNetworkPolicies NETWORK_SECURITY_GROUP_ENABLED + = fromString("NetworkSecurityGroupEnabled"); + + /** + * Static value RouteTableEnabled for VirtualNetworkPrivateEndpointNetworkPolicies. + */ + public static final VirtualNetworkPrivateEndpointNetworkPolicies ROUTE_TABLE_ENABLED + = fromString("RouteTableEnabled"); + + /** + * Creates a new instance of VirtualNetworkPrivateEndpointNetworkPolicies value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkPrivateEndpointNetworkPolicies() { + } + + /** + * Creates or finds a VirtualNetworkPrivateEndpointNetworkPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPrivateEndpointNetworkPolicies. + */ + public static VirtualNetworkPrivateEndpointNetworkPolicies fromString(String name) { + return fromString(name, VirtualNetworkPrivateEndpointNetworkPolicies.class); + } + + /** + * Gets known VirtualNetworkPrivateEndpointNetworkPolicies values. + * + * @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..062bee8a9a7d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkPrivateLinkServiceNetworkPolicies.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 java.util.Collection; + +/** + * Enable or Disable apply network policies on private link service in the subnet. + */ +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 a new instance of VirtualNetworkPrivateLinkServiceNetworkPolicies value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualNetworkPrivateLinkServiceNetworkPolicies() { + } + + /** + * Creates or finds a VirtualNetworkPrivateLinkServiceNetworkPolicies from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualNetworkPrivateLinkServiceNetworkPolicies. + */ + public static VirtualNetworkPrivateLinkServiceNetworkPolicies fromString(String name) { + return fromString(name, VirtualNetworkPrivateLinkServiceNetworkPolicies.class); + } + + /** + * Gets known VirtualNetworkPrivateLinkServiceNetworkPolicies values. + * + * @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..4c5c99f3a0639 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTap.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..d916c65d20721 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListVirtualNetworkTap API service call. + */ +@Fluent +public final class VirtualNetworkTapListResult implements JsonSerializable { + /* + * A list of VirtualNetworkTaps in a resource group. + */ + private List value; + + /* + * The URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualNetworkTapListResult class. + */ + public VirtualNetworkTapListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkTapListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkTapListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkTapListResult. + */ + public static VirtualNetworkTapListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkTapListResult deserializedVirtualNetworkTapListResult = new VirtualNetworkTapListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualNetworkTapInner.fromJson(reader1)); + deserializedVirtualNetworkTapListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualNetworkTapListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkTapListResult; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapPropertiesFormat.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapPropertiesFormat.java new file mode 100644 index 0000000000000..3c3ee1bbdf32f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTapPropertiesFormat.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.resourcemanager.network.generated.fluent.models.VirtualNetworkTapPropertiesFormatInner; +import java.util.List; + +/** + * An immutable client-side representation of VirtualNetworkTapPropertiesFormat. + */ +public interface VirtualNetworkTapPropertiesFormat { + /** + * 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 inner com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapPropertiesFormatInner + * object. + * + * @return the inner object. + */ + VirtualNetworkTapPropertiesFormatInner innerModel(); +} 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..052a5570340ec --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkTaps.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..91440bc29f858 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsage.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.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..988324a2cfac5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworkUsageName.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Usage strings container. + */ +@Immutable +public final class VirtualNetworkUsageName implements JsonSerializable { + /* + * Localized subnet size and usage string. + */ + private String localizedValue; + + /* + * Subnet size and usage string. + */ + private String value; + + /** + * Creates an instance of VirtualNetworkUsageName class. + */ + public VirtualNetworkUsageName() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkUsageName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkUsageName if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualNetworkUsageName. + */ + public static VirtualNetworkUsageName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkUsageName deserializedVirtualNetworkUsageName = new VirtualNetworkUsageName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("localizedValue".equals(fieldName)) { + deserializedVirtualNetworkUsageName.localizedValue = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedVirtualNetworkUsageName.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkUsageName; + }); + } +} 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..f258a185c6f6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualNetworks.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualNetworkName, + String expand, 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + */ + Response checkIpAddressAvailabilityWithResponse(String resourceGroupName, + String virtualNetworkName, String ipAddress, 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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listUsage(String resourceGroupName, String virtualNetworkName, Context context); + + /** + * Gets the Ddos Protection Status of all IP Addresses under the 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 Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName); + + /** + * Gets the Ddos Protection Status of all IP Addresses under the Virtual Network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param top The max number of ip addresses to return. + * @param skipToken The skipToken that is given with nextLink. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Ddos Protection Status of all IP Addresses under the Virtual Network as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listDdosProtectionStatus(String resourceGroupName, + String virtualNetworkName, Integer top, String skipToken, 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..90b17de680c90 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouter.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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/VirtualRouterAutoScaleConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterAutoScaleConfiguration.java new file mode 100644 index 0000000000000..7658b42b7357b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterAutoScaleConfiguration.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The VirtualHub Router autoscale configuration. + */ +@Fluent +public final class VirtualRouterAutoScaleConfiguration + implements JsonSerializable { + /* + * The minimum number of scale units for VirtualHub Router. + */ + private Integer minCapacity; + + /** + * Creates an instance of VirtualRouterAutoScaleConfiguration class. + */ + public VirtualRouterAutoScaleConfiguration() { + } + + /** + * Get the minCapacity property: The minimum number of scale units for VirtualHub Router. + * + * @return the minCapacity value. + */ + public Integer minCapacity() { + return this.minCapacity; + } + + /** + * Set the minCapacity property: The minimum number of scale units for VirtualHub Router. + * + * @param minCapacity the minCapacity value to set. + * @return the VirtualRouterAutoScaleConfiguration object itself. + */ + public VirtualRouterAutoScaleConfiguration withMinCapacity(Integer minCapacity) { + this.minCapacity = minCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("minCapacity", this.minCapacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualRouterAutoScaleConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualRouterAutoScaleConfiguration if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualRouterAutoScaleConfiguration. + */ + public static VirtualRouterAutoScaleConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualRouterAutoScaleConfiguration deserializedVirtualRouterAutoScaleConfiguration + = new VirtualRouterAutoScaleConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("minCapacity".equals(fieldName)) { + deserializedVirtualRouterAutoScaleConfiguration.minCapacity + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualRouterAutoScaleConfiguration; + }); + } +} 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..cdaff91e235aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListVirtualRouters API service call. + */ +@Fluent +public final class VirtualRouterListResult implements JsonSerializable { + /* + * List of Virtual Routers. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualRouterListResult class. + */ + public VirtualRouterListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualRouterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualRouterListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualRouterListResult. + */ + public static VirtualRouterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualRouterListResult deserializedVirtualRouterListResult = new VirtualRouterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VirtualRouterInner.fromJson(reader1)); + deserializedVirtualRouterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualRouterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualRouterListResult; + }); + } +} 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..9494ade0bed83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeering.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.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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..628ff4d2e22fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeeringListResult.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualRouterPeeringInner; +import java.io.IOException; +import java.util.List; + +/** + * Response for ListVirtualRouterPeerings API service call. + */ +@Fluent +public final class VirtualRouterPeeringListResult implements JsonSerializable { + /* + * List of VirtualRouterPeerings in a VirtualRouter. + */ + private List value; + + /* + * URL to get the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of VirtualRouterPeeringListResult class. + */ + public VirtualRouterPeeringListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualRouterPeeringListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualRouterPeeringListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualRouterPeeringListResult. + */ + public static VirtualRouterPeeringListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualRouterPeeringListResult deserializedVirtualRouterPeeringListResult + = new VirtualRouterPeeringListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> VirtualRouterPeeringInner.fromJson(reader1)); + deserializedVirtualRouterPeeringListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVirtualRouterPeeringListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualRouterPeeringListResult; + }); + } +} 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..2981a8433322e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouterPeerings.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.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. + * @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 along with {@link Response}. + */ + Response getWithResponse(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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..a6a6c6fa6915a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualRouters.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 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. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualRouterName, + String expand, 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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..eb7a02290f568 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWan.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..b9b135b04f7c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProvider.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Collection of SecurityProviders. + */ +@Fluent +public final class VirtualWanSecurityProvider implements JsonSerializable { + /* + * Name of the security provider. + */ + private String name; + + /* + * Url of the security provider. + */ + private String url; + + /* + * Name of the security provider. + */ + private VirtualWanSecurityProviderType type; + + /** + * Creates an instance of VirtualWanSecurityProvider class. + */ + public VirtualWanSecurityProvider() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualWanSecurityProvider from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualWanSecurityProvider if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualWanSecurityProvider. + */ + public static VirtualWanSecurityProvider fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualWanSecurityProvider deserializedVirtualWanSecurityProvider = new VirtualWanSecurityProvider(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVirtualWanSecurityProvider.name = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedVirtualWanSecurityProvider.url = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVirtualWanSecurityProvider.type + = VirtualWanSecurityProviderType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualWanSecurityProvider; + }); + } +} 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..fac0cba341a7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviderType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The virtual wan security provider type. + */ +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 a new instance of VirtualWanSecurityProviderType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VirtualWanSecurityProviderType() { + } + + /** + * Creates or finds a VirtualWanSecurityProviderType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VirtualWanSecurityProviderType. + */ + public static VirtualWanSecurityProviderType fromString(String name) { + return fromString(name, VirtualWanSecurityProviderType.class); + } + + /** + * Gets known VirtualWanSecurityProviderType values. + * + * @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..d7302851aa06f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanSecurityProviders.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.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..6acac643ca6e5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWanVpnProfileParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Virtual Wan Vpn profile parameters Vpn profile generation. + */ +@Fluent +public final class VirtualWanVpnProfileParameters implements JsonSerializable { + /* + * VpnServerConfiguration partial resource uri with which VirtualWan is associated to. + */ + private String vpnServerConfigurationResourceId; + + /* + * VPN client authentication method. + */ + private AuthenticationMethod authenticationMethod; + + /** + * Creates an instance of VirtualWanVpnProfileParameters class. + */ + public VirtualWanVpnProfileParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vpnServerConfigurationResourceId", this.vpnServerConfigurationResourceId); + jsonWriter.writeStringField("authenticationMethod", + this.authenticationMethod == null ? null : this.authenticationMethod.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualWanVpnProfileParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualWanVpnProfileParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VirtualWanVpnProfileParameters. + */ + public static VirtualWanVpnProfileParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualWanVpnProfileParameters deserializedVirtualWanVpnProfileParameters + = new VirtualWanVpnProfileParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnServerConfigurationResourceId".equals(fieldName)) { + deserializedVirtualWanVpnProfileParameters.vpnServerConfigurationResourceId = reader.getString(); + } else if ("authenticationMethod".equals(fieldName)) { + deserializedVirtualWanVpnProfileParameters.authenticationMethod + = AuthenticationMethod.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualWanVpnProfileParameters; + }); + } +} 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..1fe0e41bfae78 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VirtualWans.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String virtualWanName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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/VnetLocalRouteOverrideCriteria.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetLocalRouteOverrideCriteria.java new file mode 100644 index 0000000000000..8419310977279 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetLocalRouteOverrideCriteria.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in spoke vnet. + */ +public final class VnetLocalRouteOverrideCriteria extends ExpandableStringEnum { + /** + * Static value Contains for VnetLocalRouteOverrideCriteria. + */ + public static final VnetLocalRouteOverrideCriteria CONTAINS = fromString("Contains"); + + /** + * Static value Equal for VnetLocalRouteOverrideCriteria. + */ + public static final VnetLocalRouteOverrideCriteria EQUAL = fromString("Equal"); + + /** + * Creates a new instance of VnetLocalRouteOverrideCriteria value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VnetLocalRouteOverrideCriteria() { + } + + /** + * Creates or finds a VnetLocalRouteOverrideCriteria from its string representation. + * + * @param name a name to look for. + * @return the corresponding VnetLocalRouteOverrideCriteria. + */ + public static VnetLocalRouteOverrideCriteria fromString(String name) { + return fromString(name, VnetLocalRouteOverrideCriteria.class); + } + + /** + * Gets known VnetLocalRouteOverrideCriteria values. + * + * @return known VnetLocalRouteOverrideCriteria values. + */ + public static Collection values() { + return values(VnetLocalRouteOverrideCriteria.class); + } +} 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..a9040f9df302f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VnetRoute.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.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of routes that control routing from VirtualHub into a virtual network connection. + */ +@Fluent +public final class VnetRoute implements JsonSerializable { + /* + * Configuration for static routes on this HubVnetConnection. + */ + private StaticRoutesConfig staticRoutesConfig; + + /* + * List of all Static Routes. + */ + private List staticRoutes; + + /* + * The list of references to HubBgpConnection objects. + */ + private List bgpConnections; + + /** + * Creates an instance of VnetRoute class. + */ + public VnetRoute() { + } + + /** + * Get the staticRoutesConfig property: Configuration for static routes on this HubVnetConnection. + * + * @return the staticRoutesConfig value. + */ + public StaticRoutesConfig staticRoutesConfig() { + return this.staticRoutesConfig; + } + + /** + * Set the staticRoutesConfig property: Configuration for static routes on this HubVnetConnection. + * + * @param staticRoutesConfig the staticRoutesConfig value to set. + * @return the VnetRoute object itself. + */ + public VnetRoute withStaticRoutesConfig(StaticRoutesConfig staticRoutesConfig) { + this.staticRoutesConfig = staticRoutesConfig; + return this; + } + + /** + * 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; + } + + /** + * Get the bgpConnections property: The list of references to HubBgpConnection objects. + * + * @return the bgpConnections value. + */ + public List bgpConnections() { + return this.bgpConnections; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (staticRoutesConfig() != null) { + staticRoutesConfig().validate(); + } + if (staticRoutes() != null) { + staticRoutes().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("staticRoutesConfig", this.staticRoutesConfig); + jsonWriter.writeArrayField("staticRoutes", this.staticRoutes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VnetRoute from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VnetRoute if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the VnetRoute. + */ + public static VnetRoute fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VnetRoute deserializedVnetRoute = new VnetRoute(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("staticRoutesConfig".equals(fieldName)) { + deserializedVnetRoute.staticRoutesConfig = StaticRoutesConfig.fromJson(reader); + } else if ("staticRoutes".equals(fieldName)) { + List staticRoutes = reader.readArray(reader1 -> StaticRoute.fromJson(reader1)); + deserializedVnetRoute.staticRoutes = staticRoutes; + } else if ("bgpConnections".equals(fieldName)) { + List bgpConnections = reader.readArray(reader1 -> SubResource.fromJson(reader1)); + deserializedVnetRoute.bgpConnections = bgpConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedVnetRoute; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VngClientConnectionConfiguration.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VngClientConnectionConfiguration.java new file mode 100644 index 0000000000000..f946b4b42c8a2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VngClientConnectionConfiguration.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.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VngClientConnectionConfigurationProperties; +import java.io.IOException; +import java.util.List; + +/** + * A vpn client connection configuration for client connection configuration. + */ +@Fluent +public final class VngClientConnectionConfiguration extends SubResource { + /* + * Properties of the vpn client root certificate. + */ + private VngClientConnectionConfigurationProperties innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VngClientConnectionConfiguration class. + */ + public VngClientConnectionConfiguration() { + } + + /** + * Get the innerProperties property: Properties of the vpn client root certificate. + * + * @return the innerProperties value. + */ + private VngClientConnectionConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 VngClientConnectionConfiguration object itself. + */ + public VngClientConnectionConfiguration 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VngClientConnectionConfiguration withId(String id) { + super.withId(id); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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 VngClientConnectionConfiguration object itself. + */ + public VngClientConnectionConfiguration withVpnClientAddressPool(AddressSpace vpnClientAddressPool) { + if (this.innerProperties() == null) { + this.innerProperties = new VngClientConnectionConfigurationProperties(); + } + this.innerProperties().withVpnClientAddressPool(vpnClientAddressPool); + return this; + } + + /** + * Get the virtualNetworkGatewayPolicyGroups property: List of references to virtualNetworkGatewayPolicyGroups. + * + * @return the virtualNetworkGatewayPolicyGroups value. + */ + public List virtualNetworkGatewayPolicyGroups() { + return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkGatewayPolicyGroups(); + } + + /** + * Set the virtualNetworkGatewayPolicyGroups property: List of references to virtualNetworkGatewayPolicyGroups. + * + * @param virtualNetworkGatewayPolicyGroups the virtualNetworkGatewayPolicyGroups value to set. + * @return the VngClientConnectionConfiguration object itself. + */ + public VngClientConnectionConfiguration + withVirtualNetworkGatewayPolicyGroups(List virtualNetworkGatewayPolicyGroups) { + if (this.innerProperties() == null) { + this.innerProperties = new VngClientConnectionConfigurationProperties(); + } + this.innerProperties().withVirtualNetworkGatewayPolicyGroups(virtualNetworkGatewayPolicyGroups); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the VngClientConnectionConfiguration resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VngClientConnectionConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VngClientConnectionConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VngClientConnectionConfiguration. + */ + public static VngClientConnectionConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VngClientConnectionConfiguration deserializedVngClientConnectionConfiguration + = new VngClientConnectionConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVngClientConnectionConfiguration.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVngClientConnectionConfiguration.innerProperties + = VngClientConnectionConfigurationProperties.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVngClientConnectionConfiguration.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVngClientConnectionConfiguration.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVngClientConnectionConfiguration; + }); + } +} 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..93518426084fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnAuthenticationType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VPN authentication types enabled for the virtual network gateway. + */ +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 a new instance of VpnAuthenticationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnAuthenticationType() { + } + + /** + * Creates or finds a VpnAuthenticationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnAuthenticationType. + */ + public static VpnAuthenticationType fromString(String name) { + return fromString(name, VpnAuthenticationType.class); + } + + /** + * Gets known VpnAuthenticationType values. + * + * @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..fd0062df901c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConfiguration.java @@ -0,0 +1,488 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VpnClientConfiguration for P2S client. + */ +@Fluent +public final class VpnClientConfiguration implements JsonSerializable { + /* + * The reference to the address space resource which represents Address space for P2S VpnClient. + */ + private AddressSpace vpnClientAddressPool; + + /* + * VpnClientRootCertificate for virtual network gateway. + */ + private List vpnClientRootCertificates; + + /* + * VpnClientRevokedCertificate for Virtual network gateway. + */ + private List vpnClientRevokedCertificates; + + /* + * VpnClientProtocols for Virtual network gateway. + */ + private List vpnClientProtocols; + + /* + * VPN authentication types for the virtual network gateway.. + */ + private List vpnAuthenticationTypes; + + /* + * VpnClientIpsecPolicies for virtual network gateway P2S client. + */ + private List vpnClientIpsecPolicies; + + /* + * The radius server address property of the VirtualNetworkGateway resource for vpn client connection. + */ + private String radiusServerAddress; + + /* + * The radius secret property of the VirtualNetworkGateway resource for vpn client connection. + */ + private String radiusServerSecret; + + /* + * The radiusServers property for multiple radius server configuration. + */ + private List radiusServers; + + /* + * The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD + * authentication. + */ + private String aadTenant; + + /* + * The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD + * authentication. + */ + private String aadAudience; + + /* + * The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD + * authentication. + */ + private String aadIssuer; + + /* + * per ip address pool connection policy for virtual network gateway P2S client. + */ + private List vngClientConnectionConfigurations; + + /** + * Creates an instance of VpnClientConfiguration class. + */ + public VpnClientConfiguration() { + } + + /** + * 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; + } + + /** + * Get the vngClientConnectionConfigurations property: per ip address pool connection policy for virtual network + * gateway P2S client. + * + * @return the vngClientConnectionConfigurations value. + */ + public List vngClientConnectionConfigurations() { + return this.vngClientConnectionConfigurations; + } + + /** + * Set the vngClientConnectionConfigurations property: per ip address pool connection policy for virtual network + * gateway P2S client. + * + * @param vngClientConnectionConfigurations the vngClientConnectionConfigurations value to set. + * @return the VpnClientConfiguration object itself. + */ + public VpnClientConfiguration withVngClientConnectionConfigurations( + List vngClientConnectionConfigurations) { + this.vngClientConnectionConfigurations = vngClientConnectionConfigurations; + 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()); + } + if (vngClientConnectionConfigurations() != null) { + vngClientConnectionConfigurations().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("vpnClientAddressPool", this.vpnClientAddressPool); + jsonWriter.writeArrayField("vpnClientRootCertificates", this.vpnClientRootCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("vpnClientRevokedCertificates", this.vpnClientRevokedCertificates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("vpnClientProtocols", this.vpnClientProtocols, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("vpnAuthenticationTypes", this.vpnAuthenticationTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("vpnClientIpsecPolicies", this.vpnClientIpsecPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("radiusServerAddress", this.radiusServerAddress); + jsonWriter.writeStringField("radiusServerSecret", this.radiusServerSecret); + jsonWriter.writeArrayField("radiusServers", this.radiusServers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("aadTenant", this.aadTenant); + jsonWriter.writeStringField("aadAudience", this.aadAudience); + jsonWriter.writeStringField("aadIssuer", this.aadIssuer); + jsonWriter.writeArrayField("vngClientConnectionConfigurations", this.vngClientConnectionConfigurations, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientConfiguration if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnClientConfiguration. + */ + public static VpnClientConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientConfiguration deserializedVpnClientConfiguration = new VpnClientConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnClientAddressPool".equals(fieldName)) { + deserializedVpnClientConfiguration.vpnClientAddressPool = AddressSpace.fromJson(reader); + } else if ("vpnClientRootCertificates".equals(fieldName)) { + List vpnClientRootCertificates + = reader.readArray(reader1 -> VpnClientRootCertificate.fromJson(reader1)); + deserializedVpnClientConfiguration.vpnClientRootCertificates = vpnClientRootCertificates; + } else if ("vpnClientRevokedCertificates".equals(fieldName)) { + List vpnClientRevokedCertificates + = reader.readArray(reader1 -> VpnClientRevokedCertificate.fromJson(reader1)); + deserializedVpnClientConfiguration.vpnClientRevokedCertificates = vpnClientRevokedCertificates; + } else if ("vpnClientProtocols".equals(fieldName)) { + List vpnClientProtocols + = reader.readArray(reader1 -> VpnClientProtocol.fromString(reader1.getString())); + deserializedVpnClientConfiguration.vpnClientProtocols = vpnClientProtocols; + } else if ("vpnAuthenticationTypes".equals(fieldName)) { + List vpnAuthenticationTypes + = reader.readArray(reader1 -> VpnAuthenticationType.fromString(reader1.getString())); + deserializedVpnClientConfiguration.vpnAuthenticationTypes = vpnAuthenticationTypes; + } else if ("vpnClientIpsecPolicies".equals(fieldName)) { + List vpnClientIpsecPolicies + = reader.readArray(reader1 -> IpsecPolicy.fromJson(reader1)); + deserializedVpnClientConfiguration.vpnClientIpsecPolicies = vpnClientIpsecPolicies; + } else if ("radiusServerAddress".equals(fieldName)) { + deserializedVpnClientConfiguration.radiusServerAddress = reader.getString(); + } else if ("radiusServerSecret".equals(fieldName)) { + deserializedVpnClientConfiguration.radiusServerSecret = reader.getString(); + } else if ("radiusServers".equals(fieldName)) { + List radiusServers = reader.readArray(reader1 -> RadiusServer.fromJson(reader1)); + deserializedVpnClientConfiguration.radiusServers = radiusServers; + } else if ("aadTenant".equals(fieldName)) { + deserializedVpnClientConfiguration.aadTenant = reader.getString(); + } else if ("aadAudience".equals(fieldName)) { + deserializedVpnClientConfiguration.aadAudience = reader.getString(); + } else if ("aadIssuer".equals(fieldName)) { + deserializedVpnClientConfiguration.aadIssuer = reader.getString(); + } else if ("vngClientConnectionConfigurations".equals(fieldName)) { + List vngClientConnectionConfigurations + = reader.readArray(reader1 -> VngClientConnectionConfiguration.fromJson(reader1)); + deserializedVpnClientConfiguration.vngClientConnectionConfigurations + = vngClientConnectionConfigurations; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientConfiguration; + }); + } +} 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..3447e4d940e41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealth.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * VpnClientConnectionHealth properties. + */ +@Fluent +public final class VpnClientConnectionHealth implements JsonSerializable { + /* + * Total of the Ingress Bytes Transferred in this P2S Vpn connection. + */ + private Long totalIngressBytesTransferred; + + /* + * Total of the Egress Bytes Transferred in this connection. + */ + private Long totalEgressBytesTransferred; + + /* + * The total of p2s vpn clients connected at this time to this P2SVpnGateway. + */ + private Integer vpnClientConnectionsCount; + + /* + * List of allocated ip addresses to the connected p2s vpn clients. + */ + private List allocatedIpAddresses; + + /** + * Creates an instance of VpnClientConnectionHealth class. + */ + public VpnClientConnectionHealth() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("vpnClientConnectionsCount", this.vpnClientConnectionsCount); + jsonWriter.writeArrayField("allocatedIpAddresses", this.allocatedIpAddresses, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientConnectionHealth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientConnectionHealth if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnClientConnectionHealth. + */ + public static VpnClientConnectionHealth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientConnectionHealth deserializedVpnClientConnectionHealth = new VpnClientConnectionHealth(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalIngressBytesTransferred".equals(fieldName)) { + deserializedVpnClientConnectionHealth.totalIngressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("totalEgressBytesTransferred".equals(fieldName)) { + deserializedVpnClientConnectionHealth.totalEgressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("vpnClientConnectionsCount".equals(fieldName)) { + deserializedVpnClientConnectionHealth.vpnClientConnectionsCount + = reader.getNullable(JsonReader::getInt); + } else if ("allocatedIpAddresses".equals(fieldName)) { + List allocatedIpAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedVpnClientConnectionHealth.allocatedIpAddresses = allocatedIpAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientConnectionHealth; + }); + } +} 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..23121fd420903 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetail.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VPN client connection health detail. + */ +@Immutable +public final class VpnClientConnectionHealthDetail implements JsonSerializable { + /* + * The vpn client Id. + */ + private String vpnConnectionId; + + /* + * The duration time of a connected vpn client. + */ + private Long vpnConnectionDuration; + + /* + * The start time of a connected vpn client. + */ + private String vpnConnectionTime; + + /* + * The public Ip of a connected vpn client. + */ + private String publicIpAddress; + + /* + * The assigned private Ip of a connected vpn client. + */ + private String privateIpAddress; + + /* + * The user name of a connected vpn client. + */ + private String vpnUsername; + + /* + * The max band width. + */ + private Long maxBandwidth; + + /* + * The egress packets per second. + */ + private Long egressPacketsTransferred; + + /* + * The egress bytes per second. + */ + private Long egressBytesTransferred; + + /* + * The ingress packets per second. + */ + private Long ingressPacketsTransferred; + + /* + * The ingress bytes per second. + */ + private Long ingressBytesTransferred; + + /* + * The max packets transferred per second. + */ + private Long maxPacketsPerSecond; + + /** + * Creates an instance of VpnClientConnectionHealthDetail class. + */ + public VpnClientConnectionHealthDetail() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientConnectionHealthDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientConnectionHealthDetail if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnClientConnectionHealthDetail. + */ + public static VpnClientConnectionHealthDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientConnectionHealthDetail deserializedVpnClientConnectionHealthDetail + = new VpnClientConnectionHealthDetail(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vpnConnectionId".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.vpnConnectionId = reader.getString(); + } else if ("vpnConnectionDuration".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.vpnConnectionDuration + = reader.getNullable(JsonReader::getLong); + } else if ("vpnConnectionTime".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.vpnConnectionTime = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.publicIpAddress = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.privateIpAddress = reader.getString(); + } else if ("vpnUserName".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.vpnUsername = reader.getString(); + } else if ("maxBandwidth".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.maxBandwidth = reader.getNullable(JsonReader::getLong); + } else if ("egressPacketsTransferred".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.egressPacketsTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("egressBytesTransferred".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.egressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("ingressPacketsTransferred".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.ingressPacketsTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("ingressBytesTransferred".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.ingressBytesTransferred + = reader.getNullable(JsonReader::getLong); + } else if ("maxPacketsPerSecond".equals(fieldName)) { + deserializedVpnClientConnectionHealthDetail.maxPacketsPerSecond + = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientConnectionHealthDetail; + }); + } +} 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..f2307fe34eb5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientConnectionHealthDetailListResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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..f3f1aaa4477a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientIPsecParameters.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.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..930c7f95aaae5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Vpn Client Parameters for package generation. + */ +@Fluent +public final class VpnClientParameters implements JsonSerializable { + /* + * VPN client Processor Architecture. + */ + private ProcessorArchitecture processorArchitecture; + + /* + * VPN client authentication method. + */ + 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. + */ + 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. + */ + private List clientRootCertificates; + + /** + * Creates an instance of VpnClientParameters class. + */ + public VpnClientParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("processorArchitecture", + this.processorArchitecture == null ? null : this.processorArchitecture.toString()); + jsonWriter.writeStringField("authenticationMethod", + this.authenticationMethod == null ? null : this.authenticationMethod.toString()); + jsonWriter.writeStringField("radiusServerAuthCertificate", this.radiusServerAuthCertificate); + jsonWriter.writeArrayField("clientRootCertificates", this.clientRootCertificates, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnClientParameters. + */ + public static VpnClientParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientParameters deserializedVpnClientParameters = new VpnClientParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("processorArchitecture".equals(fieldName)) { + deserializedVpnClientParameters.processorArchitecture + = ProcessorArchitecture.fromString(reader.getString()); + } else if ("authenticationMethod".equals(fieldName)) { + deserializedVpnClientParameters.authenticationMethod + = AuthenticationMethod.fromString(reader.getString()); + } else if ("radiusServerAuthCertificate".equals(fieldName)) { + deserializedVpnClientParameters.radiusServerAuthCertificate = reader.getString(); + } else if ("clientRootCertificates".equals(fieldName)) { + List clientRootCertificates = reader.readArray(reader1 -> reader1.getString()); + deserializedVpnClientParameters.clientRootCertificates = clientRootCertificates; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientParameters; + }); + } +} 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..c627fde0bd820 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VPN client protocol enabled for the virtual network gateway. + */ +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 a new instance of VpnClientProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnClientProtocol() { + } + + /** + * Creates or finds a VpnClientProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnClientProtocol. + */ + public static VpnClientProtocol fromString(String name) { + return fromString(name, VpnClientProtocol.class); + } + + /** + * Gets known VpnClientProtocol values. + * + * @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..2d4d6034d7e81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRevokedCertificate.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientRevokedCertificatePropertiesFormat; +import java.io.IOException; + +/** + * VPN client revoked certificate of virtual network gateway. + */ +@Fluent +public final class VpnClientRevokedCertificate extends SubResource { + /* + * Properties of the vpn client revoked certificate. + */ + private VpnClientRevokedCertificatePropertiesFormat innerProperties; + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VpnClientRevokedCertificate class. + */ + public VpnClientRevokedCertificate() { + } + + /** + * Get the innerProperties property: Properties of the vpn client revoked certificate. + * + * @return the innerProperties value. + */ + private VpnClientRevokedCertificatePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnClientRevokedCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the thumbprint property: The revoked VPN client certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnClientRevokedCertificatePropertiesFormat(); + } + this.innerProperties().withThumbprint(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientRevokedCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientRevokedCertificate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnClientRevokedCertificate. + */ + public static VpnClientRevokedCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientRevokedCertificate deserializedVpnClientRevokedCertificate = new VpnClientRevokedCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnClientRevokedCertificate.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVpnClientRevokedCertificate.innerProperties + = VpnClientRevokedCertificatePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVpnClientRevokedCertificate.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVpnClientRevokedCertificate.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientRevokedCertificate; + }); + } +} 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..33442953ec933 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnClientRootCertificate.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.VpnClientRootCertificatePropertiesFormat; +import java.io.IOException; + +/** + * VPN client root certificate of virtual network gateway. + */ +@Fluent +public final class VpnClientRootCertificate extends SubResource { + /* + * Properties of the vpn client root certificate. + */ + private VpnClientRootCertificatePropertiesFormat innerProperties = new VpnClientRootCertificatePropertiesFormat(); + + /* + * The name of the resource that is unique within a resource group. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /** + * Creates an instance of VpnClientRootCertificate class. + */ + public VpnClientRootCertificate() { + } + + /** + * Get the innerProperties property: Properties of the vpn client root certificate. + * + * @return the innerProperties value. + */ + private VpnClientRootCertificatePropertiesFormat innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public VpnClientRootCertificate withId(String id) { + super.withId(id); + return this; + } + + /** + * Get the publicCertData property: The certificate public data. + * + * @return the publicCertData value. + */ + public String publicCertData() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new VpnClientRootCertificatePropertiesFormat(); + } + this.innerProperties().withPublicCertData(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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model VpnClientRootCertificate")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VpnClientRootCertificate.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnClientRootCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnClientRootCertificate if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VpnClientRootCertificate. + */ + public static VpnClientRootCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnClientRootCertificate deserializedVpnClientRootCertificate = new VpnClientRootCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnClientRootCertificate.withId(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedVpnClientRootCertificate.innerProperties + = VpnClientRootCertificatePropertiesFormat.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedVpnClientRootCertificate.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedVpnClientRootCertificate.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnClientRootCertificate; + }); + } +} 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..45b798d0a94d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnection.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.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..4cca274b05c17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStartParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Vpn Connection packet capture parameters supplied to start packet capture on gateway connection. + */ +@Fluent +public final class VpnConnectionPacketCaptureStartParameters + implements JsonSerializable { + /* + * Start Packet capture parameters on vpn connection. + */ + private String filterData; + + /* + * List of site link connection names. + */ + private List linkConnectionNames; + + /** + * Creates an instance of VpnConnectionPacketCaptureStartParameters class. + */ + public VpnConnectionPacketCaptureStartParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterData", this.filterData); + jsonWriter.writeArrayField("linkConnectionNames", this.linkConnectionNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnConnectionPacketCaptureStartParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnConnectionPacketCaptureStartParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnConnectionPacketCaptureStartParameters. + */ + public static VpnConnectionPacketCaptureStartParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnConnectionPacketCaptureStartParameters deserializedVpnConnectionPacketCaptureStartParameters + = new VpnConnectionPacketCaptureStartParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterData".equals(fieldName)) { + deserializedVpnConnectionPacketCaptureStartParameters.filterData = reader.getString(); + } else if ("linkConnectionNames".equals(fieldName)) { + List linkConnectionNames = reader.readArray(reader1 -> reader1.getString()); + deserializedVpnConnectionPacketCaptureStartParameters.linkConnectionNames = linkConnectionNames; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnConnectionPacketCaptureStartParameters; + }); + } +} 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..334810128e8df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionPacketCaptureStopParameters.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. + */ +@Fluent +public final class VpnConnectionPacketCaptureStopParameters + implements JsonSerializable { + /* + * SAS url for packet capture on vpn connection. + */ + private String sasUrl; + + /* + * List of site link connection names. + */ + private List linkConnectionNames; + + /** + * Creates an instance of VpnConnectionPacketCaptureStopParameters class. + */ + public VpnConnectionPacketCaptureStopParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sasUrl", this.sasUrl); + jsonWriter.writeArrayField("linkConnectionNames", this.linkConnectionNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnConnectionPacketCaptureStopParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnConnectionPacketCaptureStopParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnConnectionPacketCaptureStopParameters. + */ + public static VpnConnectionPacketCaptureStopParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnConnectionPacketCaptureStopParameters deserializedVpnConnectionPacketCaptureStopParameters + = new VpnConnectionPacketCaptureStopParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasUrl".equals(fieldName)) { + deserializedVpnConnectionPacketCaptureStopParameters.sasUrl = reader.getString(); + } else if ("linkConnectionNames".equals(fieldName)) { + List linkConnectionNames = reader.readArray(reader1 -> reader1.getString()); + deserializedVpnConnectionPacketCaptureStopParameters.linkConnectionNames = linkConnectionNames; + } else { + reader.skipChildren(); + } + } + + return deserializedVpnConnectionPacketCaptureStopParameters; + }); + } +} 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..1ece4e660de91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnectionStatus.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 java.util.Collection; + +/** + * The current state of the vpn connection. + */ +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 a new instance of VpnConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnConnectionStatus() { + } + + /** + * Creates or finds a VpnConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnConnectionStatus. + */ + public static VpnConnectionStatus fromString(String name) { + return fromString(name, VpnConnectionStatus.class); + } + + /** + * Gets known VpnConnectionStatus values. + * + * @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..f6bccd6313e85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnConnections.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String gatewayName, String connectionName, + 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 com.azure.core.management.exception.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); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..5b9dbf4b2b5c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnDeviceScriptParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Vpn device configuration script generation parameters. + */ +@Fluent +public final class VpnDeviceScriptParameters implements JsonSerializable { + /* + * The vendor for the vpn device. + */ + private String vendor; + + /* + * The device family for the vpn device. + */ + private String deviceFamily; + + /* + * The firmware version for the vpn device. + */ + private String firmwareVersion; + + /** + * Creates an instance of VpnDeviceScriptParameters class. + */ + public VpnDeviceScriptParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("vendor", this.vendor); + jsonWriter.writeStringField("deviceFamily", this.deviceFamily); + jsonWriter.writeStringField("firmwareVersion", this.firmwareVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnDeviceScriptParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnDeviceScriptParameters if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnDeviceScriptParameters. + */ + public static VpnDeviceScriptParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnDeviceScriptParameters deserializedVpnDeviceScriptParameters = new VpnDeviceScriptParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vendor".equals(fieldName)) { + deserializedVpnDeviceScriptParameters.vendor = reader.getString(); + } else if ("deviceFamily".equals(fieldName)) { + deserializedVpnDeviceScriptParameters.deviceFamily = reader.getString(); + } else if ("firmwareVersion".equals(fieldName)) { + deserializedVpnDeviceScriptParameters.firmwareVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnDeviceScriptParameters; + }); + } +} 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..a643d09d3ab2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateway.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this VpnGateway. + * + * @return the enableBgpRouteTranslationForNat value. + */ + Boolean enableBgpRouteTranslationForNat(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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.WithEnableBgpRouteTranslationForNat, + 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 enableBgpRouteTranslationForNat. + */ + interface WithEnableBgpRouteTranslationForNat { + /** + * Specifies the enableBgpRouteTranslationForNat property: Enable BGP routes translation for NAT on this + * VpnGateway.. + * + * @param enableBgpRouteTranslationForNat Enable BGP routes translation for NAT on this VpnGateway. + * @return the next definition stage. + */ + WithCreate withEnableBgpRouteTranslationForNat(Boolean enableBgpRouteTranslationForNat); + } + + /** + * 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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource. + */ + VpnGateway reset(String ipConfigurationId, Context context); + + /** + * 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. + * + * @throws com.azure.core.management.exception.ManagementException thrown 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..29a9eca4e8971 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayGeneration.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. + */ +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 a new instance of VpnGatewayGeneration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnGatewayGeneration() { + } + + /** + * Creates or finds a VpnGatewayGeneration from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnGatewayGeneration. + */ + public static VpnGatewayGeneration fromString(String name) { + return fromString(name, VpnGatewayGeneration.class); + } + + /** + * Gets known VpnGatewayGeneration values. + * + * @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..5d6dec3151e98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayIpConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IP Configuration of a VPN Gateway Resource. + */ +@Fluent +public final class VpnGatewayIpConfiguration implements JsonSerializable { + /* + * The identifier of the IP configuration for a VPN Gateway. + */ + private String id; + + /* + * The public IP address of this IP configuration. + */ + private String publicIpAddress; + + /* + * The private IP address of this IP configuration. + */ + private String privateIpAddress; + + /** + * Creates an instance of VpnGatewayIpConfiguration class. + */ + public VpnGatewayIpConfiguration() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("publicIpAddress", this.publicIpAddress); + jsonWriter.writeStringField("privateIpAddress", this.privateIpAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnGatewayIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnGatewayIpConfiguration if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnGatewayIpConfiguration. + */ + public static VpnGatewayIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnGatewayIpConfiguration deserializedVpnGatewayIpConfiguration = new VpnGatewayIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVpnGatewayIpConfiguration.id = reader.getString(); + } else if ("publicIpAddress".equals(fieldName)) { + deserializedVpnGatewayIpConfiguration.publicIpAddress = reader.getString(); + } else if ("privateIpAddress".equals(fieldName)) { + deserializedVpnGatewayIpConfiguration.privateIpAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnGatewayIpConfiguration; + }); + } +} 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..26c0b09bedb85 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayNatRule.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..1ceac7af092d3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStartParameters.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Start packet capture parameters. + */ +@Fluent +public final class VpnGatewayPacketCaptureStartParameters + implements JsonSerializable { + /* + * Start Packet capture parameters on vpn gateway. + */ + private String filterData; + + /** + * Creates an instance of VpnGatewayPacketCaptureStartParameters class. + */ + public VpnGatewayPacketCaptureStartParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterData", this.filterData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnGatewayPacketCaptureStartParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnGatewayPacketCaptureStartParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnGatewayPacketCaptureStartParameters. + */ + public static VpnGatewayPacketCaptureStartParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnGatewayPacketCaptureStartParameters deserializedVpnGatewayPacketCaptureStartParameters + = new VpnGatewayPacketCaptureStartParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterData".equals(fieldName)) { + deserializedVpnGatewayPacketCaptureStartParameters.filterData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnGatewayPacketCaptureStartParameters; + }); + } +} 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..9ef5cf3343abd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayPacketCaptureStopParameters.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Stop packet capture parameters. + */ +@Fluent +public final class VpnGatewayPacketCaptureStopParameters + implements JsonSerializable { + /* + * SAS url for packet capture on vpn gateway. + */ + private String sasUrl; + + /** + * Creates an instance of VpnGatewayPacketCaptureStopParameters class. + */ + public VpnGatewayPacketCaptureStopParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sasUrl", this.sasUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnGatewayPacketCaptureStopParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnGatewayPacketCaptureStopParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnGatewayPacketCaptureStopParameters. + */ + public static VpnGatewayPacketCaptureStopParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnGatewayPacketCaptureStopParameters deserializedVpnGatewayPacketCaptureStopParameters + = new VpnGatewayPacketCaptureStopParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasUrl".equals(fieldName)) { + deserializedVpnGatewayPacketCaptureStopParameters.sasUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnGatewayPacketCaptureStopParameters; + }); + } +} 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..dc4fea17158ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGatewayTunnelingProtocol.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * VPN protocol enabled for the VpnServerConfiguration. + */ +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 a new instance of VpnGatewayTunnelingProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnGatewayTunnelingProtocol() { + } + + /** + * Creates or finds a VpnGatewayTunnelingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnGatewayTunnelingProtocol. + */ + public static VpnGatewayTunnelingProtocol fromString(String name) { + return fromString(name, VpnGatewayTunnelingProtocol.class); + } + + /** + * Gets known VpnGatewayTunnelingProtocol values. + * + * @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..156e47dac9d91 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnGateways.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String gatewayName, 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 com.azure.core.management.exception.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); + + /** + * 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 ipConfigurationId VpnGateway ipConfigurationId to specify the gateway 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 vpnGateway Resource. + */ + VpnGateway reset(String resourceGroupName, String gatewayName, String ipConfigurationId, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..43ebf1d6f6488 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkBgpSettings.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * BGP settings details for a link. + */ +@Fluent +public final class VpnLinkBgpSettings implements JsonSerializable { + /* + * The BGP speaker's ASN. + */ + private Long asn; + + /* + * The BGP peering address and BGP identifier of this BGP speaker. + */ + private String bgpPeeringAddress; + + /** + * Creates an instance of VpnLinkBgpSettings class. + */ + public VpnLinkBgpSettings() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("asn", this.asn); + jsonWriter.writeStringField("bgpPeeringAddress", this.bgpPeeringAddress); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnLinkBgpSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnLinkBgpSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnLinkBgpSettings. + */ + public static VpnLinkBgpSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnLinkBgpSettings deserializedVpnLinkBgpSettings = new VpnLinkBgpSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("asn".equals(fieldName)) { + deserializedVpnLinkBgpSettings.asn = reader.getNullable(JsonReader::getLong); + } else if ("bgpPeeringAddress".equals(fieldName)) { + deserializedVpnLinkBgpSettings.bgpPeeringAddress = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnLinkBgpSettings; + }); + } +} 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..b7092a6d3623f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnectionMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Vpn link connection mode. + */ +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 a new instance of VpnLinkConnectionMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnLinkConnectionMode() { + } + + /** + * Creates or finds a VpnLinkConnectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnLinkConnectionMode. + */ + public static VpnLinkConnectionMode fromString(String name) { + return fromString(name, VpnLinkConnectionMode.class); + } + + /** + * Gets known VpnLinkConnectionMode values. + * + * @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..9f3de836abbb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkConnections.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.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.ConnectionSharedKeyResultInner; + +/** + * 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 all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedIterable}. + */ + PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName); + + /** + * Lists all shared keys of 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 list of shared keys for the vpn link connection as paginated response with {@link PagedIterable}. + */ + PagedIterable getAllSharedKeys(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context); + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified along with {@link Response}. + */ + Response getDefaultSharedKeyWithResponse(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context); + + /** + * Gets the shared key of 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 shared key of VpnLink connection specified. + */ + ConnectionSharedKeyResult getDefaultSharedKey(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName); + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource. + */ + ConnectionSharedKeyResult setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters); + + /** + * Sets or auto generates the shared key based on the user input. If users give a shared key value, it does the set + * operation. If key length is given, the operation creates a random key of the pre-defined length. + * + * @param resourceGroupName The resource group name of the VpnGateway. + * @param gatewayName The name of the gateway. + * @param connectionName The name of the connection. + * @param linkConnectionName The name of the vpn link connection. + * @param connectionSharedKeyParameters Parameters supplied to set or auto generate the shared key for 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 sharedKey Resource. + */ + ConnectionSharedKeyResult setOrInitDefaultSharedKey(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, ConnectionSharedKeyResultInner connectionSharedKeyParameters, + Context context); + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified along with {@link Response}. + */ + Response listDefaultSharedKeyWithResponse(String resourceGroupName, String gatewayName, + String connectionName, String linkConnectionName, Context context); + + /** + * Gets the value of the shared key of 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 value of the shared key of VpnLink connection specified. + */ + ConnectionSharedKeyResult listDefaultSharedKey(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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..3523c2c3556af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnLinkProviderProperties.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * List of properties of a link provider. + */ +@Fluent +public final class VpnLinkProviderProperties implements JsonSerializable { + /* + * Name of the link provider. + */ + private String linkProviderName; + + /* + * Link speed. + */ + private Integer linkSpeedInMbps; + + /** + * Creates an instance of VpnLinkProviderProperties class. + */ + public VpnLinkProviderProperties() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("linkProviderName", this.linkProviderName); + jsonWriter.writeNumberField("linkSpeedInMbps", this.linkSpeedInMbps); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnLinkProviderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnLinkProviderProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnLinkProviderProperties. + */ + public static VpnLinkProviderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnLinkProviderProperties deserializedVpnLinkProviderProperties = new VpnLinkProviderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("linkProviderName".equals(fieldName)) { + deserializedVpnLinkProviderProperties.linkProviderName = reader.getString(); + } else if ("linkSpeedInMbps".equals(fieldName)) { + deserializedVpnLinkProviderProperties.linkSpeedInMbps = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnLinkProviderProperties; + }); + } +} 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..b1751899d4df9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMapping.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Vpn NatRule mapping. + */ +@Fluent +public final class VpnNatRuleMapping implements JsonSerializable { + /* + * Address space for Vpn NatRule mapping. + */ + private String addressSpace; + + /* + * Port range for Vpn NatRule mapping. + */ + private String portRange; + + /** + * Creates an instance of VpnNatRuleMapping class. + */ + public VpnNatRuleMapping() { + } + + /** + * 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; + } + + /** + * Get the portRange property: Port range for Vpn NatRule mapping. + * + * @return the portRange value. + */ + public String portRange() { + return this.portRange; + } + + /** + * Set the portRange property: Port range for Vpn NatRule mapping. + * + * @param portRange the portRange value to set. + * @return the VpnNatRuleMapping object itself. + */ + public VpnNatRuleMapping withPortRange(String portRange) { + this.portRange = portRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("addressSpace", this.addressSpace); + jsonWriter.writeStringField("portRange", this.portRange); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnNatRuleMapping from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnNatRuleMapping if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnNatRuleMapping. + */ + public static VpnNatRuleMapping fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnNatRuleMapping deserializedVpnNatRuleMapping = new VpnNatRuleMapping(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addressSpace".equals(fieldName)) { + deserializedVpnNatRuleMapping.addressSpace = reader.getString(); + } else if ("portRange".equals(fieldName)) { + deserializedVpnNatRuleMapping.portRange = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnNatRuleMapping; + }); + } +} 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..1d57d2ab5d5e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Source NAT direction of a VPN NAT. + */ +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 a new instance of VpnNatRuleMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnNatRuleMode() { + } + + /** + * Creates or finds a VpnNatRuleMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnNatRuleMode. + */ + public static VpnNatRuleMode fromString(String name) { + return fromString(name, VpnNatRuleMode.class); + } + + /** + * Gets known VpnNatRuleMode values. + * + * @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..5250879e5cd1e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnNatRuleType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of NAT rule for VPN NAT. + */ +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 a new instance of VpnNatRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnNatRuleType() { + } + + /** + * Creates or finds a VpnNatRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnNatRuleType. + */ + public static VpnNatRuleType fromString(String name) { + return fromString(name, VpnNatRuleType.class); + } + + /** + * Gets known VpnNatRuleType values. + * + * @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..0471a2b9fb284 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStartParameters.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.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Start packet capture parameters on virtual network gateway. + */ +@Fluent +public final class VpnPacketCaptureStartParameters implements JsonSerializable { + /* + * Start Packet capture parameters. + */ + private String filterData; + + /** + * Creates an instance of VpnPacketCaptureStartParameters class. + */ + public VpnPacketCaptureStartParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filterData", this.filterData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnPacketCaptureStartParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnPacketCaptureStartParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnPacketCaptureStartParameters. + */ + public static VpnPacketCaptureStartParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnPacketCaptureStartParameters deserializedVpnPacketCaptureStartParameters + = new VpnPacketCaptureStartParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filterData".equals(fieldName)) { + deserializedVpnPacketCaptureStartParameters.filterData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnPacketCaptureStartParameters; + }); + } +} 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..0bacb7b4963e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPacketCaptureStopParameters.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.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Stop packet capture parameters. + */ +@Fluent +public final class VpnPacketCaptureStopParameters implements JsonSerializable { + /* + * SAS url for packet capture on virtual network gateway. + */ + private String sasUrl; + + /** + * Creates an instance of VpnPacketCaptureStopParameters class. + */ + public VpnPacketCaptureStopParameters() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sasUrl", this.sasUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnPacketCaptureStopParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnPacketCaptureStopParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnPacketCaptureStopParameters. + */ + public static VpnPacketCaptureStopParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnPacketCaptureStopParameters deserializedVpnPacketCaptureStopParameters + = new VpnPacketCaptureStopParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasUrl".equals(fieldName)) { + deserializedVpnPacketCaptureStopParameters.sasUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnPacketCaptureStopParameters; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPolicyMemberAttributeType.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPolicyMemberAttributeType.java new file mode 100644 index 0000000000000..1314d07b0d404 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnPolicyMemberAttributeType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Vpn Policy member attribute type. + */ +public final class VpnPolicyMemberAttributeType extends ExpandableStringEnum { + /** + * Static value CertificateGroupId for VpnPolicyMemberAttributeType. + */ + public static final VpnPolicyMemberAttributeType CERTIFICATE_GROUP_ID = fromString("CertificateGroupId"); + + /** + * Static value AADGroupId for VpnPolicyMemberAttributeType. + */ + public static final VpnPolicyMemberAttributeType AADGROUP_ID = fromString("AADGroupId"); + + /** + * Static value RadiusAzureGroupId for VpnPolicyMemberAttributeType. + */ + public static final VpnPolicyMemberAttributeType RADIUS_AZURE_GROUP_ID = fromString("RadiusAzureGroupId"); + + /** + * Creates a new instance of VpnPolicyMemberAttributeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnPolicyMemberAttributeType() { + } + + /** + * Creates or finds a VpnPolicyMemberAttributeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnPolicyMemberAttributeType. + */ + public static VpnPolicyMemberAttributeType fromString(String name) { + return fromString(name, VpnPolicyMemberAttributeType.class); + } + + /** + * Gets known VpnPolicyMemberAttributeType values. + * + * @return known VpnPolicyMemberAttributeType values. + */ + public static Collection values() { + return values(VpnPolicyMemberAttributeType.class); + } +} 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..c69c527e962d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnProfileResponse.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.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..1c939be0469b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusClientRootCertificate.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the Radius client root certificate of VpnServerConfiguration. + */ +@Fluent +public final class VpnServerConfigRadiusClientRootCertificate + implements JsonSerializable { + /* + * The certificate name. + */ + private String name; + + /* + * The Radius client root certificate thumbprint. + */ + private String thumbprint; + + /** + * Creates an instance of VpnServerConfigRadiusClientRootCertificate class. + */ + public VpnServerConfigRadiusClientRootCertificate() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("thumbprint", this.thumbprint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigRadiusClientRootCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigRadiusClientRootCertificate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigRadiusClientRootCertificate. + */ + public static VpnServerConfigRadiusClientRootCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigRadiusClientRootCertificate deserializedVpnServerConfigRadiusClientRootCertificate + = new VpnServerConfigRadiusClientRootCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnServerConfigRadiusClientRootCertificate.name = reader.getString(); + } else if ("thumbprint".equals(fieldName)) { + deserializedVpnServerConfigRadiusClientRootCertificate.thumbprint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigRadiusClientRootCertificate; + }); + } +} 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..82ff20c06ecaa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigRadiusServerRootCertificate.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of Radius Server root certificate of VpnServerConfiguration. + */ +@Fluent +public final class VpnServerConfigRadiusServerRootCertificate + implements JsonSerializable { + /* + * The certificate name. + */ + private String name; + + /* + * The certificate public data. + */ + private String publicCertData; + + /** + * Creates an instance of VpnServerConfigRadiusServerRootCertificate class. + */ + public VpnServerConfigRadiusServerRootCertificate() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("publicCertData", this.publicCertData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigRadiusServerRootCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigRadiusServerRootCertificate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigRadiusServerRootCertificate. + */ + public static VpnServerConfigRadiusServerRootCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigRadiusServerRootCertificate deserializedVpnServerConfigRadiusServerRootCertificate + = new VpnServerConfigRadiusServerRootCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnServerConfigRadiusServerRootCertificate.name = reader.getString(); + } else if ("publicCertData".equals(fieldName)) { + deserializedVpnServerConfigRadiusServerRootCertificate.publicCertData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigRadiusServerRootCertificate; + }); + } +} 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..f64412471325f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRevokedCertificate.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the revoked VPN client certificate of VpnServerConfiguration. + */ +@Fluent +public final class VpnServerConfigVpnClientRevokedCertificate + implements JsonSerializable { + /* + * The certificate name. + */ + private String name; + + /* + * The revoked VPN client certificate thumbprint. + */ + private String thumbprint; + + /** + * Creates an instance of VpnServerConfigVpnClientRevokedCertificate class. + */ + public VpnServerConfigVpnClientRevokedCertificate() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("thumbprint", this.thumbprint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigVpnClientRevokedCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigVpnClientRevokedCertificate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigVpnClientRevokedCertificate. + */ + public static VpnServerConfigVpnClientRevokedCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigVpnClientRevokedCertificate deserializedVpnServerConfigVpnClientRevokedCertificate + = new VpnServerConfigVpnClientRevokedCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnServerConfigVpnClientRevokedCertificate.name = reader.getString(); + } else if ("thumbprint".equals(fieldName)) { + deserializedVpnServerConfigVpnClientRevokedCertificate.thumbprint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigVpnClientRevokedCertificate; + }); + } +} 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..26754aa267681 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigVpnClientRootCertificate.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of VPN client root certificate of VpnServerConfiguration. + */ +@Fluent +public final class VpnServerConfigVpnClientRootCertificate + implements JsonSerializable { + /* + * The certificate name. + */ + private String name; + + /* + * The certificate public data. + */ + private String publicCertData; + + /** + * Creates an instance of VpnServerConfigVpnClientRootCertificate class. + */ + public VpnServerConfigVpnClientRootCertificate() { + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("publicCertData", this.publicCertData); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigVpnClientRootCertificate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigVpnClientRootCertificate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigVpnClientRootCertificate. + */ + public static VpnServerConfigVpnClientRootCertificate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigVpnClientRootCertificate deserializedVpnServerConfigVpnClientRootCertificate + = new VpnServerConfigVpnClientRootCertificate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnServerConfigVpnClientRootCertificate.name = reader.getString(); + } else if ("publicCertData".equals(fieldName)) { + deserializedVpnServerConfigVpnClientRootCertificate.publicCertData = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigVpnClientRootCertificate; + }); + } +} 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..87b5b97ec2a93 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfiguration.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.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 configurationPolicyGroups property: List of all VpnServerConfigurationPolicyGroups. + * + * @return the configurationPolicyGroups value. + */ + List configurationPolicyGroups(); + + /** + * Gets the etagPropertiesEtag property: A unique read-only string that changes whenever the resource is updated. + * + * @return the etagPropertiesEtag value. + */ + String etagPropertiesEtag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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, DefinitionStages.WithConfigurationPolicyGroups { + /** + * 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); + } + + /** + * The stage of the VpnServerConfiguration definition allowing to specify configurationPolicyGroups. + */ + interface WithConfigurationPolicyGroups { + /** + * Specifies the configurationPolicyGroups property: List of all VpnServerConfigurationPolicyGroups.. + * + * @param configurationPolicyGroups List of all VpnServerConfigurationPolicyGroups. + * @return the next definition stage. + */ + WithCreate + withConfigurationPolicyGroups(List configurationPolicyGroups); + } + } + + /** + * 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/VpnServerConfigurationPolicyGroup.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroup.java new file mode 100644 index 0000000000000..3da7e861a6ca6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroup.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.models; + +import com.azure.core.management.SubResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +import java.util.List; + +/** + * An immutable client-side representation of VpnServerConfigurationPolicyGroup. + */ +public interface VpnServerConfigurationPolicyGroup { + /** + * 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 isDefault property: Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + * + * @return the isDefault value. + */ + Boolean isDefault(); + + /** + * Gets the priority property: Priority for VpnServerConfigurationPolicyGroup. + * + * @return the priority value. + */ + Integer priority(); + + /** + * Gets the policyMembers property: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + * + * @return the policyMembers value. + */ + List policyMembers(); + + /** + * Gets the p2SConnectionConfigurations property: List of references to P2SConnectionConfigurations. + * + * @return the p2SConnectionConfigurations value. + */ + List p2SConnectionConfigurations(); + + /** + * Gets the provisioningState property: The provisioning state of the VpnServerConfigurationPolicyGroup resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner + * object. + * + * @return the inner object. + */ + VpnServerConfigurationPolicyGroupInner innerModel(); + + /** + * The entirety of the VpnServerConfigurationPolicyGroup definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The VpnServerConfigurationPolicyGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the VpnServerConfigurationPolicyGroup definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the VpnServerConfigurationPolicyGroup definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vpnServerConfigurationName. + * + * @param resourceGroupName The resource group name of the ConfigurationPolicyGroup. + * @param vpnServerConfigurationName The name of the VpnServerConfiguration. + * @return the next definition stage. + */ + WithCreate withExistingVpnServerConfiguration(String resourceGroupName, String vpnServerConfigurationName); + } + + /** + * The stage of the VpnServerConfigurationPolicyGroup 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.WithIsDefault, + DefinitionStages.WithPriority, DefinitionStages.WithPolicyMembers { + /** + * Executes the create request. + * + * @return the created resource. + */ + VpnServerConfigurationPolicyGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VpnServerConfigurationPolicyGroup create(Context context); + } + + /** + * The stage of the VpnServerConfigurationPolicyGroup 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 VpnServerConfigurationPolicyGroup definition allowing to specify isDefault. + */ + interface WithIsDefault { + /** + * Specifies the isDefault property: Shows if this is a Default VpnServerConfigurationPolicyGroup or not.. + * + * @param isDefault Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + * @return the next definition stage. + */ + WithCreate withIsDefault(Boolean isDefault); + } + + /** + * The stage of the VpnServerConfigurationPolicyGroup definition allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: Priority for VpnServerConfigurationPolicyGroup.. + * + * @param priority Priority for VpnServerConfigurationPolicyGroup. + * @return the next definition stage. + */ + WithCreate withPriority(Integer priority); + } + + /** + * The stage of the VpnServerConfigurationPolicyGroup definition allowing to specify policyMembers. + */ + interface WithPolicyMembers { + /** + * Specifies the policyMembers property: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup.. + * + * @param policyMembers Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + * @return the next definition stage. + */ + WithCreate withPolicyMembers(List policyMembers); + } + } + + /** + * Begins update for the VpnServerConfigurationPolicyGroup resource. + * + * @return the stage of resource update. + */ + VpnServerConfigurationPolicyGroup.Update update(); + + /** + * The template for VpnServerConfigurationPolicyGroup update. + */ + interface Update extends UpdateStages.WithName, UpdateStages.WithIsDefault, UpdateStages.WithPriority, + UpdateStages.WithPolicyMembers { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VpnServerConfigurationPolicyGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VpnServerConfigurationPolicyGroup apply(Context context); + } + + /** + * The VpnServerConfigurationPolicyGroup update stages. + */ + interface UpdateStages { + /** + * The stage of the VpnServerConfigurationPolicyGroup 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 VpnServerConfigurationPolicyGroup update allowing to specify isDefault. + */ + interface WithIsDefault { + /** + * Specifies the isDefault property: Shows if this is a Default VpnServerConfigurationPolicyGroup or not.. + * + * @param isDefault Shows if this is a Default VpnServerConfigurationPolicyGroup or not. + * @return the next definition stage. + */ + Update withIsDefault(Boolean isDefault); + } + + /** + * The stage of the VpnServerConfigurationPolicyGroup update allowing to specify priority. + */ + interface WithPriority { + /** + * Specifies the priority property: Priority for VpnServerConfigurationPolicyGroup.. + * + * @param priority Priority for VpnServerConfigurationPolicyGroup. + * @return the next definition stage. + */ + Update withPriority(Integer priority); + } + + /** + * The stage of the VpnServerConfigurationPolicyGroup update allowing to specify policyMembers. + */ + interface WithPolicyMembers { + /** + * Specifies the policyMembers property: Multiple PolicyMembers for VpnServerConfigurationPolicyGroup.. + * + * @param policyMembers Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. + * @return the next definition stage. + */ + Update withPolicyMembers(List policyMembers); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VpnServerConfigurationPolicyGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VpnServerConfigurationPolicyGroup refresh(Context context); +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroupMember.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroupMember.java new file mode 100644 index 0000000000000..8abb80684cab2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationPolicyGroupMember.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * VpnServerConfiguration PolicyGroup member. + */ +@Fluent +public final class VpnServerConfigurationPolicyGroupMember + implements JsonSerializable { + /* + * Name of the VpnServerConfigurationPolicyGroupMember. + */ + private String name; + + /* + * The Vpn Policy member attribute type. + */ + private VpnPolicyMemberAttributeType attributeType; + + /* + * The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. + */ + private String attributeValue; + + /** + * Creates an instance of VpnServerConfigurationPolicyGroupMember class. + */ + public VpnServerConfigurationPolicyGroupMember() { + } + + /** + * Get the name property: Name of the VpnServerConfigurationPolicyGroupMember. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the VpnServerConfigurationPolicyGroupMember. + * + * @param name the name value to set. + * @return the VpnServerConfigurationPolicyGroupMember object itself. + */ + public VpnServerConfigurationPolicyGroupMember withName(String name) { + this.name = name; + return this; + } + + /** + * Get the attributeType property: The Vpn Policy member attribute type. + * + * @return the attributeType value. + */ + public VpnPolicyMemberAttributeType attributeType() { + return this.attributeType; + } + + /** + * Set the attributeType property: The Vpn Policy member attribute type. + * + * @param attributeType the attributeType value to set. + * @return the VpnServerConfigurationPolicyGroupMember object itself. + */ + public VpnServerConfigurationPolicyGroupMember withAttributeType(VpnPolicyMemberAttributeType attributeType) { + this.attributeType = attributeType; + return this; + } + + /** + * Get the attributeValue property: The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. + * + * @return the attributeValue value. + */ + public String attributeValue() { + return this.attributeValue; + } + + /** + * Set the attributeValue property: The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. + * + * @param attributeValue the attributeValue value to set. + * @return the VpnServerConfigurationPolicyGroupMember object itself. + */ + public VpnServerConfigurationPolicyGroupMember withAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("attributeType", this.attributeType == null ? null : this.attributeType.toString()); + jsonWriter.writeStringField("attributeValue", this.attributeValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VpnServerConfigurationPolicyGroupMember from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VpnServerConfigurationPolicyGroupMember if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VpnServerConfigurationPolicyGroupMember. + */ + public static VpnServerConfigurationPolicyGroupMember fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VpnServerConfigurationPolicyGroupMember deserializedVpnServerConfigurationPolicyGroupMember + = new VpnServerConfigurationPolicyGroupMember(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupMember.name = reader.getString(); + } else if ("attributeType".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupMember.attributeType + = VpnPolicyMemberAttributeType.fromString(reader.getString()); + } else if ("attributeValue".equals(fieldName)) { + deserializedVpnServerConfigurationPolicyGroupMember.attributeValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVpnServerConfigurationPolicyGroupMember; + }); + } +} 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..1bab1970fe164 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurations.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String vpnServerConfigurationName, 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..125f3b8ee293d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsAssociatedWithVirtualWans.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.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..1f287a4a2df46 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnServerConfigurationsResponse.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights 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..e4b8c3313a038 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSite.java @@ -0,0 +1,424 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..2dc0994e9ddd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLink.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.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..cfdcb6a2ae654 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnection.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.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 vpnGatewayCustomBgpAddresses property: vpnGatewayCustomBgpAddresses used by this connection. + * + * @return the vpnGatewayCustomBgpAddresses value. + */ + List vpnGatewayCustomBgpAddresses(); + + /** + * 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 dpdTimeoutSeconds property: Dead Peer Detection timeout in seconds for VpnLink connection. + * + * @return the dpdTimeoutSeconds value. + */ + Integer dpdTimeoutSeconds(); + + /** + * 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..e9463215aaaa5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinkConnections.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String gatewayName, String connectionName, + String linkConnectionName, 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 com.azure.core.management.exception.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); +} 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..5ce17b2a33854 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSiteLinks.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 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vpnSiteName, String vpnSiteLinkName, + 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..f4487ff3347c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSites.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.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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String vpnSiteName, 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 com.azure.core.management.exception.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); + + /** + * 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..5716cdea5b1d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnSitesConfigurations.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.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..4546a8b46fe3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/VpnType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of this virtual network gateway. + */ +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 a new instance of VpnType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VpnType() { + } + + /** + * Creates or finds a VpnType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VpnType. + */ + public static VpnType fromString(String name) { + return fromString(name, VpnType.class); + } + + /** + * Gets known VpnType values. + * + * @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..b071becef32a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallAction.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 java.util.Collection; + +/** + * Type of Actions. + */ +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"); + + /** + * Static value JSChallenge for WebApplicationFirewallAction. + */ + public static final WebApplicationFirewallAction JSCHALLENGE = fromString("JSChallenge"); + + /** + * Creates a new instance of WebApplicationFirewallAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallAction() { + } + + /** + * Creates or finds a WebApplicationFirewallAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallAction. + */ + public static WebApplicationFirewallAction fromString(String name) { + return fromString(name, WebApplicationFirewallAction.class); + } + + /** + * Gets known WebApplicationFirewallAction values. + * + * @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..069e548fce2b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallCustomRule.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Defines contents of a web application rule. + */ +@Fluent +public final class WebApplicationFirewallCustomRule implements JsonSerializable { + /* + * The name of the resource that is unique within a policy. This name can be used to access the resource. + */ + private String name; + + /* + * A unique read-only string that changes whenever the resource is updated. + */ + private String etag; + + /* + * Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. + */ + private int priority; + + /* + * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. + */ + private WebApplicationFirewallState state; + + /* + * Duration over which Rate Limit policy will be applied. Applies only when ruleType is RateLimitRule. + */ + private ApplicationGatewayFirewallRateLimitDuration rateLimitDuration; + + /* + * Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be greater than or equal to 1 + */ + private Integer rateLimitThreshold; + + /* + * The rule type. + */ + private WebApplicationFirewallRuleType ruleType; + + /* + * List of match conditions. + */ + private List matchConditions; + + /* + * List of user session identifier group by clauses. + */ + private List groupByUserSession; + + /* + * Type of Actions. + */ + private WebApplicationFirewallAction action; + + /** + * Creates an instance of WebApplicationFirewallCustomRule class. + */ + public WebApplicationFirewallCustomRule() { + } + + /** + * 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 state property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not + * specified. + * + * @return the state value. + */ + public WebApplicationFirewallState state() { + return this.state; + } + + /** + * Set the state property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not + * specified. + * + * @param state the state value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withState(WebApplicationFirewallState state) { + this.state = state; + return this; + } + + /** + * Get the rateLimitDuration property: Duration over which Rate Limit policy will be applied. Applies only when + * ruleType is RateLimitRule. + * + * @return the rateLimitDuration value. + */ + public ApplicationGatewayFirewallRateLimitDuration rateLimitDuration() { + return this.rateLimitDuration; + } + + /** + * Set the rateLimitDuration property: Duration over which Rate Limit policy will be applied. Applies only when + * ruleType is RateLimitRule. + * + * @param rateLimitDuration the rateLimitDuration value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule + withRateLimitDuration(ApplicationGatewayFirewallRateLimitDuration rateLimitDuration) { + this.rateLimitDuration = rateLimitDuration; + return this; + } + + /** + * Get the rateLimitThreshold property: Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be + * greater than or equal to 1. + * + * @return the rateLimitThreshold value. + */ + public Integer rateLimitThreshold() { + return this.rateLimitThreshold; + } + + /** + * Set the rateLimitThreshold property: Rate Limit threshold to apply in case ruleType is RateLimitRule. Must be + * greater than or equal to 1. + * + * @param rateLimitThreshold the rateLimitThreshold value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withRateLimitThreshold(Integer rateLimitThreshold) { + this.rateLimitThreshold = rateLimitThreshold; + 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 groupByUserSession property: List of user session identifier group by clauses. + * + * @return the groupByUserSession value. + */ + public List groupByUserSession() { + return this.groupByUserSession; + } + + /** + * Set the groupByUserSession property: List of user session identifier group by clauses. + * + * @param groupByUserSession the groupByUserSession value to set. + * @return the WebApplicationFirewallCustomRule object itself. + */ + public WebApplicationFirewallCustomRule withGroupByUserSession(List groupByUserSession) { + this.groupByUserSession = groupByUserSession; + 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.atError() + .log(new IllegalArgumentException( + "Missing required property ruleType in model WebApplicationFirewallCustomRule")); + } + if (matchConditions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property matchConditions in model WebApplicationFirewallCustomRule")); + } else { + matchConditions().forEach(e -> e.validate()); + } + if (groupByUserSession() != null) { + groupByUserSession().forEach(e -> e.validate()); + } + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property action in model WebApplicationFirewallCustomRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebApplicationFirewallCustomRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("priority", this.priority); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeArrayField("matchConditions", this.matchConditions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("rateLimitDuration", + this.rateLimitDuration == null ? null : this.rateLimitDuration.toString()); + jsonWriter.writeNumberField("rateLimitThreshold", this.rateLimitThreshold); + jsonWriter.writeArrayField("groupByUserSession", this.groupByUserSession, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallCustomRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallCustomRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WebApplicationFirewallCustomRule. + */ + public static WebApplicationFirewallCustomRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallCustomRule deserializedWebApplicationFirewallCustomRule + = new WebApplicationFirewallCustomRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("priority".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.priority = reader.getInt(); + } else if ("ruleType".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.ruleType + = WebApplicationFirewallRuleType.fromString(reader.getString()); + } else if ("matchConditions".equals(fieldName)) { + List matchConditions + = reader.readArray(reader1 -> MatchCondition.fromJson(reader1)); + deserializedWebApplicationFirewallCustomRule.matchConditions = matchConditions; + } else if ("action".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.action + = WebApplicationFirewallAction.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.name = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.etag = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.state + = WebApplicationFirewallState.fromString(reader.getString()); + } else if ("rateLimitDuration".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.rateLimitDuration + = ApplicationGatewayFirewallRateLimitDuration.fromString(reader.getString()); + } else if ("rateLimitThreshold".equals(fieldName)) { + deserializedWebApplicationFirewallCustomRule.rateLimitThreshold + = reader.getNullable(JsonReader::getInt); + } else if ("groupByUserSession".equals(fieldName)) { + List groupByUserSession + = reader.readArray(reader1 -> GroupByUserSession.fromJson(reader1)); + deserializedWebApplicationFirewallCustomRule.groupByUserSession = groupByUserSession; + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallCustomRule; + }); + } +} 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..fa44a526e8a05 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallEnabledState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of the policy. + */ +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 a new instance of WebApplicationFirewallEnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallEnabledState() { + } + + /** + * Creates or finds a WebApplicationFirewallEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallEnabledState. + */ + public static WebApplicationFirewallEnabledState fromString(String name) { + return fromString(name, WebApplicationFirewallEnabledState.class); + } + + /** + * Gets known WebApplicationFirewallEnabledState values. + * + * @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..2e3490df5fc02 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMatchVariable.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Match Variable. + */ +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 a new instance of WebApplicationFirewallMatchVariable value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallMatchVariable() { + } + + /** + * Creates or finds a WebApplicationFirewallMatchVariable from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallMatchVariable. + */ + public static WebApplicationFirewallMatchVariable fromString(String name) { + return fromString(name, WebApplicationFirewallMatchVariable.class); + } + + /** + * Gets known WebApplicationFirewallMatchVariable values. + * + * @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..38dee030350ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallMode.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The mode of the policy. + */ +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 a new instance of WebApplicationFirewallMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallMode() { + } + + /** + * Creates or finds a WebApplicationFirewallMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallMode. + */ + public static WebApplicationFirewallMode fromString(String name) { + return fromString(name, WebApplicationFirewallMode.class); + } + + /** + * Gets known WebApplicationFirewallMode values. + * + * @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..a102d3debbba8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallOperator.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The operator to be matched. + */ +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"); + + /** + * Static value Any for WebApplicationFirewallOperator. + */ + public static final WebApplicationFirewallOperator ANY = fromString("Any"); + + /** + * Creates a new instance of WebApplicationFirewallOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallOperator() { + } + + /** + * Creates or finds a WebApplicationFirewallOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallOperator. + */ + public static WebApplicationFirewallOperator fromString(String name) { + return fromString(name, WebApplicationFirewallOperator.class); + } + + /** + * Gets known WebApplicationFirewallOperator values. + * + * @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..da8e08b759e71 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicies.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.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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with + * {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String policyName, + 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); + + /** + * 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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..b61ecf8f2cb95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicy.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.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 id property: Resource ID. + * + * @return the id value. + */ + String id(); + + /** + * 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 applicationGatewayForContainers property: A collection of references to application gateway for + * containers. + * + * @return the applicationGatewayForContainers value. + */ + List applicationGatewayForContainers(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.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..c0b0862a6e21f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyListResult.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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.network.generated.fluent.models.WebApplicationFirewallPolicyInner; +import java.io.IOException; +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 + implements JsonSerializable { + /* + * List of WebApplicationFirewallPolicies within a resource group. + */ + private List value; + + /* + * URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + */ + private String nextLink; + + /** + * Creates an instance of WebApplicationFirewallPolicyListResult class. + */ + public WebApplicationFirewallPolicyListResult() { + } + + /** + * 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallPolicyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallPolicyListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the WebApplicationFirewallPolicyListResult. + */ + public static WebApplicationFirewallPolicyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallPolicyListResult deserializedWebApplicationFirewallPolicyListResult + = new WebApplicationFirewallPolicyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> WebApplicationFirewallPolicyInner.fromJson(reader1)); + deserializedWebApplicationFirewallPolicyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedWebApplicationFirewallPolicyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallPolicyListResult; + }); + } +} 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..2dc0362c89f68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallPolicyResourceState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Resource status of the policy. + */ +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 a new instance of WebApplicationFirewallPolicyResourceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallPolicyResourceState() { + } + + /** + * Creates or finds a WebApplicationFirewallPolicyResourceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallPolicyResourceState. + */ + public static WebApplicationFirewallPolicyResourceState fromString(String name) { + return fromString(name, WebApplicationFirewallPolicyResourceState.class); + } + + /** + * Gets known WebApplicationFirewallPolicyResourceState values. + * + * @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..6fcf9968979bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallRuleType.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The rule type. + */ +public final class WebApplicationFirewallRuleType extends ExpandableStringEnum { + /** + * Static value MatchRule for WebApplicationFirewallRuleType. + */ + public static final WebApplicationFirewallRuleType MATCH_RULE = fromString("MatchRule"); + + /** + * Static value RateLimitRule for WebApplicationFirewallRuleType. + */ + public static final WebApplicationFirewallRuleType RATE_LIMIT_RULE = fromString("RateLimitRule"); + + /** + * Static value Invalid for WebApplicationFirewallRuleType. + */ + public static final WebApplicationFirewallRuleType INVALID = fromString("Invalid"); + + /** + * Creates a new instance of WebApplicationFirewallRuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallRuleType() { + } + + /** + * Creates or finds a WebApplicationFirewallRuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallRuleType. + */ + public static WebApplicationFirewallRuleType fromString(String name) { + return fromString(name, WebApplicationFirewallRuleType.class); + } + + /** + * Gets known WebApplicationFirewallRuleType values. + * + * @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/WebApplicationFirewallScrubbingRules.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallScrubbingRules.java new file mode 100644 index 0000000000000..aeb4399f81a6d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallScrubbingRules.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Allow certain variables to be scrubbed on WAF logs. + */ +@Fluent +public final class WebApplicationFirewallScrubbingRules + implements JsonSerializable { + /* + * The variable to be scrubbed from the logs. + */ + private ScrubbingRuleEntryMatchVariable matchVariable; + + /* + * When matchVariable is a collection, operate on the selector to specify which elements in the collection this rule + * applies to. + */ + private ScrubbingRuleEntryMatchOperator selectorMatchOperator; + + /* + * When matchVariable is a collection, operator used to specify which elements in the collection this rule applies + * to. + */ + private String selector; + + /* + * Defines the state of log scrubbing rule. Default value is Enabled. + */ + private ScrubbingRuleEntryState state; + + /** + * Creates an instance of WebApplicationFirewallScrubbingRules class. + */ + public WebApplicationFirewallScrubbingRules() { + } + + /** + * Get the matchVariable property: The variable to be scrubbed from the logs. + * + * @return the matchVariable value. + */ + public ScrubbingRuleEntryMatchVariable matchVariable() { + return this.matchVariable; + } + + /** + * Set the matchVariable property: The variable to be scrubbed from the logs. + * + * @param matchVariable the matchVariable value to set. + * @return the WebApplicationFirewallScrubbingRules object itself. + */ + public WebApplicationFirewallScrubbingRules withMatchVariable(ScrubbingRuleEntryMatchVariable 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 rule applies to. + * + * @return the selectorMatchOperator value. + */ + public ScrubbingRuleEntryMatchOperator 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 rule applies to. + * + * @param selectorMatchOperator the selectorMatchOperator value to set. + * @return the WebApplicationFirewallScrubbingRules object itself. + */ + public WebApplicationFirewallScrubbingRules + withSelectorMatchOperator(ScrubbingRuleEntryMatchOperator 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 rule 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 rule applies to. + * + * @param selector the selector value to set. + * @return the WebApplicationFirewallScrubbingRules object itself. + */ + public WebApplicationFirewallScrubbingRules withSelector(String selector) { + this.selector = selector; + return this; + } + + /** + * Get the state property: Defines the state of log scrubbing rule. Default value is Enabled. + * + * @return the state value. + */ + public ScrubbingRuleEntryState state() { + return this.state; + } + + /** + * Set the state property: Defines the state of log scrubbing rule. Default value is Enabled. + * + * @param state the state value to set. + * @return the WebApplicationFirewallScrubbingRules object itself. + */ + public WebApplicationFirewallScrubbingRules withState(ScrubbingRuleEntryState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (matchVariable() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property matchVariable in model WebApplicationFirewallScrubbingRules")); + } + if (selectorMatchOperator() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property selectorMatchOperator in model WebApplicationFirewallScrubbingRules")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebApplicationFirewallScrubbingRules.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("matchVariable", this.matchVariable == null ? null : this.matchVariable.toString()); + jsonWriter.writeStringField("selectorMatchOperator", + this.selectorMatchOperator == null ? null : this.selectorMatchOperator.toString()); + jsonWriter.writeStringField("selector", this.selector); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallScrubbingRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallScrubbingRules if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the WebApplicationFirewallScrubbingRules. + */ + public static WebApplicationFirewallScrubbingRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallScrubbingRules deserializedWebApplicationFirewallScrubbingRules + = new WebApplicationFirewallScrubbingRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("matchVariable".equals(fieldName)) { + deserializedWebApplicationFirewallScrubbingRules.matchVariable + = ScrubbingRuleEntryMatchVariable.fromString(reader.getString()); + } else if ("selectorMatchOperator".equals(fieldName)) { + deserializedWebApplicationFirewallScrubbingRules.selectorMatchOperator + = ScrubbingRuleEntryMatchOperator.fromString(reader.getString()); + } else if ("selector".equals(fieldName)) { + deserializedWebApplicationFirewallScrubbingRules.selector = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedWebApplicationFirewallScrubbingRules.state + = ScrubbingRuleEntryState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallScrubbingRules; + }); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallScrubbingState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallScrubbingState.java new file mode 100644 index 0000000000000..7a32225ad1032 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallScrubbingState.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 java.util.Collection; + +/** + * State of the log scrubbing config. Default value is Enabled. + */ +public final class WebApplicationFirewallScrubbingState + extends ExpandableStringEnum { + /** + * Static value Disabled for WebApplicationFirewallScrubbingState. + */ + public static final WebApplicationFirewallScrubbingState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for WebApplicationFirewallScrubbingState. + */ + public static final WebApplicationFirewallScrubbingState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of WebApplicationFirewallScrubbingState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallScrubbingState() { + } + + /** + * Creates or finds a WebApplicationFirewallScrubbingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallScrubbingState. + */ + public static WebApplicationFirewallScrubbingState fromString(String name) { + return fromString(name, WebApplicationFirewallScrubbingState.class); + } + + /** + * Gets known WebApplicationFirewallScrubbingState values. + * + * @return known WebApplicationFirewallScrubbingState values. + */ + public static Collection values() { + return values(WebApplicationFirewallScrubbingState.class); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallState.java b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallState.java new file mode 100644 index 0000000000000..655d968665be9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallState.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. + */ +public final class WebApplicationFirewallState extends ExpandableStringEnum { + /** + * Static value Disabled for WebApplicationFirewallState. + */ + public static final WebApplicationFirewallState DISABLED = fromString("Disabled"); + + /** + * Static value Enabled for WebApplicationFirewallState. + */ + public static final WebApplicationFirewallState ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of WebApplicationFirewallState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallState() { + } + + /** + * Creates or finds a WebApplicationFirewallState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallState. + */ + public static WebApplicationFirewallState fromString(String name) { + return fromString(name, WebApplicationFirewallState.class); + } + + /** + * Gets known WebApplicationFirewallState values. + * + * @return known WebApplicationFirewallState values. + */ + public static Collection values() { + return values(WebApplicationFirewallState.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..177b00b8d90fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebApplicationFirewallTransform.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Transforms applied before matching. + */ +public final class WebApplicationFirewallTransform extends ExpandableStringEnum { + /** + * Static value Uppercase for WebApplicationFirewallTransform. + */ + public static final WebApplicationFirewallTransform UPPERCASE = fromString("Uppercase"); + + /** + * 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 a new instance of WebApplicationFirewallTransform value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WebApplicationFirewallTransform() { + } + + /** + * Creates or finds a WebApplicationFirewallTransform from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebApplicationFirewallTransform. + */ + public static WebApplicationFirewallTransform fromString(String name) { + return fromString(name, WebApplicationFirewallTransform.class); + } + + /** + * Gets known WebApplicationFirewallTransform values. + * + * @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..e0529c36b3b55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/WebCategories.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.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. + * @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 along with {@link Response}. + */ + Response getWithResponse(String name, String expand, Context context); + + /** + * 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 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..0a6f0e18547f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/models/package-info.java @@ -0,0 +1,9 @@ +// 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..fc981bb85ba5a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/com/azure/resourcemanager/network/generated/package-info.java @@ -0,0 +1,9 @@ +// 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..6840020733677 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// 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; + opens com.azure.resourcemanager.network.generated.models to com.azure.core; +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/proxy-config.json b/sdk/network/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/proxy-config.json new file mode 100644 index 0000000000000..e2eb5db9c5779 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.network.generated.implementation.AdminRuleCollectionsClientImpl$AdminRuleCollectionsService"],["com.azure.resourcemanager.network.generated.implementation.AdminRulesClientImpl$AdminRulesService"],["com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateEndpointConnectionsClientImpl$ApplicationGatewayPrivateEndpointConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayPrivateLinkResourcesClientImpl$ApplicationGatewayPrivateLinkResourcesService"],["com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayWafDynamicManifestsClientImpl$ApplicationGatewayWafDynamicManifestsService"],["com.azure.resourcemanager.network.generated.implementation.ApplicationGatewayWafDynamicManifestsDefaultsClientImpl$ApplicationGatewayWafDynamicManifestsDefaultsService"],["com.azure.resourcemanager.network.generated.implementation.ApplicationGatewaysClientImpl$ApplicationGatewaysService"],["com.azure.resourcemanager.network.generated.implementation.ApplicationSecurityGroupsClientImpl$ApplicationSecurityGroupsService"],["com.azure.resourcemanager.network.generated.implementation.AvailableDelegationsClientImpl$AvailableDelegationsService"],["com.azure.resourcemanager.network.generated.implementation.AvailableEndpointServicesClientImpl$AvailableEndpointServicesService"],["com.azure.resourcemanager.network.generated.implementation.AvailablePrivateEndpointTypesClientImpl$AvailablePrivateEndpointTypesService"],["com.azure.resourcemanager.network.generated.implementation.AvailableResourceGroupDelegationsClientImpl$AvailableResourceGroupDelegationsService"],["com.azure.resourcemanager.network.generated.implementation.AvailableServiceAliasesClientImpl$AvailableServiceAliasesService"],["com.azure.resourcemanager.network.generated.implementation.AzureFirewallFqdnTagsClientImpl$AzureFirewallFqdnTagsService"],["com.azure.resourcemanager.network.generated.implementation.AzureFirewallsClientImpl$AzureFirewallsService"],["com.azure.resourcemanager.network.generated.implementation.BastionHostsClientImpl$BastionHostsService"],["com.azure.resourcemanager.network.generated.implementation.BgpServiceCommunitiesClientImpl$BgpServiceCommunitiesService"],["com.azure.resourcemanager.network.generated.implementation.ConfigurationPolicyGroupsClientImpl$ConfigurationPolicyGroupsService"],["com.azure.resourcemanager.network.generated.implementation.ConnectionMonitorsClientImpl$ConnectionMonitorsService"],["com.azure.resourcemanager.network.generated.implementation.ConnectivityConfigurationsClientImpl$ConnectivityConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.CustomIpPrefixesClientImpl$CustomIpPrefixesService"],["com.azure.resourcemanager.network.generated.implementation.DdosCustomPoliciesClientImpl$DdosCustomPoliciesService"],["com.azure.resourcemanager.network.generated.implementation.DdosProtectionPlansClientImpl$DdosProtectionPlansService"],["com.azure.resourcemanager.network.generated.implementation.DefaultSecurityRulesClientImpl$DefaultSecurityRulesService"],["com.azure.resourcemanager.network.generated.implementation.DscpConfigurationsClientImpl$DscpConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitAuthorizationsClientImpl$ExpressRouteCircuitAuthorizationsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitConnectionsClientImpl$ExpressRouteCircuitConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitPeeringsClientImpl$ExpressRouteCircuitPeeringsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteCircuitsClientImpl$ExpressRouteCircuitsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteConnectionsClientImpl$ExpressRouteConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionPeeringsClientImpl$ExpressRouteCrossConnectionPeeringsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteCrossConnectionsClientImpl$ExpressRouteCrossConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteGatewaysClientImpl$ExpressRouteGatewaysService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteLinksClientImpl$ExpressRouteLinksService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortAuthorizationsClientImpl$ExpressRoutePortAuthorizationsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsClientImpl$ExpressRoutePortsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRoutePortsLocationsClientImpl$ExpressRoutePortsLocationsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteProviderPortsLocationsClientImpl$ExpressRouteProviderPortsLocationsService"],["com.azure.resourcemanager.network.generated.implementation.ExpressRouteServiceProvidersClientImpl$ExpressRouteServiceProvidersService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPoliciesClientImpl$FirewallPoliciesService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPolicyDeploymentsClientImpl$FirewallPolicyDeploymentsService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPolicyDraftsClientImpl$FirewallPolicyDraftsService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesClientImpl$FirewallPolicyIdpsSignaturesService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesFilterValuesClientImpl$FirewallPolicyIdpsSignaturesFilterValuesService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPolicyIdpsSignaturesOverridesClientImpl$FirewallPolicyIdpsSignaturesOverridesService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPolicyRuleCollectionGroupDraftsClientImpl$FirewallPolicyRuleCollectionGroupDraftsService"],["com.azure.resourcemanager.network.generated.implementation.FirewallPolicyRuleCollectionGroupsClientImpl$FirewallPolicyRuleCollectionGroupsService"],["com.azure.resourcemanager.network.generated.implementation.FlowLogsClientImpl$FlowLogsService"],["com.azure.resourcemanager.network.generated.implementation.HubRouteTablesClientImpl$HubRouteTablesService"],["com.azure.resourcemanager.network.generated.implementation.HubVirtualNetworkConnectionsClientImpl$HubVirtualNetworkConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.InboundNatRulesClientImpl$InboundNatRulesService"],["com.azure.resourcemanager.network.generated.implementation.InboundSecurityRuleOperationsClientImpl$InboundSecurityRuleOperationsService"],["com.azure.resourcemanager.network.generated.implementation.IpAllocationsClientImpl$IpAllocationsService"],["com.azure.resourcemanager.network.generated.implementation.IpGroupsClientImpl$IpGroupsService"],["com.azure.resourcemanager.network.generated.implementation.LoadBalancerBackendAddressPoolsClientImpl$LoadBalancerBackendAddressPoolsService"],["com.azure.resourcemanager.network.generated.implementation.LoadBalancerFrontendIpConfigurationsClientImpl$LoadBalancerFrontendIpConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.LoadBalancerLoadBalancingRulesClientImpl$LoadBalancerLoadBalancingRulesService"],["com.azure.resourcemanager.network.generated.implementation.LoadBalancerNetworkInterfacesClientImpl$LoadBalancerNetworkInterfacesService"],["com.azure.resourcemanager.network.generated.implementation.LoadBalancerOutboundRulesClientImpl$LoadBalancerOutboundRulesService"],["com.azure.resourcemanager.network.generated.implementation.LoadBalancerProbesClientImpl$LoadBalancerProbesService"],["com.azure.resourcemanager.network.generated.implementation.LoadBalancersClientImpl$LoadBalancersService"],["com.azure.resourcemanager.network.generated.implementation.LocalNetworkGatewaysClientImpl$LocalNetworkGatewaysService"],["com.azure.resourcemanager.network.generated.implementation.ManagementGroupNetworkManagerConnectionsClientImpl$ManagementGroupNetworkManagerConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.NatGatewaysClientImpl$NatGatewaysService"],["com.azure.resourcemanager.network.generated.implementation.NatRulesClientImpl$NatRulesService"],["com.azure.resourcemanager.network.generated.implementation.NetworkGroupsClientImpl$NetworkGroupsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceIpConfigurationsClientImpl$NetworkInterfaceIpConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceLoadBalancersClientImpl$NetworkInterfaceLoadBalancersService"],["com.azure.resourcemanager.network.generated.implementation.NetworkInterfaceTapConfigurationsClientImpl$NetworkInterfaceTapConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkInterfacesClientImpl$NetworkInterfacesService"],["com.azure.resourcemanager.network.generated.implementation.NetworkManagerCommitsClientImpl$NetworkManagerCommitsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkManagerDeploymentStatusOperationsClientImpl$NetworkManagerDeploymentStatusOperationsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkManagerRoutingConfigurationsClientImpl$NetworkManagerRoutingConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkManagersClientImpl$NetworkManagersService"],["com.azure.resourcemanager.network.generated.implementation.NetworkProfilesClientImpl$NetworkProfilesService"],["com.azure.resourcemanager.network.generated.implementation.NetworkSecurityGroupsClientImpl$NetworkSecurityGroupsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkVirtualApplianceConnectionsClientImpl$NetworkVirtualApplianceConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.NetworkVirtualAppliancesClientImpl$NetworkVirtualAppliancesService"],["com.azure.resourcemanager.network.generated.implementation.NetworkWatchersClientImpl$NetworkWatchersService"],["com.azure.resourcemanager.network.generated.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.network.generated.implementation.P2SVpnGatewaysClientImpl$P2SVpnGatewaysService"],["com.azure.resourcemanager.network.generated.implementation.PacketCapturesClientImpl$PacketCapturesService"],["com.azure.resourcemanager.network.generated.implementation.PeerExpressRouteCircuitConnectionsClientImpl$PeerExpressRouteCircuitConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.PrivateDnsZoneGroupsClientImpl$PrivateDnsZoneGroupsService"],["com.azure.resourcemanager.network.generated.implementation.PrivateEndpointsClientImpl$PrivateEndpointsService"],["com.azure.resourcemanager.network.generated.implementation.PrivateLinkServicesClientImpl$PrivateLinkServicesService"],["com.azure.resourcemanager.network.generated.implementation.PublicIpAddressesClientImpl$PublicIpAddressesService"],["com.azure.resourcemanager.network.generated.implementation.PublicIpPrefixesClientImpl$PublicIpPrefixesService"],["com.azure.resourcemanager.network.generated.implementation.ResourceNavigationLinksClientImpl$ResourceNavigationLinksService"],["com.azure.resourcemanager.network.generated.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.network.generated.implementation.RouteFilterRulesClientImpl$RouteFilterRulesService"],["com.azure.resourcemanager.network.generated.implementation.RouteFiltersClientImpl$RouteFiltersService"],["com.azure.resourcemanager.network.generated.implementation.RouteMapsClientImpl$RouteMapsService"],["com.azure.resourcemanager.network.generated.implementation.RouteTablesClientImpl$RouteTablesService"],["com.azure.resourcemanager.network.generated.implementation.RoutesClientImpl$RoutesService"],["com.azure.resourcemanager.network.generated.implementation.RoutingIntentsClientImpl$RoutingIntentsService"],["com.azure.resourcemanager.network.generated.implementation.RoutingRuleCollectionsClientImpl$RoutingRuleCollectionsService"],["com.azure.resourcemanager.network.generated.implementation.RoutingRulesClientImpl$RoutingRulesService"],["com.azure.resourcemanager.network.generated.implementation.ScopeConnectionsClientImpl$ScopeConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.SecurityAdminConfigurationsClientImpl$SecurityAdminConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.SecurityPartnerProvidersClientImpl$SecurityPartnerProvidersService"],["com.azure.resourcemanager.network.generated.implementation.SecurityRulesClientImpl$SecurityRulesService"],["com.azure.resourcemanager.network.generated.implementation.SecurityUserConfigurationsClientImpl$SecurityUserConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.SecurityUserRuleCollectionsClientImpl$SecurityUserRuleCollectionsService"],["com.azure.resourcemanager.network.generated.implementation.SecurityUserRulesClientImpl$SecurityUserRulesService"],["com.azure.resourcemanager.network.generated.implementation.ServiceAssociationLinksClientImpl$ServiceAssociationLinksService"],["com.azure.resourcemanager.network.generated.implementation.ServiceEndpointPoliciesClientImpl$ServiceEndpointPoliciesService"],["com.azure.resourcemanager.network.generated.implementation.ServiceEndpointPolicyDefinitionsClientImpl$ServiceEndpointPolicyDefinitionsService"],["com.azure.resourcemanager.network.generated.implementation.ServiceTagInformationsClientImpl$ServiceTagInformationsService"],["com.azure.resourcemanager.network.generated.implementation.ServiceTagsClientImpl$ServiceTagsService"],["com.azure.resourcemanager.network.generated.implementation.StaticMembersClientImpl$StaticMembersService"],["com.azure.resourcemanager.network.generated.implementation.SubnetsClientImpl$SubnetsService"],["com.azure.resourcemanager.network.generated.implementation.SubscriptionNetworkManagerConnectionsClientImpl$SubscriptionNetworkManagerConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.network.generated.implementation.VipSwapsClientImpl$VipSwapsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSitesClientImpl$VirtualApplianceSitesService"],["com.azure.resourcemanager.network.generated.implementation.VirtualApplianceSkusClientImpl$VirtualApplianceSkusService"],["com.azure.resourcemanager.network.generated.implementation.VirtualHubBgpConnectionsClientImpl$VirtualHubBgpConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualHubIpConfigurationsClientImpl$VirtualHubIpConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualHubRouteTableV2SClientImpl$VirtualHubRouteTableV2SService"],["com.azure.resourcemanager.network.generated.implementation.VirtualHubsClientImpl$VirtualHubsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayConnectionsClientImpl$VirtualNetworkGatewayConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewayNatRulesClientImpl$VirtualNetworkGatewayNatRulesService"],["com.azure.resourcemanager.network.generated.implementation.VirtualNetworkGatewaysClientImpl$VirtualNetworkGatewaysService"],["com.azure.resourcemanager.network.generated.implementation.VirtualNetworkPeeringsClientImpl$VirtualNetworkPeeringsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualNetworkTapsClientImpl$VirtualNetworkTapsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualNetworksClientImpl$VirtualNetworksService"],["com.azure.resourcemanager.network.generated.implementation.VirtualRouterPeeringsClientImpl$VirtualRouterPeeringsService"],["com.azure.resourcemanager.network.generated.implementation.VirtualRoutersClientImpl$VirtualRoutersService"],["com.azure.resourcemanager.network.generated.implementation.VirtualWansClientImpl$VirtualWansService"],["com.azure.resourcemanager.network.generated.implementation.VpnConnectionsClientImpl$VpnConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.VpnGatewaysClientImpl$VpnGatewaysService"],["com.azure.resourcemanager.network.generated.implementation.VpnLinkConnectionsClientImpl$VpnLinkConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsAssociatedWithVirtualWansClientImpl$VpnServerConfigurationsAssociatedWithVirtualWansService"],["com.azure.resourcemanager.network.generated.implementation.VpnServerConfigurationsClientImpl$VpnServerConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.VpnSiteLinkConnectionsClientImpl$VpnSiteLinkConnectionsService"],["com.azure.resourcemanager.network.generated.implementation.VpnSiteLinksClientImpl$VpnSiteLinksService"],["com.azure.resourcemanager.network.generated.implementation.VpnSitesClientImpl$VpnSitesService"],["com.azure.resourcemanager.network.generated.implementation.VpnSitesConfigurationsClientImpl$VpnSitesConfigurationsService"],["com.azure.resourcemanager.network.generated.implementation.WebApplicationFirewallPoliciesClientImpl$WebApplicationFirewallPoliciesService"],["com.azure.resourcemanager.network.generated.implementation.WebCategoriesClientImpl$WebCategoriesService"]] \ No newline at end of file diff --git a/sdk/network/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/reflect-config.json b/sdk/network/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/reflect-config.json new file mode 100644 index 0000000000000..ff9211ba81bcd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-network-generated/reflect-config.json @@ -0,0 +1 @@ +[{"name":"com.azure.resourcemanager.network.generated.models.Error","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.network.generated.models.ErrorException","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..32b648b481ff0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkManagerSecurityGroupItem; +import java.util.Arrays; + +/** + * Samples for AdminRuleCollections CreateOrUpdate. + */ +public final class AdminRuleCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionPut.json + */ + /** + * Sample code: Create or Update an admin rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateAnAdminRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .define("testRuleCollection") + .withExistingSecurityAdminConfiguration("rg1", "testNetworkManager", "myTestSecurityConfig") + .withDescription("A sample policy") + .withAppliesToGroups(Arrays.asList(new NetworkManagerSecurityGroupItem().withNetworkGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsDeleteSamples.java new file mode 100644 index 0000000000000..823930f1e41a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsDeleteSamples.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.generated; + +/** + * Samples for AdminRuleCollections Delete. + */ +public final class AdminRuleCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionDelete.json + */ + /** + * Sample code: Deletes an admin rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesAnAdminRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", false, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsGetSamples.java new file mode 100644 index 0000000000000..0072cb41a2197 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsGetSamples.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.generated; + +/** + * Samples for AdminRuleCollections Get. + */ +public final class AdminRuleCollectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionGet.json + */ + /** + * Sample code: Gets security admin rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsSecurityAdminRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsListSamples.java new file mode 100644 index 0000000000000..7aea0bff04b7c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRuleCollectionsListSamples.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.generated; + +/** + * Samples for AdminRuleCollections List. + */ +public final class AdminRuleCollectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerAdminRuleCollectionList.json + */ + /** + * Sample code: List security admin rule collections. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listSecurityAdminRuleCollections(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRuleCollections() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..41c90b26a9c6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.AddressPrefixType; +import com.azure.resourcemanager.network.generated.models.AdminRule; +import com.azure.resourcemanager.network.generated.models.DefaultAdminRule; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.util.Arrays; + +/** + * Samples for AdminRules CreateOrUpdate. + */ +public final class AdminRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRulePut. + * json + */ + /** + * Sample code: Create an admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAnAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .createOrUpdateWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleAdminRule", + new AdminRule().withDescription("This is Sample Admin Rule") + .withProtocol(SecurityConfigurationRuleProtocol.TCP) + .withSources(Arrays.asList(new AddressPrefixItem().withAddressPrefix("Internet") + .withAddressPrefixType(AddressPrefixType.SERVICE_TAG))) + .withDestinations(Arrays.asList(new AddressPrefixItem().withAddressPrefix("*") + .withAddressPrefixType(AddressPrefixType.IPPREFIX))) + .withSourcePortRanges(Arrays.asList("0-65535")) + .withDestinationPortRanges(Arrays.asList("22")) + .withAccess(SecurityConfigurationRuleAccess.DENY) + .withPriority(1) + .withDirection(SecurityConfigurationRuleDirection.INBOUND), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerDefaultAdminRulePut.json + */ + /** + * Sample code: Create a default admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createADefaultAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .createOrUpdateWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleDefaultAdminRule", new DefaultAdminRule().withFlag("AllowVnetInbound"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesDeleteSamples.java new file mode 100644 index 0000000000000..432411ef56886 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesDeleteSamples.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.generated; + +/** + * Samples for AdminRules Delete. + */ +public final class AdminRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRuleDelete + * .json + */ + /** + * Sample code: Deletes an admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletesAnAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleAdminRule", false, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesGetSamples.java new file mode 100644 index 0000000000000..154f70bf22a49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesGetSamples.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.generated; + +/** + * Samples for AdminRules Get. + */ +public final class AdminRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerDefaultAdminRuleGet.json + */ + /** + * Sample code: Gets security default admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsSecurityDefaultAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleDefaultAdminRule", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRuleGet. + * json + */ + /** + * Sample code: Gets security admin rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsSecurityAdminRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleAdminRule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesListSamples.java new file mode 100644 index 0000000000000..9d74d6ae7f270 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AdminRulesListSamples.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.generated; + +/** + * Samples for AdminRules List. + */ +public final class AdminRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerAdminRuleList. + * json + */ + /** + * Sample code: List security admin rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityAdminRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.adminRules() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..b74f4ae6ece5f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsDeleteSamples.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.generated; + +/** + * Samples for ApplicationGatewayPrivateEndpointConnections Delete. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionDelete.json + */ + /** + * Sample code: Delete Application Gateway Private Endpoint Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteApplicationGatewayPrivateEndpointConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections() + .delete("rg1", "appgw", "connection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..b68c3edcd1c7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsGetSamples.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.generated; + +/** + * Samples for ApplicationGatewayPrivateEndpointConnections Get. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionGet.json + */ + /** + * Sample code: Get Application Gateway Private Endpoint Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void getApplicationGatewayPrivateEndpointConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections() + .getWithResponse("rg1", "appgw", "connection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..bfff729f68a59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsListSamples.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.generated; + +/** + * Samples for ApplicationGatewayPrivateEndpointConnections List. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionList.json + */ + /** + * Sample code: Lists all private endpoint connections on application gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void listsAllPrivateEndpointConnectionsOnApplicationGateway( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections().list("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.java new file mode 100644 index 0000000000000..2053a6b3994ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateEndpointConnectionsUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationGatewayPrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for ApplicationGatewayPrivateEndpointConnections Update. + */ +public final class ApplicationGatewayPrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateEndpointConnectionUpdate.json + */ + /** + * Sample code: Update Application Gateway Private Endpoint Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateApplicationGatewayPrivateEndpointConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateEndpointConnections() + .update("rg1", "appgw", "connection1", + new ApplicationGatewayPrivateEndpointConnectionInner().withName("connection1") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus("Approved") + .withDescription("approved it for some reason.")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateLinkResourcesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateLinkResourcesListSamples.java new file mode 100644 index 0000000000000..f06515e4759ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayPrivateLinkResourcesListSamples.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.generated; + +/** + * Samples for ApplicationGatewayPrivateLinkResources List. + */ +public final class ApplicationGatewayPrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayPrivateLinkResourceList.json + */ + /** + * Sample code: Lists all private link resources on application gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void listsAllPrivateLinkResourcesOnApplicationGateway( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayPrivateLinkResources().list("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsDefaultGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsDefaultGetSamples.java new file mode 100644 index 0000000000000..45f6a906a0998 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsDefaultGetSamples.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.generated; + +/** + * Samples for ApplicationGatewayWafDynamicManifestsDefault Get. + */ +public final class ApplicationGatewayWafDynamicManifestsDefaultGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GetApplicationGatewayWafDynamicManifestsDefault.json + */ + /** + * Sample code: Gets WAF default manifest. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsWAFDefaultManifest(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayWafDynamicManifestsDefaults() + .getWithResponse("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsGetSamples.java new file mode 100644 index 0000000000000..ece31c2d39fdf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewayWafDynamicManifestsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGatewayWafDynamicManifests Get. + */ +public final class ApplicationGatewayWafDynamicManifestsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GetApplicationGatewayWafDynamicManifests.json + */ + /** + * Sample code: Gets WAF manifests. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsWAFManifests(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGatewayWafDynamicManifests().get("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthOnDemandSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthOnDemandSamples.java new file mode 100644 index 0000000000000..4fb39a3511048 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthOnDemandSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayOnDemandProbe; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; + +/** + * Samples for ApplicationGateways BackendHealthOnDemand. + */ +public final class ApplicationGatewaysBackendHealthOnDemandSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayBackendHealthTest.json + */ + /** + * Sample code: Test Backend Health. + * + * @param manager Entry point to NetworkManager. + */ + public static void testBackendHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways() + .backendHealthOnDemand("rg1", "appgw", new ApplicationGatewayOnDemandProbe() + .withProtocol(ApplicationGatewayProtocol.HTTP) + .withPath("/") + .withTimeout(30) + .withPickHostnameFromBackendHttpSettings(true) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendaddressPools/MFAnalyticsPool")) + .withBackendHttpSettings(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/MFPoolSettings")), + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthSamples.java new file mode 100644 index 0000000000000..e170b595e2607 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysBackendHealthSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways BackendHealth. + */ +public final class ApplicationGatewaysBackendHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayBackendHealthGet.json + */ + /** + * Sample code: Get Backend Health. + * + * @param manager Entry point to NetworkManager. + */ + public static void getBackendHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().backendHealth("appgw", "appgw", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b20a7e575bfea --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddress; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendAddressPool; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayBackendHttpSettings; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayClientAuthConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayCookieBasedAffinity; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFrontendPort; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayGlobalConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHeaderConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayHttpListener; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayProtocol; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRule; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRequestRoutingRuleType; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRule; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleActionSet; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleCondition; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayRewriteRuleSet; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySku; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySkuName; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslCipherSuite; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicy; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslPolicyType; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProfile; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewaySslProtocol; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTier; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedClientCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayTrustedRootCertificate; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayUrlConfiguration; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApplicationGateways CreateOrUpdate. + */ +public final class ApplicationGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayCreate.json + */ + /** + * Sample code: Create Application Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void createApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways() + .define("appgw") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withSku(new ApplicationGatewaySku().withName(ApplicationGatewaySkuName.STANDARD_V2) + .withTier(ApplicationGatewayTier.STANDARD_V2) + .withCapacity(3)) + .withGatewayIpConfigurations(Arrays.asList(new ApplicationGatewayIpConfiguration().withName("appgwipc") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet/subnets/appgwsubnet")))) + .withTrustedRootCertificates( + Arrays.asList(new ApplicationGatewayTrustedRootCertificate().withName("rootcert").withData("****"), + new ApplicationGatewayTrustedRootCertificate().withName("rootcert1") + .withKeyVaultSecretId("fakeTokenPlaceholder"))) + .withTrustedClientCertificates( + Arrays.asList(new ApplicationGatewayTrustedClientCertificate().withName("clientcert").withData("****"))) + .withSslCertificates(Arrays.asList( + new ApplicationGatewaySslCertificate().withName("sslcert") + .withData("****") + .withPassword("fakeTokenPlaceholder"), + new ApplicationGatewaySslCertificate().withName("sslcert2") + .withKeyVaultSecretId("fakeTokenPlaceholder"))) + .withFrontendIpConfigurations(Arrays.asList(new ApplicationGatewayFrontendIpConfiguration() + .withName("appgwfip") + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/appgwpip")))) + .withFrontendPorts(Arrays.asList(new ApplicationGatewayFrontendPort().withName("appgwfp").withPort(443), + new ApplicationGatewayFrontendPort().withName("appgwfp80").withPort(80))) + .withBackendAddressPools(Arrays.asList(new ApplicationGatewayBackendAddressPool().withName("appgwpool") + .withBackendAddresses(Arrays.asList(new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.1"), + new ApplicationGatewayBackendAddress().withIpAddress("10.0.1.2"))), + new ApplicationGatewayBackendAddressPool().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool1") + .withName("appgwpool1") + .withBackendAddresses( + Arrays.asList(new ApplicationGatewayBackendAddress().withIpAddress("10.0.0.1"), + new ApplicationGatewayBackendAddress().withIpAddress("10.0.0.2"))))) + .withBackendHttpSettingsCollection( + Arrays.asList(new ApplicationGatewayBackendHttpSettings().withName("appgwbhs") + .withPort(80) + .withProtocol(ApplicationGatewayProtocol.HTTP) + .withCookieBasedAffinity(ApplicationGatewayCookieBasedAffinity.DISABLED) + .withRequestTimeout(30))) + .withHttpListeners(Arrays.asList(new ApplicationGatewayHttpListener().withName("appgwhl") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip")) + .withFrontendPort(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp")) + .withProtocol(ApplicationGatewayProtocol.HTTPS) + .withSslCertificate(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslCertificates/sslcert")) + .withSslProfile(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/sslProfiles/sslProfile1")) + .withRequireServerNameIndication(false), + new ApplicationGatewayHttpListener().withName("appgwhttplistener") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendIPConfigurations/appgwfip")) + .withFrontendPort(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/frontendPorts/appgwfp80")) + .withProtocol(ApplicationGatewayProtocol.HTTP))) + .withSslProfiles(Arrays.asList(new ApplicationGatewaySslProfile().withName("sslProfile1") + .withTrustedClientCertificates(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/trustedClientCertificates/clientcert"))) + .withSslPolicy(new ApplicationGatewaySslPolicy().withPolicyType(ApplicationGatewaySslPolicyType.CUSTOM) + .withCipherSuites( + Arrays.asList(ApplicationGatewaySslCipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256)) + .withMinProtocolVersion(ApplicationGatewaySslProtocol.TLSV1_1)) + .withClientAuthConfiguration( + new ApplicationGatewayClientAuthConfiguration().withVerifyClientCertIssuerDN(true)))) + .withRequestRoutingRules(Arrays.asList(new ApplicationGatewayRequestRoutingRule().withName("appgwrule") + .withRuleType(ApplicationGatewayRequestRoutingRuleType.BASIC) + .withPriority(10) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendAddressPools/appgwpool")) + .withBackendHttpSettings(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/backendHttpSettingsCollection/appgwbhs")) + .withHttpListener(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/httpListeners/appgwhl")) + .withRewriteRuleSet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/applicationGateways/appgw/rewriteRuleSets/rewriteRuleSet1")))) + .withRewriteRuleSets( + Arrays + .asList( + new ApplicationGatewayRewriteRuleSet().withName("rewriteRuleSet1") + .withRewriteRules(Arrays.asList(new ApplicationGatewayRewriteRule() + .withName("Set X-Forwarded-For") + .withRuleSequence(102) + .withConditions(Arrays.asList(new ApplicationGatewayRewriteRuleCondition() + .withVariable("http_req_Authorization") + .withPattern("^Bearer") + .withIgnoreCase(true) + .withNegate(false))) + .withActionSet(new ApplicationGatewayRewriteRuleActionSet() + .withRequestHeaderConfigurations(Arrays.asList( + new ApplicationGatewayHeaderConfiguration().withHeaderName("X-Forwarded-For") + .withHeaderValue("{var_add_x_forwarded_for_proxy}"))) + .withResponseHeaderConfigurations( + Arrays.asList(new ApplicationGatewayHeaderConfiguration() + .withHeaderName("Strict-Transport-Security") + .withHeaderValue("max-age=31536000"))) + .withUrlConfiguration( + new ApplicationGatewayUrlConfiguration().withModifiedPath("/abc"))))))) + .withGlobalConfiguration(new ApplicationGatewayGlobalConfiguration().withEnableRequestBuffering(true) + .withEnableResponseBuffering(true)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysDeleteSamples.java new file mode 100644 index 0000000000000..2533462a36cc5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways Delete. + */ +public final class ApplicationGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayDelete.json + */ + /** + * Sample code: Delete ApplicationGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().delete("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..969f4beeb276e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways GetByResourceGroup. + */ +public final class ApplicationGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayGet.json + */ + /** + * Sample code: Get ApplicationGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().getByResourceGroupWithResponse("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.java new file mode 100644 index 0000000000000..d86b03eb3c215 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysGetSslPredefinedPolicySamples.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.generated; + +/** + * Samples for ApplicationGateways GetSslPredefinedPolicy. + */ +public final class ApplicationGatewaysGetSslPredefinedPolicySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableSslOptionsPredefinedPolicyGet.json + */ + /** + * Sample code: Get Available Ssl Predefined Policy by name. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailableSslPredefinedPolicyByName(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways() + .getSslPredefinedPolicyWithResponse("AppGwSslPolicy20150501", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java new file mode 100644 index 0000000000000..313de878d3c8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableRequestHeadersSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways ListAvailableRequestHeaders. + */ +public final class ApplicationGatewaysListAvailableRequestHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableRequestHeadersGet.json + */ + /** + * Sample code: Get Available Request Headers. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableRequestHeaders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableRequestHeadersWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java new file mode 100644 index 0000000000000..c576fc7c86802 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableResponseHeadersSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways ListAvailableResponseHeaders. + */ +public final class ApplicationGatewaysListAvailableResponseHeadersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableResponseHeadersGet.json + */ + /** + * Sample code: Get Available Response Headers. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableResponseHeaders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableResponseHeadersWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java new file mode 100644 index 0000000000000..9eca8ebd82a4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableServerVariablesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways ListAvailableServerVariables. + */ +public final class ApplicationGatewaysListAvailableServerVariablesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableServerVariablesGet.json + */ + /** + * Sample code: Get Available Server Variables. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableServerVariables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableServerVariablesWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java new file mode 100644 index 0000000000000..f8bfd31b23d9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslOptionsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways ListAvailableSslOptions. + */ +public final class ApplicationGatewaysListAvailableSslOptionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableSslOptionsGet.json + */ + /** + * Sample code: Get Available Ssl Options. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableSslOptions(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableSslOptionsWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.java new file mode 100644 index 0000000000000..23eb13ee9b260 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples.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.generated; + +/** + * Samples for ApplicationGateways ListAvailableSslPredefinedPolicies. + */ +public final class ApplicationGatewaysListAvailableSslPredefinedPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableSslOptionsPredefinedPoliciesGet.json + */ + /** + * Sample code: Get Available Ssl Predefined Policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailableSslPredefinedPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableSslPredefinedPolicies(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java new file mode 100644 index 0000000000000..d071b793e7df9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListAvailableWafRuleSetsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways ListAvailableWafRuleSets. + */ +public final class ApplicationGatewaysListAvailableWafRuleSetsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationGatewayAvailableWafRuleSetsGet.json + */ + /** + * Sample code: Get Available Waf Rule Sets. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableWafRuleSets(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listAvailableWafRuleSetsWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..559dada509cd8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListByResourceGroupSamples.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.generated; + +/** + * Samples for ApplicationGateways ListByResourceGroup. + */ +public final class ApplicationGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayList.json + */ + /** + * Sample code: Lists all application gateways in a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listsAllApplicationGatewaysInAResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListSamples.java new file mode 100644 index 0000000000000..aa9ed387bb7fb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysListSamples.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.generated; + +/** + * Samples for ApplicationGateways List. + */ +public final class ApplicationGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayListAll. + * json + */ + /** + * Sample code: Lists all application gateways in a subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listsAllApplicationGatewaysInASubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStartSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStartSamples.java new file mode 100644 index 0000000000000..337c068d40118 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStartSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways Start. + */ +public final class ApplicationGatewaysStartSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayStart.json + */ + /** + * Sample code: Start Application Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void startApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().start("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStopSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStopSamples.java new file mode 100644 index 0000000000000..4e9bd8b11a254 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysStopSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationGateways Stop. + */ +public final class ApplicationGatewaysStopSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayStop.json + */ + /** + * Sample code: Stop Application Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopApplicationGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationGateways().stop("rg1", "appgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysUpdateTagsSamples.java new file mode 100644 index 0000000000000..04c3217f9e910 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationGatewaysUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ApplicationGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApplicationGateways UpdateTags. + */ +public final class ApplicationGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationGatewayUpdateTags. + * json + */ + /** + * Sample code: Update Application Gateway tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateApplicationGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ApplicationGateway resource = manager.applicationGateways() + .getByResourceGroupWithResponse("rg1", "AppGw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f652695111af7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ApplicationSecurityGroups CreateOrUpdate. + */ +public final class ApplicationSecurityGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupCreate.json + */ + /** + * Sample code: Create application security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createApplicationSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups() + .define("test-asg") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsDeleteSamples.java new file mode 100644 index 0000000000000..df428f93fa393 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsDeleteSamples.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.generated; + +/** + * Samples for ApplicationSecurityGroups Delete. + */ +public final class ApplicationSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupDelete.json + */ + /** + * Sample code: Delete application security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteApplicationSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups().delete("rg1", "test-asg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..ed80d3ce409bd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsGetByResourceGroupSamples.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.generated; + +/** + * Samples for ApplicationSecurityGroups GetByResourceGroup. + */ +public final class ApplicationSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationSecurityGroupGet. + * json + */ + /** + * Sample code: Get application security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getApplicationSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups() + .getByResourceGroupWithResponse("rg1", "test-asg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..af32bdfe3627d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListByResourceGroupSamples.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.generated; + +/** + * Samples for ApplicationSecurityGroups ListByResourceGroup. + */ +public final class ApplicationSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ApplicationSecurityGroupList. + * json + */ + /** + * Sample code: List load balancers in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listLoadBalancersInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListSamples.java new file mode 100644 index 0000000000000..672fe9257afb7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsListSamples.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.generated; + +/** + * Samples for ApplicationSecurityGroups List. + */ +public final class ApplicationSecurityGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupListAll.json + */ + /** + * Sample code: List all application security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllApplicationSecurityGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.applicationSecurityGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsUpdateTagsSamples.java new file mode 100644 index 0000000000000..8c1ba041eb515 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ApplicationSecurityGroupsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ApplicationSecurityGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ApplicationSecurityGroups UpdateTags. + */ +public final class ApplicationSecurityGroupsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ApplicationSecurityGroupUpdateTags.json + */ + /** + * Sample code: Update application security group tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateApplicationSecurityGroupTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ApplicationSecurityGroup resource = manager.applicationSecurityGroups() + .getByResourceGroupWithResponse("rg1", "test-asg", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableDelegationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableDelegationsListSamples.java new file mode 100644 index 0000000000000..21ade482f3ce7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableDelegationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for AvailableDelegations List. + */ +public final class AvailableDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailableDelegationsSubscriptionGet.json + */ + /** + * Sample code: Get available delegations. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableDelegations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableDelegations().list("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableEndpointServicesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableEndpointServicesListSamples.java new file mode 100644 index 0000000000000..04de1a6b0d2c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableEndpointServicesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for AvailableEndpointServices List. + */ +public final class AvailableEndpointServicesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/EndpointServicesList.json + */ + /** + * Sample code: EndpointServicesList. + * + * @param manager Entry point to NetworkManager. + */ + public static void endpointServicesList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableEndpointServices().list("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..faee128656181 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListByResourceGroupSamples.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.generated; + +/** + * Samples for AvailablePrivateEndpointTypes ListByResourceGroup. + */ +public final class AvailablePrivateEndpointTypesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailablePrivateEndpointTypesResourceGroupGet.json + */ + /** + * Sample code: Get available PrivateEndpoint types in the resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailablePrivateEndpointTypesInTheResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availablePrivateEndpointTypes() + .listByResourceGroup("regionName", "rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListSamples.java new file mode 100644 index 0000000000000..c094ec3a9075e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailablePrivateEndpointTypesListSamples.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.generated; + +/** + * Samples for AvailablePrivateEndpointTypes List. + */ +public final class AvailablePrivateEndpointTypesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailablePrivateEndpointTypesGet.json + */ + /** + * Sample code: Get available PrivateEndpoint types. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailablePrivateEndpointTypes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availablePrivateEndpointTypes().list("regionName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableResourceGroupDelegationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableResourceGroupDelegationsListSamples.java new file mode 100644 index 0000000000000..88033e2e4fdd3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableResourceGroupDelegationsListSamples.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.generated; + +/** + * Samples for AvailableResourceGroupDelegations List. + */ +public final class AvailableResourceGroupDelegationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailableDelegationsResourceGroupGet.json + */ + /** + * Sample code: Get available delegations in the resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAvailableDelegationsInTheResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableResourceGroupDelegations().list("westcentralus", "rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..25d01fc218c54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListByResourceGroupSamples.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.generated; + +/** + * Samples for AvailableServiceAliases ListByResourceGroup. + */ +public final class AvailableServiceAliasesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AvailableServiceAliasesListByResourceGroup.json + */ + /** + * Sample code: Get available service aliases in the resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableServiceAliasesInTheResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableServiceAliases().listByResourceGroup("rg1", "westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListSamples.java new file mode 100644 index 0000000000000..a9a8fadcc7176 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AvailableServiceAliasesListSamples.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.generated; + +/** + * Samples for AvailableServiceAliases List. + */ +public final class AvailableServiceAliasesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AvailableServiceAliasesList. + * json + */ + /** + * Sample code: Get available service aliases. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableServiceAliases(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.availableServiceAliases().list("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallFqdnTagsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallFqdnTagsListSamples.java new file mode 100644 index 0000000000000..4c66378c06824 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallFqdnTagsListSamples.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.generated; + +/** + * Samples for AzureFirewallFqdnTags List. + */ +public final class AzureFirewallFqdnTagsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallFqdnTagsListBySubscription.json + */ + /** + * Sample code: List all Azure Firewall FQDN Tags for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllAzureFirewallFQDNTagsForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewallFqdnTags().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..07e74ffbecb56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleProtocol; +import com.azure.resourcemanager.network.generated.models.AzureFirewallApplicationRuleProtocolType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallIpConfiguration; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRCAction; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRCActionType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRule; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleCollection; +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleProtocol; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCAction; +import com.azure.resourcemanager.network.generated.models.AzureFirewallRCActionType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSku; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSkuName; +import com.azure.resourcemanager.network.generated.models.AzureFirewallSkuTier; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.HubIpAddresses; +import com.azure.resourcemanager.network.generated.models.HubPublicIpAddresses; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AzureFirewalls CreateOrUpdate. + */ +public final class AzureFirewallsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPutWithIpGroups. + * json + */ + /** + * Sample code: Create Azure Firewall With IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallWithIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPutWithZones. + * json + */ + /** + * Sample code: Create Azure Firewall With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US 2") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList("1", "2", "3")) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPut.json + */ + /** + * Sample code: Create Azure Firewall. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallPutWithAdditionalProperties.json + */ + /** + * Sample code: Create Azure Firewall With Additional Properties. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAzureFirewallWithAdditionalProperties( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .withAdditionalProperties(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPutInHub.json + */ + /** + * Sample code: Create Azure Firewall in virtual Hub. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallInVirtualHub(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .withFirewallPolicy(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/policy1")) + .withHubIpAddresses(new HubIpAddresses() + .withPublicIPs(new HubPublicIpAddresses().withAddresses(Arrays.asList()).withCount(1))) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_HUB).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallPutWithMgmtSubnet.json + */ + /** + * Sample code: Create Azure Firewall With management subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createAzureFirewallWithManagementSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .define("azurefirewall") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withZones(Arrays.asList()) + .withApplicationRuleCollections(Arrays.asList(new AzureFirewallApplicationRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/applicationRuleCollections/apprulecoll") + .withName("apprulecoll") + .withPriority(110) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList(new AzureFirewallApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new AzureFirewallApplicationRuleProtocol() + .withProtocolType(AzureFirewallApplicationRuleProtocolType.HTTPS) + .withPort(443))) + .withTargetFqdns(Arrays.asList("www.test.com")))))) + .withNatRuleCollections(Arrays.asList(new AzureFirewallNatRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/natRuleCollections/natrulecoll") + .withName("natrulecoll") + .withPriority(112) + .withAction(new AzureFirewallNatRCAction().withType(AzureFirewallNatRCActionType.DNAT)) + .withRules(Arrays.asList( + new AzureFirewallNatRule().withName("DNAT-HTTPS-traffic") + .withDescription("D-NAT all outbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("443")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedAddress("1.2.3.5") + .withTranslatedPort("8443"), + new AzureFirewallNatRule().withName("DNAT-HTTP-traffic-With-FQDN") + .withDescription("D-NAT all inbound web traffic for inspection") + .withSourceAddresses(Arrays.asList("*")) + .withDestinationAddresses(Arrays.asList("1.2.3.4")) + .withDestinationPorts(Arrays.asList("80")) + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withTranslatedPort("880") + .withTranslatedFqdn("internalhttpserver"))))) + .withNetworkRuleCollections(Arrays.asList(new AzureFirewallNetworkRuleCollection().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azurefirewall/networkRuleCollections/netrulecoll") + .withName("netrulecoll") + .withPriority(112) + .withAction(new AzureFirewallRCAction().withType(AzureFirewallRCActionType.DENY)) + .withRules(Arrays.asList( + new AzureFirewallNetworkRule().withName("L4-traffic") + .withDescription("Block traffic based on source IPs and ports") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("192.168.1.1-192.168.1.12", "10.1.4.12-10.1.4.255")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("443-444", "8443")), + new AzureFirewallNetworkRule().withName("L4-traffic-with-FQDN") + .withDescription("Block traffic based on source IPs and ports to amazon") + .withProtocols(Arrays.asList(AzureFirewallNetworkRuleProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.2.4.12-10.2.4.255")) + .withDestinationPorts(Arrays.asList("443-444", "8443")) + .withDestinationFqdns(Arrays.asList("www.amazon.com")))))) + .withIpConfigurations(Arrays.asList(new AzureFirewallIpConfiguration() + .withName("azureFirewallIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .withManagementIpConfiguration(new AzureFirewallIpConfiguration() + .withName("azureFirewallMgmtIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/AzureFirewallManagementSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/managementPipName"))) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withSku( + new AzureFirewallSku().withName(AzureFirewallSkuName.AZFW_VNET).withTier(AzureFirewallSkuTier.STANDARD)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsDeleteSamples.java new file mode 100644 index 0000000000000..39a8c9f467f56 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for AzureFirewalls Delete. + */ +public final class AzureFirewallsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallDelete.json + */ + /** + * Sample code: Delete Azure Firewall. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().delete("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1d8e76a1eef1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsGetByResourceGroupSamples.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.generated; + +/** + * Samples for AzureFirewalls GetByResourceGroup. + */ +public final class AzureFirewallsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallGetWithAdditionalProperties.json + */ + /** + * Sample code: Get Azure Firewall With Additional Properties. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAzureFirewallWithAdditionalProperties(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallGetWithIpGroups. + * json + */ + /** + * Sample code: Get Azure Firewall With IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAzureFirewallWithIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallGetWithZones. + * json + */ + /** + * Sample code: Get Azure Firewall With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureFirewallWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallGetWithMgmtSubnet.json + */ + /** + * Sample code: Get Azure Firewall With management subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAzureFirewallWithManagementSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallGet.json + */ + /** + * Sample code: Get Azure Firewall. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureFirewall(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .getByResourceGroupWithResponse("rg1", "azurefirewall", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..18bebdba241a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListByResourceGroupSamples.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.generated; + +/** + * Samples for AzureFirewalls ListByResourceGroup. + */ +public final class AzureFirewallsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallListByResourceGroup.json + */ + /** + * Sample code: List all Azure Firewalls for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllAzureFirewallsForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListLearnedPrefixesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListLearnedPrefixesSamples.java new file mode 100644 index 0000000000000..d35dd79874a51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListLearnedPrefixesSamples.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.generated; + +/** + * Samples for AzureFirewalls ListLearnedPrefixes. + */ +public final class AzureFirewallsListLearnedPrefixesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallListLearnedIPPrefixes.json + */ + /** + * Sample code: AzureFirewallListLearnedPrefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + azureFirewallListLearnedPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().listLearnedPrefixes("rg1", "azureFirewall1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListSamples.java new file mode 100644 index 0000000000000..046b6b9f73d72 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsListSamples.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.generated; + +/** + * Samples for AzureFirewalls List. + */ +public final class AzureFirewallsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureFirewallListBySubscription.json + */ + /** + * Sample code: List all Azure Firewalls for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllAzureFirewallsForAGivenSubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsPacketCaptureSamples.java new file mode 100644 index 0000000000000..c76a53834a563 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsPacketCaptureSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AzureFirewallNetworkRuleProtocol; +import com.azure.resourcemanager.network.generated.models.AzureFirewallPacketCaptureFlags; +import com.azure.resourcemanager.network.generated.models.AzureFirewallPacketCaptureFlagsType; +import com.azure.resourcemanager.network.generated.models.AzureFirewallPacketCaptureRule; +import com.azure.resourcemanager.network.generated.models.FirewallPacketCaptureParameters; +import java.util.Arrays; + +/** + * Samples for AzureFirewalls PacketCapture. + */ +public final class AzureFirewallsPacketCaptureSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallPacketCapture. + * json + */ + /** + * Sample code: AzureFirewallPacketCapture. + * + * @param manager Entry point to NetworkManager. + */ + public static void azureFirewallPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.azureFirewalls() + .packetCapture("rg1", "azureFirewall1", + new FirewallPacketCaptureParameters().withDurationInSeconds(300) + .withNumberOfPacketsToCapture(5000) + .withSasUrl("someSASURL") + .withFileName("azureFirewallPacketCapture") + .withProtocol(AzureFirewallNetworkRuleProtocol.ANY) + .withFlags(Arrays.asList( + new AzureFirewallPacketCaptureFlags().withType(AzureFirewallPacketCaptureFlagsType.SYN), + new AzureFirewallPacketCaptureFlags().withType(AzureFirewallPacketCaptureFlagsType.FIN))) + .withFilters(Arrays.asList( + new AzureFirewallPacketCaptureRule().withSources(Arrays.asList("20.1.1.0")) + .withDestinations(Arrays.asList("20.1.2.0")) + .withDestinationPorts(Arrays.asList("4500")), + new AzureFirewallPacketCaptureRule().withSources(Arrays.asList("10.1.1.0", "10.1.1.1")) + .withDestinations(Arrays.asList("10.1.2.0")) + .withDestinationPorts(Arrays.asList("123", "80")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsUpdateTagsSamples.java new file mode 100644 index 0000000000000..6d408c722105c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/AzureFirewallsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AzureFirewall; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AzureFirewalls UpdateTags. + */ +public final class AzureFirewallsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureFirewallUpdateTags.json + */ + /** + * Sample code: Update Azure Firewall Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateAzureFirewallTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + AzureFirewall resource = manager.azureFirewalls() + .getByResourceGroupWithResponse("azfwtest", "fw1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3d9fbbd385495 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.BastionHostIpConfiguration; +import com.azure.resourcemanager.network.generated.models.BastionHostPropertiesFormatNetworkAcls; +import com.azure.resourcemanager.network.generated.models.IpRule; +import java.util.Arrays; + +/** + * Samples for BastionHosts CreateOrUpdate. + */ +public final class BastionHostsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDeveloperPut.json + */ + /** + * Sample code: Create Developer Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDeveloperBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .define("bastionhostdeveloper") + .withRegion((String) null) + .withExistingResourceGroup("rg2") + .withIpConfigurations(Arrays.asList()) + .withVirtualNetwork(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withNetworkAcls(new BastionHostPropertiesFormatNetworkAcls() + .withIpRules(Arrays.asList(new IpRule().withAddressPrefix("1.1.1.1/16")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostPut.json + */ + /** + * Sample code: Create Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void createBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .define("bastionhosttenant") + .withRegion((String) null) + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new BastionHostIpConfiguration().withName("bastionHostIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostPutWithZones.json + */ + /** + * Sample code: Create Bastion Host With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void createBastionHostWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .define("bastionhosttenant") + .withRegion((String) null) + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new BastionHostIpConfiguration().withName("bastionHostIpConfiguration") + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName")))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsDeleteSamples.java new file mode 100644 index 0000000000000..8e39b5d65b2e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsDeleteSamples.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.generated; + +/** + * Samples for BastionHosts Delete. + */ +public final class BastionHostsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDeveloperDelete. + * json + */ + /** + * Sample code: Delete Developer Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDeveloperBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().delete("rg2", "bastionhostdeveloper", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDelete.json + */ + /** + * Sample code: Delete Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().delete("rg1", "bastionhosttenant", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..dff0f3557873a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsGetByResourceGroupSamples.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.generated; + +/** + * Samples for BastionHosts GetByResourceGroup. + */ +public final class BastionHostsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostDeveloperGet.json + */ + /** + * Sample code: Get Developer Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDeveloperBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhostdeveloper'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostGetWithZones.json + */ + /** + * Sample code: Get Bastion Host With Zones. + * + * @param manager Entry point to NetworkManager. + */ + public static void getBastionHostWithZones(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhosttenant'", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostGet.json + */ + /** + * Sample code: Get Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void getBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhosttenant'", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..dac1154d8f938 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListByResourceGroupSamples.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.generated; + +/** + * Samples for BastionHosts ListByResourceGroup. + */ +public final class BastionHostsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * BastionHostListByResourceGroup.json + */ + /** + * Sample code: List all Bastion Hosts for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllBastionHostsForAGivenResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListSamples.java new file mode 100644 index 0000000000000..4089eadf06053 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsListSamples.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.generated; + +/** + * Samples for BastionHosts List. + */ +public final class BastionHostsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostListBySubscription + * .json + */ + /** + * Sample code: List all Bastion Hosts for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllBastionHostsForAGivenSubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bastionHosts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsUpdateTagsSamples.java new file mode 100644 index 0000000000000..f64105011d1db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BastionHostsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.BastionHost; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for BastionHosts UpdateTags. + */ +public final class BastionHostsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionHostPatch.json + */ + /** + * Sample code: Patch Bastion Host. + * + * @param manager Entry point to NetworkManager. + */ + public static void patchBastionHost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + BastionHost resource = manager.bastionHosts() + .getByResourceGroupWithResponse("rg1", "bastionhosttenant", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BgpServiceCommunitiesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BgpServiceCommunitiesListSamples.java new file mode 100644 index 0000000000000..55cf5d968939d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/BgpServiceCommunitiesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for BgpServiceCommunities List. + */ +public final class BgpServiceCommunitiesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceCommunityList.json + */ + /** + * Sample code: ServiceCommunityList. + * + * @param manager Entry point to NetworkManager. + */ + public static void serviceCommunityList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.bgpServiceCommunities().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..81e32673a0b15 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnPolicyMemberAttributeType; +import com.azure.resourcemanager.network.generated.models.VpnServerConfigurationPolicyGroupMember; +import java.util.Arrays; + +/** + * Samples for ConfigurationPolicyGroups CreateOrUpdate. + */ +public final class ConfigurationPolicyGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ConfigurationPolicyGroupPut. + * json + */ + /** + * Sample code: ConfigurationPolicyGroupPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void configurationPolicyGroupPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .define("policyGroup1") + .withExistingVpnServerConfiguration("rg1", "vpnServerConfiguration1") + .withIsDefault(true) + .withPriority(0) + .withPolicyMembers(Arrays.asList( + new VpnServerConfigurationPolicyGroupMember().withName("policy1") + .withAttributeType(VpnPolicyMemberAttributeType.RADIUS_AZURE_GROUP_ID) + .withAttributeValue("6ad1bd08"), + new VpnServerConfigurationPolicyGroupMember().withName("policy2") + .withAttributeType(VpnPolicyMemberAttributeType.CERTIFICATE_GROUP_ID) + .withAttributeValue("red.com"))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsDeleteSamples.java new file mode 100644 index 0000000000000..4cd26c9c52519 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsDeleteSamples.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.generated; + +/** + * Samples for ConfigurationPolicyGroups Delete. + */ +public final class ConfigurationPolicyGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ConfigurationPolicyGroupDelete.json + */ + /** + * Sample code: ConfigurationPolicyGroupDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + configurationPolicyGroupDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .delete("rg1", "vpnServerConfiguration1", "policyGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsGetSamples.java new file mode 100644 index 0000000000000..9b1e80c83cd2e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsGetSamples.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.generated; + +/** + * Samples for ConfigurationPolicyGroups Get. + */ +public final class ConfigurationPolicyGroupsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ConfigurationPolicyGroupGet. + * json + */ + /** + * Sample code: ConfigurationPolicyGroupGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void configurationPolicyGroupGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .getWithResponse("rg1", "vpnServerConfiguration1", "policyGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsListByVpnServerConfigurationSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsListByVpnServerConfigurationSamples.java new file mode 100644 index 0000000000000..d7c0ef5db4713 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConfigurationPolicyGroupsListByVpnServerConfigurationSamples.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.generated; + +/** + * Samples for ConfigurationPolicyGroups ListByVpnServerConfiguration. + */ +public final class ConfigurationPolicyGroupsListByVpnServerConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ConfigurationPolicyGroupListByVpnServerConfiguration.json + */ + /** + * Sample code: ConfigurationPolicyGroupListByVpnServerConfiguration. + * + * @param manager Entry point to NetworkManager. + */ + public static void configurationPolicyGroupListByVpnServerConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.configurationPolicyGroups() + .listByVpnServerConfiguration("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a222e4dd43f06 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpoint; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilter; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterItem; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterItemType; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointFilterType; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointLocationDetails; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointScope; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorEndpointScopeItem; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTcpConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfiguration; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestConfigurationProtocol; +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorTestGroup; +import com.azure.resourcemanager.network.generated.models.EndpointType; +import java.util.Arrays; + +/** + * Samples for ConnectionMonitors CreateOrUpdate. + */ +public final class ConnectionMonitorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorCreate.json + */ + /** + * Sample code: Create connection monitor V1. + * + * @param manager Entry point to NetworkManager. + */ + public static void createConnectionMonitorV1(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors() + .define("cm1") + .withExistingNetworkWatcher("rg1", "nw1") + .withRegion("eastus") + .withEndpoints(Arrays.asList( + new ConnectionMonitorEndpoint().withName("source") + .withResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/ct1"), + new ConnectionMonitorEndpoint().withName("destination").withAddress("bing.com"))) + .withTestConfigurations(Arrays.asList(new ConnectionMonitorTestConfiguration().withName("tcp") + .withTestFrequencySec(60) + .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP) + .withTcpConfiguration(new ConnectionMonitorTcpConfiguration().withPort(80)))) + .withTestGroups(Arrays.asList(new ConnectionMonitorTestGroup().withName("tg") + .withTestConfigurations(Arrays.asList("tcp")) + .withSources(Arrays.asList("source")) + .withDestinations(Arrays.asList("destination")))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorCreateWithArcNetwork.json + */ + /** + * Sample code: Create connection monitor with Arc Network. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createConnectionMonitorWithArcNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors() + .define("cm1") + .withExistingNetworkWatcher("rg1", "nw1") + .withEndpoints(Arrays.asList(new ConnectionMonitorEndpoint().withName("vm1") + .withType(EndpointType.AZURE_VM) + .withResourceId( + "/subscriptions/9cece3e3-0f7d-47ca-af0e-9772773f90b7/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/TESTVM"), + new ConnectionMonitorEndpoint().withName("bing") + .withType(EndpointType.EXTERNAL_ADDRESS) + .withAddress("bing.com"), + new ConnectionMonitorEndpoint().withName("google") + .withType(EndpointType.EXTERNAL_ADDRESS) + .withAddress("google.com"), + new ConnectionMonitorEndpoint().withName("ArcBasedNetwork") + .withType(EndpointType.AZURE_ARC_NETWORK) + .withScope(new ConnectionMonitorEndpointScope().withInclude( + Arrays.asList(new ConnectionMonitorEndpointScopeItem().withAddress("172.21.128.0/20")))) + .withLocationDetails(new ConnectionMonitorEndpointLocationDetails().withRegion("eastus")) + .withSubscriptionId("9cece3e3-0f7d-47ca-af0e-9772773f90b7"))) + .withTestConfigurations(Arrays.asList(new ConnectionMonitorTestConfiguration().withName("testConfig1") + .withTestFrequencySec(60) + .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP) + .withTcpConfiguration( + new ConnectionMonitorTcpConfiguration().withPort(80).withDisableTraceRoute(false)))) + .withTestGroups(Arrays.asList(new ConnectionMonitorTestGroup().withName("test1") + .withDisable(false) + .withTestConfigurations(Arrays.asList("testConfig1")) + .withSources(Arrays.asList("vm1", "ArcBasedNetwork")) + .withDestinations(Arrays.asList("bing", "google")))) + .withOutputs(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorV2Create.json + */ + /** + * Sample code: Create connection monitor V2. + * + * @param manager Entry point to NetworkManager. + */ + public static void createConnectionMonitorV2(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors() + .define("cm1") + .withExistingNetworkWatcher("rg1", "nw1") + .withEndpoints(Arrays.asList(new ConnectionMonitorEndpoint().withName("vm1") + .withResourceId( + "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/NwRgIrinaCentralUSEUAP/providers/Microsoft.Compute/virtualMachines/vm1"), + new ConnectionMonitorEndpoint().withName("CanaryWorkspaceVamshi") + .withResourceId( + "/subscriptions/96e68903-0a56-4819-9987-8d08ad6a1f99/resourceGroups/vasamudrRG/providers/Microsoft.OperationalInsights/workspaces/vasamudrWorkspace") + .withFilter( + new ConnectionMonitorEndpointFilter().withType(ConnectionMonitorEndpointFilterType.INCLUDE) + .withItems(Arrays.asList(new ConnectionMonitorEndpointFilterItem() + .withType(ConnectionMonitorEndpointFilterItemType.AGENT_ADDRESS) + .withAddress("npmuser")))), + new ConnectionMonitorEndpoint().withName("bing").withAddress("bing.com"), + new ConnectionMonitorEndpoint().withName("google").withAddress("google.com"))) + .withTestConfigurations(Arrays.asList(new ConnectionMonitorTestConfiguration().withName("testConfig1") + .withTestFrequencySec(60) + .withProtocol(ConnectionMonitorTestConfigurationProtocol.TCP) + .withTcpConfiguration( + new ConnectionMonitorTcpConfiguration().withPort(80).withDisableTraceRoute(false)))) + .withTestGroups(Arrays.asList(new ConnectionMonitorTestGroup().withName("test1") + .withDisable(false) + .withTestConfigurations(Arrays.asList("testConfig1")) + .withSources(Arrays.asList("vm1", "CanaryWorkspaceVamshi")) + .withDestinations(Arrays.asList("bing", "google")))) + .withOutputs(Arrays.asList()) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsDeleteSamples.java new file mode 100644 index 0000000000000..73fffe419a88e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ConnectionMonitors Delete. + */ +public final class ConnectionMonitorsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorDelete.json + */ + /** + * Sample code: Delete connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().delete("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsGetSamples.java new file mode 100644 index 0000000000000..8051475599e24 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ConnectionMonitors Get. + */ +public final class ConnectionMonitorsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorGet.json + */ + /** + * Sample code: Get connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void getConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().getWithResponse("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsListSamples.java new file mode 100644 index 0000000000000..ebb0058b6a63b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ConnectionMonitors List. + */ +public final class ConnectionMonitorsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorList.json + */ + /** + * Sample code: List connection monitors. + * + * @param manager Entry point to NetworkManager. + */ + public static void listConnectionMonitors(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().list("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsQuerySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsQuerySamples.java new file mode 100644 index 0000000000000..e48a546331c09 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsQuerySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ConnectionMonitors Query. + */ +public final class ConnectionMonitorsQuerySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorQuery.json + */ + /** + * Sample code: Query connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void queryConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().query("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStartSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStartSamples.java new file mode 100644 index 0000000000000..f7f7f55ccefcd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStartSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ConnectionMonitors Start. + */ +public final class ConnectionMonitorsStartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorStart.json + */ + /** + * Sample code: Start connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void startConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().start("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStopSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStopSamples.java new file mode 100644 index 0000000000000..c2d630309bd2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsStopSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ConnectionMonitors Stop. + */ +public final class ConnectionMonitorsStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorStop.json + */ + /** + * Sample code: Stop connection monitor. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopConnectionMonitor(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectionMonitors().stop("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsUpdateTagsSamples.java new file mode 100644 index 0000000000000..658ed502f64cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectionMonitorsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ConnectionMonitorResult; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ConnectionMonitors UpdateTags. + */ +public final class ConnectionMonitorsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectionMonitorUpdateTags.json + */ + /** + * Sample code: Update connection monitor tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateConnectionMonitorTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ConnectionMonitorResult resource = manager.connectionMonitors() + .getWithResponse("rg1", "nw1", "cm1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3e50a467edd28 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ConnectivityGroupItem; +import com.azure.resourcemanager.network.generated.models.ConnectivityTopology; +import com.azure.resourcemanager.network.generated.models.DeleteExistingPeering; +import com.azure.resourcemanager.network.generated.models.GroupConnectivity; +import com.azure.resourcemanager.network.generated.models.Hub; +import com.azure.resourcemanager.network.generated.models.IsGlobal; +import com.azure.resourcemanager.network.generated.models.UseHubGateway; +import java.util.Arrays; + +/** + * Samples for ConnectivityConfigurations CreateOrUpdate. + */ +public final class ConnectivityConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationPut.json + */ + /** + * Sample code: ConnectivityConfigurationsPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .define("myTestConnectivityConfig") + .withExistingNetworkManager("myResourceGroup", "testNetworkManager") + .withDescription("Sample Configuration") + .withConnectivityTopology(ConnectivityTopology.HUB_AND_SPOKE) + .withHubs(Arrays.asList(new Hub().withResourceId( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig") + .withResourceType("Microsoft.Network/virtualNetworks"))) + .withIsGlobal(IsGlobal.TRUE) + .withAppliesToGroups(Arrays.asList(new ConnectivityGroupItem().withNetworkGroupId( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1") + .withUseHubGateway(UseHubGateway.TRUE) + .withIsGlobal(IsGlobal.FALSE) + .withGroupConnectivity(GroupConnectivity.NONE))) + .withDeleteExistingPeering(DeleteExistingPeering.TRUE) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..fb543ee53dcd7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsDeleteSamples.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.generated; + +/** + * Samples for ConnectivityConfigurations Delete. + */ +public final class ConnectivityConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationDelete.json + */ + /** + * Sample code: ConnectivityConfigurationsDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .delete("myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", false, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsGetSamples.java new file mode 100644 index 0000000000000..20ef3f20f374b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsGetSamples.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.generated; + +/** + * Samples for ConnectivityConfigurations Get. + */ +public final class ConnectivityConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationGet.json + */ + /** + * Sample code: ConnectivityConfigurationsGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .getWithResponse("myResourceGroup", "testNetworkManager", "myTestConnectivityConfig", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsListSamples.java new file mode 100644 index 0000000000000..f8f9d3157780d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ConnectivityConfigurationsListSamples.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.generated; + +/** + * Samples for ConnectivityConfigurations List. + */ +public final class ConnectivityConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectivityConfigurationList.json + */ + /** + * Sample code: ConnectivityConfigurationsList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + connectivityConfigurationsList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.connectivityConfigurations() + .list("myResourceGroup", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..79ae240bb6cb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for CustomIpPrefixes CreateOrUpdate. + */ +public final class CustomIpPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CustomIpPrefixCreateCustomizedValues.json + */ + /** + * Sample code: Create custom IP prefix allocation method. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createCustomIPPrefixAllocationMethod(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes() + .define("test-customipprefix") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withCidr("0.0.0.0/24") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesDeleteSamples.java new file mode 100644 index 0000000000000..074779f048090 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for CustomIpPrefixes Delete. + */ +public final class CustomIpPrefixesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixDelete.json + */ + /** + * Sample code: Delete custom IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteCustomIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes().delete("rg1", "test-customipprefix", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..22ffd24ea5870 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesGetByResourceGroupSamples.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.generated; + +/** + * Samples for CustomIpPrefixes GetByResourceGroup. + */ +public final class CustomIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixGet.json + */ + /** + * Sample code: Get custom IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void getCustomIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-customipprefix", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..4fe32f7a3a59b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListByResourceGroupSamples.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.generated; + +/** + * Samples for CustomIpPrefixes ListByResourceGroup. + */ +public final class CustomIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixList.json + */ + /** + * Sample code: List resource group Custom IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupCustomIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListSamples.java new file mode 100644 index 0000000000000..1b76c8646a744 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for CustomIpPrefixes List. + */ +public final class CustomIpPrefixesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixListAll.json + */ + /** + * Sample code: List all custom IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllCustomIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.customIpPrefixes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesUpdateTagsSamples.java new file mode 100644 index 0000000000000..fb8720ab57580 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/CustomIpPrefixesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.CustomIpPrefix; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CustomIpPrefixes UpdateTags. + */ +public final class CustomIpPrefixesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CustomIpPrefixUpdateTags.json + */ + /** + * Sample code: Update public IP address tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updatePublicIPAddressTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + CustomIpPrefix resource = manager.customIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-customipprefix", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..bb9452e6c0f7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesCreateOrUpdateSamples.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.generated; + +/** + * Samples for DdosCustomPolicies CreateOrUpdate. + */ +public final class DdosCustomPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyCreate.json + */ + /** + * Sample code: Create DDoS custom policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosCustomPolicies() + .define("test-ddos-custom-policy") + .withRegion("centraluseuap") + .withExistingResourceGroup("rg1") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..6e09577792567 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for DdosCustomPolicies Delete. + */ +public final class DdosCustomPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyDelete.json + */ + /** + * Sample code: Delete DDoS custom policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosCustomPolicies().delete("rg1", "test-ddos-custom-policy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..fdbdea450d78a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesGetByResourceGroupSamples.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.generated; + +/** + * Samples for DdosCustomPolicies GetByResourceGroup. + */ +public final class DdosCustomPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyGet.json + */ + /** + * Sample code: Get DDoS custom policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDDoSCustomPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosCustomPolicies() + .getByResourceGroupWithResponse("rg1", "test-ddos-custom-policy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesUpdateTagsSamples.java new file mode 100644 index 0000000000000..ad83918dbc25c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosCustomPoliciesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.DdosCustomPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DdosCustomPolicies UpdateTags. + */ +public final class DdosCustomPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosCustomPolicyUpdateTags. + * json + */ + /** + * Sample code: DDoS Custom policy Update tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void dDoSCustomPolicyUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + DdosCustomPolicy resource = manager.ddosCustomPolicies() + .getByResourceGroupWithResponse("rg1", "test-ddos-custom-policy", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ab1cd6db0d59c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansCreateOrUpdateSamples.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.generated; + +/** + * Samples for DdosProtectionPlans CreateOrUpdate. + */ +public final class DdosProtectionPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanCreate.json + */ + /** + * Sample code: Create DDoS protection plan. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans() + .define("test-plan") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansDeleteSamples.java new file mode 100644 index 0000000000000..dde7f68fa224f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for DdosProtectionPlans Delete. + */ +public final class DdosProtectionPlansDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanDelete.json + */ + /** + * Sample code: Delete DDoS protection plan. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans().delete("rg1", "test-plan", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..a4df75ec31065 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansGetByResourceGroupSamples.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.generated; + +/** + * Samples for DdosProtectionPlans GetByResourceGroup. + */ +public final class DdosProtectionPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanGet.json + */ + /** + * Sample code: Get DDoS protection plan. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDDoSProtectionPlan(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans() + .getByResourceGroupWithResponse("rg1", "test-plan", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListByResourceGroupSamples.java new file mode 100644 index 0000000000000..71081caadc1e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListByResourceGroupSamples.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.generated; + +/** + * Samples for DdosProtectionPlans ListByResourceGroup. + */ +public final class DdosProtectionPlansListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanList.json + */ + /** + * Sample code: List DDoS protection plans in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listDDoSProtectionPlansInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListSamples.java new file mode 100644 index 0000000000000..12996c7595c62 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansListSamples.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.generated; + +/** + * Samples for DdosProtectionPlans List. + */ +public final class DdosProtectionPlansListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanListAll. + * json + */ + /** + * Sample code: List all DDoS protection plans. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllDDoSProtectionPlans(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ddosProtectionPlans().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansUpdateTagsSamples.java new file mode 100644 index 0000000000000..782f40d277956 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DdosProtectionPlansUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.DdosProtectionPlan; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for DdosProtectionPlans UpdateTags. + */ +public final class DdosProtectionPlansUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DdosProtectionPlanUpdateTags. + * json + */ + /** + * Sample code: DDoS protection plan Update tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + dDoSProtectionPlanUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + DdosProtectionPlan resource = manager.ddosProtectionPlans() + .getByResourceGroupWithResponse("rg1", "test-plan", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesGetSamples.java new file mode 100644 index 0000000000000..17fe3b845857f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesGetSamples.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.generated; + +/** + * Samples for DefaultSecurityRules Get. + */ +public final class DefaultSecurityRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DefaultSecurityRuleGet.json + */ + /** + * Sample code: DefaultSecurityRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void defaultSecurityRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.defaultSecurityRules() + .getWithResponse("testrg", "nsg1", "AllowVnetInBound", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesListSamples.java new file mode 100644 index 0000000000000..ad80f1f410890 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DefaultSecurityRulesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for DefaultSecurityRules List. + */ +public final class DefaultSecurityRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DefaultSecurityRuleList.json + */ + /** + * Sample code: DefaultSecurityRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void defaultSecurityRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.defaultSecurityRules().list("testrg", "nsg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7bd68ad5fc9a3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ProtocolType; +import com.azure.resourcemanager.network.generated.models.QosDefinition; +import com.azure.resourcemanager.network.generated.models.QosIpRange; +import com.azure.resourcemanager.network.generated.models.QosPortRange; +import java.util.Arrays; + +/** + * Samples for DscpConfiguration CreateOrUpdate. + */ +public final class DscpConfigurationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationCreate.json + */ + /** + * Sample code: Create DSCP Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void createDSCPConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations() + .define("mydscpconfig") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withQosDefinitionCollection(Arrays.asList( + new QosDefinition().withMarkings(Arrays.asList(1)) + .withSourceIpRanges(Arrays.asList(new QosIpRange().withStartIp("127.0.0.1").withEndIp("127.0.0.2"))) + .withDestinationIpRanges( + Arrays.asList(new QosIpRange().withStartIp("127.0.10.1").withEndIp("127.0.10.2"))) + .withSourcePortRanges(Arrays.asList(new QosPortRange().withStart(10).withEnd(11), + new QosPortRange().withStart(20).withEnd(21))) + .withDestinationPortRanges(Arrays.asList(new QosPortRange().withStart(15).withEnd(15))) + .withProtocol(ProtocolType.TCP), + new QosDefinition().withMarkings(Arrays.asList(2)) + .withSourceIpRanges(Arrays.asList(new QosIpRange().withStartIp("12.0.0.1").withEndIp("12.0.0.2"))) + .withDestinationIpRanges( + Arrays.asList(new QosIpRange().withStartIp("12.0.10.1").withEndIp("12.0.10.2"))) + .withSourcePortRanges(Arrays.asList(new QosPortRange().withStart(11).withEnd(12))) + .withDestinationPortRanges(Arrays.asList(new QosPortRange().withStart(51).withEnd(52))) + .withProtocol(ProtocolType.UDP))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationDeleteSamples.java new file mode 100644 index 0000000000000..daf3b5d82e992 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for DscpConfiguration Delete. + */ +public final class DscpConfigurationDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationDelete.json + */ + /** + * Sample code: Delete DSCP Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteDSCPConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations().delete("rg1", "mydscpConfig", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..153a0aa74d843 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationGetByResourceGroupSamples.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.generated; + +/** + * Samples for DscpConfiguration GetByResourceGroup. + */ +public final class DscpConfigurationGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationGet.json + */ + /** + * Sample code: Get Dscp Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDscpConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations() + .getByResourceGroupWithResponse("rg1", "mydscpConfig", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListByResourceGroupSamples.java new file mode 100644 index 0000000000000..9d90c54d83c4c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for DscpConfiguration ListByResourceGroup. + */ +public final class DscpConfigurationListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationList.json + */ + /** + * Sample code: Get Dscp Configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void getDscpConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListSamples.java new file mode 100644 index 0000000000000..84ed35ee01624 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/DscpConfigurationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for DscpConfiguration List. + */ +public final class DscpConfigurationListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/DscpConfigurationListAll.json + */ + /** + * Sample code: List all network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.dscpConfigurations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..013ea2dca4d13 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitAuthorizations CreateOrUpdate. + */ +public final class ExpressRouteCircuitAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationCreate.json + */ + /** + * Sample code: Create ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations() + .define("authorizatinName") + .withExistingExpressRouteCircuit("rg1", "circuitName") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.java new file mode 100644 index 0000000000000..efed682bd23a7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsDeleteSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitAuthorizations Delete. + */ +public final class ExpressRouteCircuitAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationDelete.json + */ + /** + * Sample code: Delete ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations() + .delete("rg1", "circuitName", "authorizationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsGetSamples.java new file mode 100644 index 0000000000000..2d6a1eeec5faf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsGetSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitAuthorizations Get. + */ +public final class ExpressRouteCircuitAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationGet.json + */ + /** + * Sample code: Get ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations() + .getWithResponse("rg1", "circuitName", "authorizationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsListSamples.java new file mode 100644 index 0000000000000..dd2f2c2230a94 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitAuthorizationsListSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitAuthorizations List. + */ +public final class ExpressRouteCircuitAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitAuthorizationList.json + */ + /** + * Sample code: List ExpressRouteCircuit Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitAuthorizations().list("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..8cb0d6e57e02b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.Ipv6CircuitConnectionConfig; + +/** + * Samples for ExpressRouteCircuitConnections CreateOrUpdate. + */ +public final class ExpressRouteCircuitConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionCreate.json + */ + /** + * Sample code: ExpressRouteCircuitConnectionCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCircuitConnectionCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .define("circuitConnectionUSAUS") + .withExistingPeering("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering") + .withExpressRouteCircuitPeering(new SubResource().withId( + "/subscriptions/subid1/resourceGroups/dedharcktinit/providers/Microsoft.Network/expressRouteCircuits/dedharcktlocal/peerings/AzurePrivatePeering")) + .withPeerExpressRouteCircuitPeering(new SubResource().withId( + "/subscriptions/subid2/resourceGroups/dedharcktpeer/providers/Microsoft.Network/expressRouteCircuits/dedharcktremote/peerings/AzurePrivatePeering")) + .withAddressPrefix("10.0.0.0/29") + .withAuthorizationKey("946a1918-b7a2-4917-b43c-8c4cdaee006a") + .withIpv6CircuitConnectionConfig(new Ipv6CircuitConnectionConfig().withAddressPrefix("aa:bb::/125")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..f2d4bc9318f42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsDeleteSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitConnections Delete. + */ +public final class ExpressRouteCircuitConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionDelete.json + */ + /** + * Sample code: Delete ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .delete("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsGetSamples.java new file mode 100644 index 0000000000000..b74185e3b0127 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsGetSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitConnections Get. + */ +public final class ExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionGet.json + */ + /** + * Sample code: ExpressRouteCircuitConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCircuitConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .getWithResponse("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", "circuitConnectionUSAUS", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsListSamples.java new file mode 100644 index 0000000000000..d7492b7233634 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitConnectionsListSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitConnections List. + */ +public final class ExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitConnectionList.json + */ + /** + * Sample code: List ExpressRouteCircuit Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitConnections() + .list("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4af7f1d4744bc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsCreateOrUpdateSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitPeerings CreateOrUpdate. + */ +public final class ExpressRouteCircuitPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringCreate.json + */ + /** + * Sample code: Create ExpressRouteCircuit Peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createExpressRouteCircuitPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings() + .define("AzurePrivatePeering") + .withExistingExpressRouteCircuit("rg1", "circuitName") + .withPeerAsn(200L) + .withPrimaryPeerAddressPrefix("192.168.16.252/30") + .withSecondaryPeerAddressPrefix("192.168.18.252/30") + .withVlanId(200) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsDeleteSamples.java new file mode 100644 index 0000000000000..3446212644ae8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsDeleteSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitPeerings Delete. + */ +public final class ExpressRouteCircuitPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringDelete.json + */ + /** + * Sample code: Delete ExpressRouteCircuit Peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteExpressRouteCircuitPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings() + .delete("rg1", "circuitName", "peeringName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsGetSamples.java new file mode 100644 index 0000000000000..76d013e66ba34 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsGetSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitPeerings Get. + */ +public final class ExpressRouteCircuitPeeringsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitPeeringGet + * .json + */ + /** + * Sample code: Get ExpressRouteCircuit Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings() + .getWithResponse("rg1", "circuitName", "MicrosoftPeering", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsListSamples.java new file mode 100644 index 0000000000000..6d79deed7fa49 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitPeeringsListSamples.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.generated; + +/** + * Samples for ExpressRouteCircuitPeerings List. + */ +public final class ExpressRouteCircuitPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringList.json + */ + /** + * Sample code: List ExpressRouteCircuit Peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuitPeerings().list("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..1bc4d93e411fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitServiceProviderProperties; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSku; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSkuFamily; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitSkuTier; +import java.util.Arrays; + +/** + * Samples for ExpressRouteCircuits CreateOrUpdate. + */ +public final class ExpressRouteCircuitsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitCreate. + * json + */ + /** + * Sample code: Create ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void createExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .define("circuitName") + .withRegion("Brazil South") + .withExistingResourceGroup("rg1") + .withSku(new ExpressRouteCircuitSku().withName("Standard_MeteredData") + .withTier(ExpressRouteCircuitSkuTier.STANDARD) + .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA)) + .withAllowClassicOperations(false) + .withAuthorizations(Arrays.asList()) + .withPeerings(Arrays.asList()) + .withServiceProviderProperties( + new ExpressRouteCircuitServiceProviderProperties().withServiceProviderName("Equinix") + .withPeeringLocation("Silicon Valley") + .withBandwidthInMbps(200)) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitCreateOnExpressRoutePort.json + */ + /** + * Sample code: Create ExpressRouteCircuit on ExpressRoutePort. + * + * @param manager Entry point to NetworkManager. + */ + public static void createExpressRouteCircuitOnExpressRoutePort( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .define("expressRouteCircuit1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new ExpressRouteCircuitSku().withName("Premium_MeteredData") + .withTier(ExpressRouteCircuitSkuTier.PREMIUM) + .withFamily(ExpressRouteCircuitSkuFamily.METERED_DATA)) + .withExpressRoutePort(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName")) + .withBandwidthInGbps(10.0F) + .withAuthorizationKey("b0be57f5-1fba-463b-adec-ffe767354cdd") + .withEnableDirectPortRateLimit(false) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsDeleteSamples.java new file mode 100644 index 0000000000000..3b83d4d0ed425 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsDeleteSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits Delete. + */ +public final class ExpressRouteCircuitsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitDelete. + * json + */ + /** + * Sample code: Delete ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().delete("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..9598ffdd74fcc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetByResourceGroupSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits GetByResourceGroup. + */ +public final class ExpressRouteCircuitsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitGet.json + */ + /** + * Sample code: Get ExpressRouteCircuit. + * + * @param manager Entry point to NetworkManager. + */ + public static void getExpressRouteCircuit(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .getByResourceGroupWithResponse("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetPeeringStatsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetPeeringStatsSamples.java new file mode 100644 index 0000000000000..ffb3a42c42126 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetPeeringStatsSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits GetPeeringStats. + */ +public final class ExpressRouteCircuitsGetPeeringStatsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitPeeringStats.json + */ + /** + * Sample code: Get ExpressRoute Circuit Peering Traffic Stats. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitPeeringTrafficStats(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .getPeeringStatsWithResponse("rg1", "circuitName", "peeringName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetStatsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetStatsSamples.java new file mode 100644 index 0000000000000..5de9a0434b8d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsGetStatsSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits GetStats. + */ +public final class ExpressRouteCircuitsGetStatsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitStats.json + */ + /** + * Sample code: Get ExpressRoute Circuit Traffic Stats. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCircuitTrafficStats(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().getStatsWithResponse("rg1", "circuitName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListArpTableSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListArpTableSamples.java new file mode 100644 index 0000000000000..9e783a1ee13b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListArpTableSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits ListArpTable. + */ +public final class ExpressRouteCircuitsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitARPTableList.json + */ + /** + * Sample code: List ARP Table. + * + * @param manager Entry point to NetworkManager. + */ + public static void listARPTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .listArpTable("rg1", "circuitName", "peeringName", "devicePath", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a0834ad858687 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListByResourceGroupSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits ListByResourceGroup. + */ +public final class ExpressRouteCircuitsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitListByResourceGroup.json + */ + /** + * Sample code: List ExpressRouteCircuits in a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitsInAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSamples.java new file mode 100644 index 0000000000000..c530b85882106 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits ListRoutesTable. + */ +public final class ExpressRouteCircuitsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitRouteTableList.json + */ + /** + * Sample code: List Route Tables. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .listRoutesTable("rg1", "circuitName", "peeringName", "devicePath", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.java new file mode 100644 index 0000000000000..bec7131ee8cd5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListRoutesTableSummarySamples.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.generated; + +/** + * Samples for ExpressRouteCircuits ListRoutesTableSummary. + */ +public final class ExpressRouteCircuitsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitRouteTableSummaryList.json + */ + /** + * Sample code: List Route Table Summary. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRouteTableSummary(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits() + .listRoutesTableSummary("rg1", "circuitName", "peeringName", "devicePath", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListSamples.java new file mode 100644 index 0000000000000..9755650882da8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsListSamples.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.generated; + +/** + * Samples for ExpressRouteCircuits List. + */ +public final class ExpressRouteCircuitsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCircuitListBySubscription.json + */ + /** + * Sample code: List ExpressRouteCircuits in a subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRouteCircuitsInASubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCircuits().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsUpdateTagsSamples.java new file mode 100644 index 0000000000000..cd857ac8e3bff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCircuitsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuit; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRouteCircuits UpdateTags. + */ +public final class ExpressRouteCircuitsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteCircuitUpdateTags + * .json + */ + /** + * Sample code: Update Express Route Circuit Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateExpressRouteCircuitTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRouteCircuit resource = manager.expressRouteCircuits() + .getByResourceGroupWithResponse("ertest", "er1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ec1555a81a92a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteConnectionInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteCircuitPeeringId; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.util.Arrays; + +/** + * Samples for ExpressRouteConnections CreateOrUpdate. + */ +public final class ExpressRouteConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionCreate. + * json + */ + /** + * Sample code: ExpressRouteConnectionCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteConnectionCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .createOrUpdate("resourceGroupName", "gateway-2", "connectionName", new ExpressRouteConnectionInner() + .withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/gateway-2/expressRouteConnections/connectionName") + .withName("connectionName") + .withExpressRouteCircuitPeering(new ExpressRouteCircuitPeeringId().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteCircuits/circuitName/peerings/AzurePrivatePeering")) + .withAuthorizationKey("fakeTokenPlaceholder") + .withRoutingWeight(2) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..fd492080fda7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsDeleteSamples.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.generated; + +/** + * Samples for ExpressRouteConnections Delete. + */ +public final class ExpressRouteConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionDelete. + * json + */ + /** + * Sample code: ExpressRouteConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .delete("resourceGroupName", "expressRouteGatewayName", "connectionName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsGetSamples.java new file mode 100644 index 0000000000000..d874b943b0803 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsGetSamples.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.generated; + +/** + * Samples for ExpressRouteConnections Get. + */ +public final class ExpressRouteConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionGet. + * json + */ + /** + * Sample code: ExpressRouteConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .getWithResponse("resourceGroupName", "expressRouteGatewayName", "connectionName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsListSamples.java new file mode 100644 index 0000000000000..d9c9d495226f1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteConnectionsListSamples.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.generated; + +/** + * Samples for ExpressRouteConnections List. + */ +public final class ExpressRouteConnectionsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteConnectionList. + * json + */ + /** + * Sample code: ExpressRouteConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteConnections() + .listWithResponse("resourceGroupName", "expressRouteGatewayName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a98cebd939d50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteCrossConnectionPeeringInner; +import com.azure.resourcemanager.network.generated.models.Ipv6ExpressRouteCircuitPeeringConfig; + +/** + * Samples for ExpressRouteCrossConnectionPeerings CreateOrUpdate. + */ +public final class ExpressRouteCrossConnectionPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringCreate.json + */ + /** + * Sample code: ExpressRouteCrossConnectionBgpPeeringCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteCrossConnectionBgpPeeringCreate( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .createOrUpdate("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + new ExpressRouteCrossConnectionPeeringInner().withPeerAsn(200L) + .withPrimaryPeerAddressPrefix("192.168.16.252/30") + .withSecondaryPeerAddressPrefix("192.168.18.252/30") + .withVlanId(200) + .withIpv6PeeringConfig(new Ipv6ExpressRouteCircuitPeeringConfig() + .withPrimaryPeerAddressPrefix("3FFE:FFFF:0:CD30::/126") + .withSecondaryPeerAddressPrefix("3FFE:FFFF:0:CD30::4/126")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.java new file mode 100644 index 0000000000000..1f6d1bfc7b577 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsDeleteSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnectionPeerings Delete. + */ +public final class ExpressRouteCrossConnectionPeeringsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringDelete.json + */ + /** + * Sample code: DeleteExpressRouteCrossConnectionBgpPeering. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteExpressRouteCrossConnectionBgpPeering( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .delete("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsGetSamples.java new file mode 100644 index 0000000000000..09bcdf6d307c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsGetSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnectionPeerings Get. + */ +public final class ExpressRouteCrossConnectionPeeringsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringGet.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionBgpPeering. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnectionBgpPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .getWithResponse("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsListSamples.java new file mode 100644 index 0000000000000..c935f0d45bab9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionPeeringsListSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnectionPeerings List. + */ +public final class ExpressRouteCrossConnectionPeeringsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionBgpPeeringList.json + */ + /** + * Sample code: ExpressRouteCrossConnectionBgpPeeringList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCrossConnectionBgpPeeringList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnectionPeerings() + .list("CrossConnection-SiliconValley", "", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..81fbad503def7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ServiceProviderProvisioningState; + +/** + * Samples for ExpressRouteCrossConnections CreateOrUpdate. + */ +public final class ExpressRouteCrossConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionUpdate.json + */ + /** + * Sample code: UpdateExpressRouteCrossConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateExpressRouteCrossConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .define("") + .withRegion((String) null) + .withExistingResourceGroup("CrossConnection-SiliconValley") + .withServiceProviderProvisioningState(ServiceProviderProvisioningState.NOT_PROVISIONED) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..22a7a35226038 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsGetByResourceGroupSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnections GetByResourceGroup. + */ +public final class ExpressRouteCrossConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionGet.json + */ + /** + * Sample code: GetExpressRouteCrossConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .getByResourceGroupWithResponse("CrossConnection-SiliconValley", "", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListArpTableSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListArpTableSamples.java new file mode 100644 index 0000000000000..4f9edef2da2fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListArpTableSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnections ListArpTable. + */ +public final class ExpressRouteCrossConnectionsListArpTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionsArpTable.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionsArpTable. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnectionsArpTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listArpTable("CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..53801d0da9e0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListByResourceGroupSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnections ListByResourceGroup. + */ +public final class ExpressRouteCrossConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionListByResourceGroup.json + */ + /** + * Sample code: ExpressRouteCrossConnectionListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteCrossConnectionListByResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listByResourceGroup("CrossConnection-SiliconValley", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.java new file mode 100644 index 0000000000000..8b352c84bbe4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnections ListRoutesTable. + */ +public final class ExpressRouteCrossConnectionsListRoutesTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionsRouteTable.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionsRouteTable. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRouteCrossConnectionsRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listRoutesTable("CrossConnection-SiliconValley", "", "AzurePrivatePeering", "primary", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.java new file mode 100644 index 0000000000000..543bc27b2bac6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListRoutesTableSummarySamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnections ListRoutesTableSummary. + */ +public final class ExpressRouteCrossConnectionsListRoutesTableSummarySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionsRouteTableSummary.json + */ + /** + * Sample code: GetExpressRouteCrossConnectionsRouteTableSummary. + * + * @param manager Entry point to NetworkManager. + */ + public static void getExpressRouteCrossConnectionsRouteTableSummary( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections() + .listRoutesTableSummary("CrossConnection-SiliconValley", "", "AzurePrivatePeering", + "primary", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListSamples.java new file mode 100644 index 0000000000000..7f69c97c8d21b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsListSamples.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.generated; + +/** + * Samples for ExpressRouteCrossConnections List. + */ +public final class ExpressRouteCrossConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionList.json + */ + /** + * Sample code: ExpressRouteCrossConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteCrossConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteCrossConnections().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.java new file mode 100644 index 0000000000000..eac4a0dc41829 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteCrossConnectionsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ExpressRouteCrossConnection; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRouteCrossConnections UpdateTags. + */ +public final class ExpressRouteCrossConnectionsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteCrossConnectionUpdateTags.json + */ + /** + * Sample code: UpdateExpressRouteCrossConnectionTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateExpressRouteCrossConnectionTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRouteCrossConnection resource = manager.expressRouteCrossConnections() + .getByResourceGroupWithResponse("CrossConnection-SiliconValley", "", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7acc19d544d3f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfiguration; +import com.azure.resourcemanager.network.generated.models.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds; +import com.azure.resourcemanager.network.generated.models.VirtualHubId; + +/** + * Samples for ExpressRouteGateways CreateOrUpdate. + */ +public final class ExpressRouteGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayCreate. + * json + */ + /** + * Sample code: ExpressRouteGatewayCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .define("gateway-2") + .withRegion("westus") + .withExistingResourceGroup("resourceGroupName") + .withAutoScaleConfiguration(new ExpressRouteGatewayPropertiesAutoScaleConfiguration() + .withBounds(new ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds().withMin(3))) + .withVirtualHub(new VirtualHubId().withId( + "/subscriptions/subid/resourceGroups/resourceGroupId/providers/Microsoft.Network/virtualHubs/virtualHubName")) + .withAllowNonVirtualWanTraffic(false) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysDeleteSamples.java new file mode 100644 index 0000000000000..a4049c65a9f31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysDeleteSamples.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.generated; + +/** + * Samples for ExpressRouteGateways Delete. + */ +public final class ExpressRouteGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayDelete. + * json + */ + /** + * Sample code: ExpressRouteGatewayDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .delete("resourceGroupName", "expressRouteGatewayName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..282e97de5f413 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysGetByResourceGroupSamples.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.generated; + +/** + * Samples for ExpressRouteGateways GetByResourceGroup. + */ +public final class ExpressRouteGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayGet.json + */ + /** + * Sample code: ExpressRouteGatewayGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .getByResourceGroupWithResponse("resourceGroupName", "expressRouteGatewayName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..4e8b34545a9d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListByResourceGroupSamples.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.generated; + +/** + * Samples for ExpressRouteGateways ListByResourceGroup. + */ +public final class ExpressRouteGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteGatewayListByResourceGroup.json + */ + /** + * Sample code: ExpressRouteGatewayListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteGatewayListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways() + .listByResourceGroupWithResponse("resourceGroupName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListBySubscriptionSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListBySubscriptionSamples.java new file mode 100644 index 0000000000000..30d7b1cabb6db --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysListBySubscriptionSamples.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.generated; + +/** + * Samples for ExpressRouteGateways ListBySubscription. + */ +public final class ExpressRouteGatewaysListBySubscriptionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRouteGatewayListBySubscription.json + */ + /** + * Sample code: ExpressRouteGatewayListBySubscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteGatewayListBySubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteGateways().listBySubscriptionWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysUpdateTagsSamples.java new file mode 100644 index 0000000000000..64e820efd67a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteGatewaysUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ExpressRouteGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRouteGateways UpdateTags. + */ +public final class ExpressRouteGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteGatewayUpdateTags + * .json + */ + /** + * Sample code: ExpressRouteGatewayUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRouteGateway resource = manager.expressRouteGateways() + .getByResourceGroupWithResponse("resourceGroupName", "expressRouteGatewayName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksGetSamples.java new file mode 100644 index 0000000000000..25cc47bd73b44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ExpressRouteLinks Get. + */ +public final class ExpressRouteLinksGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteLinkGet.json + */ + /** + * Sample code: ExpressRouteLinkGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteLinkGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteLinks().getWithResponse("rg1", "portName", "linkName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksListSamples.java new file mode 100644 index 0000000000000..d5237c9e3e0f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteLinksListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ExpressRouteLinks List. + */ +public final class ExpressRouteLinksListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteLinkList.json + */ + /** + * Sample code: ExpressRouteLinkGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteLinkGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteLinks().list("rg1", "portName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a0e2eac7bf4a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsCreateOrUpdateSamples.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.generated; + +/** + * Samples for ExpressRoutePortAuthorizations CreateOrUpdate. + */ +public final class ExpressRoutePortAuthorizationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationCreate.json + */ + /** + * Sample code: Create ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations() + .define("authorizatinName") + .withExistingExpressRoutePort("rg1", "expressRoutePortName") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsDeleteSamples.java new file mode 100644 index 0000000000000..538476862c91a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsDeleteSamples.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.generated; + +/** + * Samples for ExpressRoutePortAuthorizations Delete. + */ +public final class ExpressRoutePortAuthorizationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationDelete.json + */ + /** + * Sample code: Delete ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations() + .delete("rg1", "expressRoutePortName", "authorizationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsGetSamples.java new file mode 100644 index 0000000000000..eafc2aaf3f5de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsGetSamples.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.generated; + +/** + * Samples for ExpressRoutePortAuthorizations Get. + */ +public final class ExpressRoutePortAuthorizationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationGet.json + */ + /** + * Sample code: Get ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations() + .getWithResponse("rg1", "expressRoutePortName", "authorizationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsListSamples.java new file mode 100644 index 0000000000000..6fd9db37ea32c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortAuthorizationsListSamples.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.generated; + +/** + * Samples for ExpressRoutePortAuthorizations List. + */ +public final class ExpressRoutePortAuthorizationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortAuthorizationList.json + */ + /** + * Sample code: List ExpressRoutePort Authorization. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listExpressRoutePortAuthorization(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortAuthorizations().list("rg1", "expressRoutePortName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..648637b6987a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ExpressRouteLinkInner; +import com.azure.resourcemanager.network.generated.models.ExpressRouteLinkAdminState; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsBillingType; +import com.azure.resourcemanager.network.generated.models.ExpressRoutePortsEncapsulation; +import java.util.Arrays; + +/** + * Samples for ExpressRoutePorts CreateOrUpdate. + */ +public final class ExpressRoutePortsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortUpdateLink. + * json + */ + /** + * Sample code: ExpressRoutePortUpdateLink. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortUpdateLink(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts() + .define("portName") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withPeeringLocation("peeringLocationName") + .withBandwidthInGbps(100) + .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ) + .withLinks(Arrays.asList( + new ExpressRouteLinkInner().withName("link1").withAdminState(ExpressRouteLinkAdminState.ENABLED))) + .withBillingType(ExpressRoutePortsBillingType.UNLIMITED_DATA) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortCreate.json + */ + /** + * Sample code: ExpressRoutePortCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts() + .define("portName") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withPeeringLocation("peeringLocationName") + .withBandwidthInGbps(100) + .withEncapsulation(ExpressRoutePortsEncapsulation.QINQ) + .withBillingType(ExpressRoutePortsBillingType.UNLIMITED_DATA) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsDeleteSamples.java new file mode 100644 index 0000000000000..3ccf59a041416 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ExpressRoutePorts Delete. + */ +public final class ExpressRoutePortsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortDelete.json + */ + /** + * Sample code: ExpressRoutePortDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().delete("rg1", "portName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGenerateLoaSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGenerateLoaSamples.java new file mode 100644 index 0000000000000..2378ff2f97aa6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGenerateLoaSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.GenerateExpressRoutePortsLoaRequest; + +/** + * Samples for ExpressRoutePorts GenerateLoa. + */ +public final class ExpressRoutePortsGenerateLoaSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/GenerateExpressRoutePortsLOA. + * json + */ + /** + * Sample code: GenerateExpressRoutePortLOA. + * + * @param manager Entry point to NetworkManager. + */ + public static void generateExpressRoutePortLOA(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts() + .generateLoaWithResponse("rg1", "portName", + new GenerateExpressRoutePortsLoaRequest().withCustomerName("customerName"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..07dd5ce12c884 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ExpressRoutePorts GetByResourceGroup. + */ +public final class ExpressRoutePortsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortGet.json + */ + /** + * Sample code: ExpressRoutePortGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().getByResourceGroupWithResponse("rg1", "portName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ae0374ce26d9e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListByResourceGroupSamples.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.generated; + +/** + * Samples for ExpressRoutePorts ListByResourceGroup. + */ +public final class ExpressRoutePortsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ExpressRoutePortListByResourceGroup.json + */ + /** + * Sample code: ExpressRoutePortListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRoutePortListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListSamples.java new file mode 100644 index 0000000000000..613bdf1171aff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ExpressRoutePorts List. + */ +public final class ExpressRoutePortsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortList.json + */ + /** + * Sample code: ExpressRoutePortList. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePorts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsGetSamples.java new file mode 100644 index 0000000000000..3d86bfa807da4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsGetSamples.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.generated; + +/** + * Samples for ExpressRoutePortsLocations Get. + */ +public final class ExpressRoutePortsLocationsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortsLocationGet. + * json + */ + /** + * Sample code: ExpressRoutePortsLocationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRoutePortsLocationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortsLocations().getWithResponse("locationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsListSamples.java new file mode 100644 index 0000000000000..9e4333b9e052c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsLocationsListSamples.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.generated; + +/** + * Samples for ExpressRoutePortsLocations List. + */ +public final class ExpressRoutePortsLocationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortsLocationList + * .json + */ + /** + * Sample code: ExpressRoutePortsLocationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRoutePortsLocationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRoutePortsLocations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsUpdateTagsSamples.java new file mode 100644 index 0000000000000..b5265a9bba8a8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRoutePortsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ExpressRoutePort; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ExpressRoutePorts UpdateTags. + */ +public final class ExpressRoutePortsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRoutePortUpdateTags. + * json + */ + /** + * Sample code: ExpressRoutePortUpdateTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRoutePortUpdateTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ExpressRoutePort resource = manager.expressRoutePorts() + .getByResourceGroupWithResponse("rg1", "portName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteProviderPortsLocationListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteProviderPortsLocationListSamples.java new file mode 100644 index 0000000000000..f4008c3c0da6e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteProviderPortsLocationListSamples.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.generated; + +/** + * Samples for ExpressRouteProviderPortsLocation List. + */ +public final class ExpressRouteProviderPortsLocationListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/expressRouteProviderPortList. + * json + */ + /** + * Sample code: ExpressRouteProviderPortList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + expressRouteProviderPortList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteProviderPortsLocations().listWithResponse(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteServiceProvidersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteServiceProvidersListSamples.java new file mode 100644 index 0000000000000..2f821eebfa12f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ExpressRouteServiceProvidersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ExpressRouteServiceProviders List. + */ +public final class ExpressRouteServiceProvidersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ExpressRouteProviderList.json + */ + /** + * Sample code: List ExpressRoute providers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listExpressRouteProviders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.expressRouteServiceProviders().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e704c23aa23b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyCertificateAuthority; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionConfiguration; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProfileType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProtocol; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionSignatureSpecification; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionStateType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsResources; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsWorkspace; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySku; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySkuTier; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyTransportSecurity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicies CreateOrUpdate. + */ +public final class FirewallPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyPut.json + */ + /** + * Sample code: Create FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies() + .define("firewallPolicy") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withThreatIntelWhitelist( + new FirewallPolicyThreatIntelWhitelist().withIpAddresses(Arrays.asList("20.3.4.5")) + .withFqdns(Arrays.asList("*.microsoft.com"))) + .withInsights(new FirewallPolicyInsights().withIsEnabled(true) + .withRetentionDays(100) + .withLogAnalyticsResources(new FirewallPolicyLogAnalyticsResources().withWorkspaces(Arrays.asList( + new FirewallPolicyLogAnalyticsWorkspace().withRegion("westus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1")), + new FirewallPolicyLogAnalyticsWorkspace().withRegion("eastus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2")))) + .withDefaultWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace")))) + .withSnat(new FirewallPolicySnat().withPrivateRanges(Arrays.asList("IANAPrivateRanges"))) + .withSql(new FirewallPolicySql().withAllowSqlRedirect(true)) + .withDnsSettings(new DnsSettings().withServers(Arrays.asList("30.3.4.5")) + .withEnableProxy(true) + .withRequireProxyForNetworkRules(false)) + .withExplicitProxy(new ExplicitProxy().withEnableExplicitProxy(true) + .withHttpPort(8087) + .withHttpsPort(8087) + .withEnablePacFile(true) + .withPacFilePort(8087) + .withPacFile( + "https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D")) + .withIntrusionDetection( + new FirewallPolicyIntrusionDetection().withMode(FirewallPolicyIntrusionDetectionStateType.ALERT) + .withProfile(FirewallPolicyIntrusionDetectionProfileType.fromString("Balanced")) + .withConfiguration(new FirewallPolicyIntrusionDetectionConfiguration() + .withSignatureOverrides( + Arrays.asList(new FirewallPolicyIntrusionDetectionSignatureSpecification().withId("2525004") + .withMode(FirewallPolicyIntrusionDetectionStateType.DENY))) + .withBypassTrafficSettings(Arrays.asList( + new FirewallPolicyIntrusionDetectionBypassTrafficSpecifications().withName("bypassRule1") + .withDescription("Rule 1") + .withProtocol(FirewallPolicyIntrusionDetectionProtocol.TCP) + .withSourceAddresses(Arrays.asList("1.2.3.4")) + .withDestinationAddresses(Arrays.asList("5.6.7.8")) + .withDestinationPorts(Arrays.asList("*")))))) + .withTransportSecurity(new FirewallPolicyTransportSecurity().withCertificateAuthority( + new FirewallPolicyCertificateAuthority().withKeyVaultSecretId("fakeTokenPlaceholder") + .withName("clientcert"))) + .withSku(new FirewallPolicySku().withTier(FirewallPolicySkuTier.PREMIUM)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..3c0992373ea2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for FirewallPolicies Delete. + */ +public final class FirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDelete.json + */ + /** + * Sample code: Delete Firewall Policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies().delete("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..1634dcc24baed --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesGetByResourceGroupSamples.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.generated; + +/** + * Samples for FirewallPolicies GetByResourceGroup. + */ +public final class FirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyGet.json + */ + /** + * Sample code: Get FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies() + .getByResourceGroupWithResponse("rg1", "firewallPolicy", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..835299753e0c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListByResourceGroupSamples.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.generated; + +/** + * Samples for FirewallPolicies ListByResourceGroup. + */ +public final class FirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyListByResourceGroup.json + */ + /** + * Sample code: List all Firewall Policies for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPoliciesForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListSamples.java new file mode 100644 index 0000000000000..a2b322ee9203e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesListSamples.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.generated; + +/** + * Samples for FirewallPolicies List. + */ +public final class FirewallPoliciesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyListBySubscription.json + */ + /** + * Sample code: List all Firewall Policies for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPoliciesForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesUpdateTagsSamples.java new file mode 100644 index 0000000000000..0fa38b1e254df --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPoliciesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.FirewallPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicies UpdateTags. + */ +public final class FirewallPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyPatch.json + */ + /** + * Sample code: Update FirewallPolicy Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateFirewallPolicyTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + FirewallPolicy resource = manager.firewallPolicies() + .getByResourceGroupWithResponse("myResourceGroup", "firewallPolicy", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDeploymentsDeploySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDeploymentsDeploySamples.java new file mode 100644 index 0000000000000..e67607288daff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDeploymentsDeploySamples.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.generated; + +/** + * Samples for FirewallPolicyDeployments Deploy. + */ +public final class FirewallPolicyDeploymentsDeploySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftDeploy. + * json + */ + /** + * Sample code: deploy firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void deployFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDeployments().deploy("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..baf9333a09217 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyDraftInner; +import com.azure.resourcemanager.network.generated.models.AzureFirewallThreatIntelMode; +import com.azure.resourcemanager.network.generated.models.DnsSettings; +import com.azure.resourcemanager.network.generated.models.ExplicitProxy; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyInsights; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionBypassTrafficSpecifications; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionConfiguration; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProfileType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionProtocol; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionSignatureSpecification; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIntrusionDetectionStateType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsResources; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyLogAnalyticsWorkspace; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySnat; +import com.azure.resourcemanager.network.generated.models.FirewallPolicySql; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyThreatIntelWhitelist; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyDrafts CreateOrUpdate. + */ +public final class FirewallPolicyDraftsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftPut.json + */ + /** + * Sample code: create or update firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDrafts() + .createOrUpdateWithResponse("rg1", "firewallPolicy", new FirewallPolicyDraftInner() + .withThreatIntelMode(AzureFirewallThreatIntelMode.ALERT) + .withThreatIntelWhitelist( + new FirewallPolicyThreatIntelWhitelist().withIpAddresses(Arrays.asList("20.3.4.5")) + .withFqdns(Arrays.asList("*.microsoft.com"))) + .withInsights(new FirewallPolicyInsights().withIsEnabled(true) + .withRetentionDays(100) + .withLogAnalyticsResources(new FirewallPolicyLogAnalyticsResources().withWorkspaces(Arrays.asList( + new FirewallPolicyLogAnalyticsWorkspace().withRegion("westus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace1")), + new FirewallPolicyLogAnalyticsWorkspace().withRegion("eastus") + .withWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/workspace2")))) + .withDefaultWorkspaceId(new SubResource().withId( + "/subscriptions/subid/resourcegroups/rg1/providers/microsoft.operationalinsights/workspaces/defaultWorkspace")))) + .withSnat(new FirewallPolicySnat().withPrivateRanges(Arrays.asList("IANAPrivateRanges"))) + .withSql(new FirewallPolicySql().withAllowSqlRedirect(true)) + .withDnsSettings(new DnsSettings().withServers(Arrays.asList("30.3.4.5")) + .withEnableProxy(true) + .withRequireProxyForNetworkRules(false)) + .withExplicitProxy(new ExplicitProxy().withEnableExplicitProxy(true) + .withHttpPort(8087) + .withHttpsPort(8087) + .withEnablePacFile(true) + .withPacFilePort(8087) + .withPacFile( + "https://tinawstorage.file.core.windows.net/?sv=2020-02-10&ss=bfqt&srt=sco&sp=rwdlacuptfx&se=2021-06-04T07:01:12Z&st=2021-06-03T23:01:12Z&sip=68.65.171.11&spr=https&sig=Plsa0RRVpGbY0IETZZOT6znOHcSro71LLTTbzquYPgs%3D")) + .withIntrusionDetection(new FirewallPolicyIntrusionDetection() + .withMode(FirewallPolicyIntrusionDetectionStateType.ALERT) + .withProfile(FirewallPolicyIntrusionDetectionProfileType.fromString("Balanced")) + .withConfiguration(new FirewallPolicyIntrusionDetectionConfiguration() + .withSignatureOverrides( + Arrays.asList(new FirewallPolicyIntrusionDetectionSignatureSpecification().withId("2525004") + .withMode(FirewallPolicyIntrusionDetectionStateType.DENY))) + .withBypassTrafficSettings(Arrays.asList( + new FirewallPolicyIntrusionDetectionBypassTrafficSpecifications().withName("bypassRule1") + .withDescription("Rule 1") + .withProtocol(FirewallPolicyIntrusionDetectionProtocol.TCP) + .withSourceAddresses(Arrays.asList("1.2.3.4")) + .withDestinationAddresses(Arrays.asList("5.6.7.8")) + .withDestinationPorts(Arrays.asList("*")))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsDeleteSamples.java new file mode 100644 index 0000000000000..68edf248aeb8e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsDeleteSamples.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.generated; + +/** + * Samples for FirewallPolicyDrafts Delete. + */ +public final class FirewallPolicyDraftsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftDelete. + * json + */ + /** + * Sample code: delete firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDrafts() + .deleteByResourceGroupWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsGetSamples.java new file mode 100644 index 0000000000000..7f4d320214f77 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyDraftsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for FirewallPolicyDrafts Get. + */ +public final class FirewallPolicyDraftsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/FirewallPolicyDraftGet.json + */ + /** + * Sample code: get firewall policy draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicyDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyDrafts().getWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.java new file mode 100644 index 0000000000000..a603960e97a12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesFilterValuesListSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.SignatureOverridesFilterValuesQuery; + +/** + * Samples for FirewallPolicyIdpsSignaturesFilterValues List. + */ +public final class FirewallPolicyIdpsSignaturesFilterValuesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyQuerySignatureOverridesFilterValues.json + */ + /** + * Sample code: query signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void querySignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesFilterValues() + .listWithResponse("rg1", "firewallPolicy", + new SignatureOverridesFilterValuesQuery().withFilterName("severity"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesListSamples.java new file mode 100644 index 0000000000000..f5d5d18f61d08 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesListSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.FilterItems; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyIdpsQuerySortOrder; +import com.azure.resourcemanager.network.generated.models.IdpsQueryObject; +import com.azure.resourcemanager.network.generated.models.OrderBy; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyIdpsSignatures List. + */ +public final class FirewallPolicyIdpsSignaturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyQuerySignatureOverrides.json + */ + /** + * Sample code: query signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void querySignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignatures() + .listWithResponse("rg1", "firewallPolicy", new IdpsQueryObject() + .withFilters(Arrays.asList(new FilterItems().withField("Mode").withValues(Arrays.asList("Deny")))) + .withSearch("") + .withOrderBy(new OrderBy().withField("severity").withOrder(FirewallPolicyIdpsQuerySortOrder.ASCENDING)) + .withResultsPerPage(20) + .withSkip(0), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.java new file mode 100644 index 0000000000000..7e5e83690fcdd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesGetSamples.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.generated; + +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides Get. + */ +public final class FirewallPolicyIdpsSignaturesOverridesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesGet.json + */ + /** + * Sample code: get signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .getWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.java new file mode 100644 index 0000000000000..16c119c8a19a4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesListSamples.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.generated; + +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides List. + */ +public final class FirewallPolicyIdpsSignaturesOverridesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesList.json + */ + /** + * Sample code: get signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .listWithResponse("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.java new file mode 100644 index 0000000000000..5d17267f23253 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPatchSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides Patch. + */ +public final class FirewallPolicyIdpsSignaturesOverridesPatchSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesPatch.json + */ + /** + * Sample code: patch signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void patchSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .patchWithResponse("rg1", "firewallPolicy", new SignaturesOverridesInner().withName("default") + .withId( + "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default") + .withType("Microsoft.Network/firewallPolicies/signatureOverrides") + .withProperties( + new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.java new file mode 100644 index 0000000000000..5efae43526b98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyIdpsSignaturesOverridesPutSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.SignaturesOverridesInner; +import com.azure.resourcemanager.network.generated.models.SignaturesOverridesProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FirewallPolicyIdpsSignaturesOverrides Put. + */ +public final class FirewallPolicyIdpsSignaturesOverridesPutSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicySignatureOverridesPut.json + */ + /** + * Sample code: put signature overrides. + * + * @param manager Entry point to NetworkManager. + */ + public static void putSignatureOverrides(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyIdpsSignaturesOverrides() + .putWithResponse("rg1", "firewallPolicy", new SignaturesOverridesInner().withName("default") + .withId( + "/subscriptions/e747cc13-97d4-4a79-b463-42d7f4e558f2/resourceGroups/rg1/providers/Microsoft.Network/firewallPolicies/firewallPolicy/signatureOverrides/default") + .withType("Microsoft.Network/firewallPolicies/signatureOverrides") + .withProperties( + new SignaturesOverridesProperties().withSignatures(mapOf("2000105", "Off", "2000106", "Deny"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..6bd5710c3c34a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.FirewallPolicyRuleCollectionGroupDraftInner; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionAction; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionActionType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleNetworkProtocol; +import com.azure.resourcemanager.network.generated.models.NetworkRule; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyRuleCollectionGroupDrafts CreateOrUpdate. + */ +public final class FirewallPolicyRuleCollectionGroupDraftsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDraftPut.json + */ + /** + * Sample code: create or update rule collection group draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateRuleCollectionGroupDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroupDrafts() + .createOrUpdateWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", + new FirewallPolicyRuleCollectionGroupDraftInner().withPriority(100) + .withRuleCollections(Arrays + .asList(new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withPriority(100) + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new NetworkRule().withName("network-rule1") + .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.1.25.0/24")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("*")))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsDeleteSamples.java new file mode 100644 index 0000000000000..cff72b0717f2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsDeleteSamples.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.generated; + +/** + * Samples for FirewallPolicyRuleCollectionGroupDrafts Delete. + */ +public final class FirewallPolicyRuleCollectionGroupDraftsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDraftDelete.json + */ + /** + * Sample code: delete firewall rule collection group draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteFirewallRuleCollectionGroupDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroupDrafts() + .deleteWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsGetSamples.java new file mode 100644 index 0000000000000..a074bc6e64621 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupDraftsGetSamples.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.generated; + +/** + * Samples for FirewallPolicyRuleCollectionGroupDrafts Get. + */ +public final class FirewallPolicyRuleCollectionGroupDraftsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDraftGet.json + */ + /** + * Sample code: get rule collection group draft. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRuleCollectionGroupDraft(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroupDrafts() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7f1ef32e7237b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ApplicationRule; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionAction; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyFilterRuleCollectionActionType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyHttpHeaderToInsert; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollection; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollectionAction; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyNatRuleCollectionActionType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleApplicationProtocol; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleApplicationProtocolType; +import com.azure.resourcemanager.network.generated.models.FirewallPolicyRuleNetworkProtocol; +import com.azure.resourcemanager.network.generated.models.NatRule; +import com.azure.resourcemanager.network.generated.models.NetworkRule; +import java.util.Arrays; + +/** + * Samples for FirewallPolicyRuleCollectionGroups CreateOrUpdate. + */ +public final class FirewallPolicyRuleCollectionGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupPut.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(100) + .withRuleCollections( + Arrays.asList(new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withPriority(100) + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new NetworkRule().withName("network-rule1") + .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP)) + .withSourceAddresses(Arrays.asList("10.1.25.0/24")) + .withDestinationAddresses(Arrays.asList("*")) + .withDestinationPorts(Arrays.asList("*")))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithWebCategoriesPut.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group With Web Categories. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicyRuleCollectionGroupWithWebCategories( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(110) + .withRuleCollections( + Arrays.asList(new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new ApplicationRule().withName("rule1") + .withDescription("Deny inbound rule") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new FirewallPolicyRuleApplicationProtocol() + .withProtocolType(FirewallPolicyRuleApplicationProtocolType.HTTPS) + .withPort(443))) + .withWebCategories(Arrays.asList("Hacking")))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyNatRuleCollectionGroupPut.json + */ + /** + * Sample code: Create Firewall Policy Nat Rule Collection Group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createFirewallPolicyNatRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(100) + .withRuleCollections( + Arrays.asList(new FirewallPolicyNatRuleCollection().withName("Example-Nat-Rule-Collection") + .withPriority(100) + .withAction(new FirewallPolicyNatRuleCollectionAction() + .withType(FirewallPolicyNatRuleCollectionActionType.DNAT)) + .withRules(Arrays.asList(new NatRule().withName("nat-rule1") + .withIpProtocols( + Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP, FirewallPolicyRuleNetworkProtocol.UDP)) + .withSourceAddresses(Arrays.asList("2.2.2.2")) + .withDestinationAddresses(Arrays.asList("152.23.32.23")) + .withDestinationPorts(Arrays.asList("8080")) + .withTranslatedPort("8080") + .withSourceIpGroups(Arrays.asList()) + .withTranslatedFqdn("internalhttp.server.net"))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithIpGroupsPut.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group With IP Groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicyRuleCollectionGroupWithIPGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(110) + .withRuleCollections(Arrays.asList(new FirewallPolicyFilterRuleCollection() + .withName("Example-Filter-Rule-Collection") + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.DENY)) + .withRules(Arrays.asList(new NetworkRule().withName("network-1") + .withIpProtocols(Arrays.asList(FirewallPolicyRuleNetworkProtocol.TCP)) + .withDestinationPorts(Arrays.asList("*")) + .withSourceIpGroups(Arrays.asList( + "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups1")) + .withDestinationIpGroups(Arrays.asList( + "/subscriptions/subid/providers/Microsoft.Network/resourceGroup/rg1/ipGroups/ipGroups2")))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithHttpHeadersToInsert.json + */ + /** + * Sample code: Create Firewall Policy Rule Collection Group With http header to insert. + * + * @param manager Entry point to NetworkManager. + */ + public static void createFirewallPolicyRuleCollectionGroupWithHttpHeaderToInsert( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .define("ruleCollectionGroup1") + .withExistingFirewallPolicy("rg1", "firewallPolicy") + .withPriority(110) + .withRuleCollections( + Arrays + .asList( + new FirewallPolicyFilterRuleCollection().withName("Example-Filter-Rule-Collection") + .withAction(new FirewallPolicyFilterRuleCollectionAction() + .withType(FirewallPolicyFilterRuleCollectionActionType.ALLOW)) + .withRules( + Arrays.asList(new ApplicationRule().withName("rule1") + .withDescription("Insert trusted tenants header") + .withSourceAddresses(Arrays.asList("216.58.216.164", "10.0.0.0/24")) + .withProtocols(Arrays.asList(new FirewallPolicyRuleApplicationProtocol() + .withProtocolType(FirewallPolicyRuleApplicationProtocolType.HTTP) + .withPort(80))) + .withFqdnTags(Arrays.asList("WindowsVirtualDesktop")) + .withHttpHeadersToInsert(Arrays.asList(new FirewallPolicyHttpHeaderToInsert() + .withHeaderName("Restrict-Access-To-Tenants") + .withHeaderValue("contoso.com,fabrikam.onmicrosoft.com"))))))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.java new file mode 100644 index 0000000000000..67044c0c69778 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsDeleteSamples.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.generated; + +/** + * Samples for FirewallPolicyRuleCollectionGroups Delete. + */ +public final class FirewallPolicyRuleCollectionGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupDelete.json + */ + /** + * Sample code: Delete FirewallPolicyRuleCollectionGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .delete("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsGetSamples.java new file mode 100644 index 0000000000000..c54fb9ae587c1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsGetSamples.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.generated; + +/** + * Samples for FirewallPolicyRuleCollectionGroups Get. + */ +public final class FirewallPolicyRuleCollectionGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyNatRuleCollectionGroupGet.json + */ + /** + * Sample code: Get FirewallPolicyNatRuleCollectionGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getFirewallPolicyNatRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithWebCategoriesGet.json + */ + /** + * Sample code: Get FirewallPolicyRuleCollectionGroup With Web Categories. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicyRuleCollectionGroupWithWebCategories( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupGet.json + */ + /** + * Sample code: Get FirewallPolicyRuleCollectionGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getFirewallPolicyRuleCollectionGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleCollectionGroup1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithIpGroupsGet.json + */ + /** + * Sample code: Get FirewallPolicyRuleCollectionGroup With IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFirewallPolicyRuleCollectionGroupWithIpGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups() + .getWithResponse("rg1", "firewallPolicy", "ruleGroup1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsListSamples.java new file mode 100644 index 0000000000000..79df8a9fe4b41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FirewallPolicyRuleCollectionGroupsListSamples.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.generated; + +/** + * Samples for FirewallPolicyRuleCollectionGroups List. + */ +public final class FirewallPolicyRuleCollectionGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupList.json + */ + /** + * Sample code: List all FirewallPolicyRuleCollectionGroups for a given FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPolicyRuleCollectionGroupsForAGivenFirewallPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithIpGroupsList.json + */ + /** + * Sample code: List all FirewallPolicyRuleCollectionGroups with IpGroups for a given FirewallPolicy. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPolicyRuleCollectionGroupsWithIpGroupsForAGivenFirewallPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * FirewallPolicyRuleCollectionGroupWithWebCategoriesList.json + */ + /** + * Sample code: List all FirewallPolicyRuleCollectionGroup With Web Categories. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllFirewallPolicyRuleCollectionGroupWithWebCategories( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.firewallPolicyRuleCollectionGroups().list("rg1", "firewallPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ef8718c8ebe5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.FlowLogFormatParameters; +import com.azure.resourcemanager.network.generated.models.FlowLogFormatType; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FlowLogs CreateOrUpdate. + */ +public final class FlowLogsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogCreate. + * json + */ + /** + * Sample code: Create or update flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs() + .define("fl") + .withRegion("centraluseuap") + .withExistingNetworkWatcher("rg1", "nw1") + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe") + .withEnabledFilteringCriteria("srcIP=158.255.7.8 || dstPort=56891") + .withEnabled(true) + .withFormat(new FlowLogFormatParameters().withType(FlowLogFormatType.JSON).withVersion(1)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsDeleteSamples.java new file mode 100644 index 0000000000000..435fbdc7d3676 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsDeleteSamples.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.generated; + +/** + * Samples for FlowLogs Delete. + */ +public final class FlowLogsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogDelete. + * json + */ + /** + * Sample code: Delete flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs().delete("rg1", "nw1", "fl", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsGetSamples.java new file mode 100644 index 0000000000000..0f941e46c5bf6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for FlowLogs Get. + */ +public final class FlowLogsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogGet.json + */ + /** + * Sample code: Get flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs().getWithResponse("rg1", "nw1", "flowLog1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsListSamples.java new file mode 100644 index 0000000000000..f3494bf056a3e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsListSamples.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.generated; + +/** + * Samples for FlowLogs List. + */ +public final class FlowLogsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherFlowLogList. + * json + */ + /** + * Sample code: List connection monitors. + * + * @param manager Entry point to NetworkManager. + */ + public static void listConnectionMonitors(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.flowLogs().list("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsUpdateTagsSamples.java new file mode 100644 index 0000000000000..d33d2bd5c464a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/FlowLogsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.FlowLog; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FlowLogs UpdateTags. + */ +public final class FlowLogsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherFlowLogUpdateTags.json + */ + /** + * Sample code: Update flow log tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateFlowLogTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + FlowLog resource + = manager.flowLogs().getWithResponse("rg1", "nw", "fl", com.azure.core.util.Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..dc7585bd8cbe6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.HubRoute; +import java.util.Arrays; + +/** + * Samples for HubRouteTables CreateOrUpdate. + */ +public final class HubRouteTablesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTablePut.json + */ + /** + * Sample code: RouteTablePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTablePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables() + .define("hubRouteTable1") + .withExistingVirtualHub("rg1", "virtualHub1") + .withRoutes(Arrays.asList(new HubRoute().withName("route1") + .withDestinationType("CIDR") + .withDestinations(Arrays.asList("10.0.0.0/8", "20.0.0.0/8", "30.0.0.0/8")) + .withNextHopType("ResourceId") + .withNextHop( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azureFirewall1"))) + .withLabels(Arrays.asList("label1", "label2")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesDeleteSamples.java new file mode 100644 index 0000000000000..17b8e711a69c7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for HubRouteTables Delete. + */ +public final class HubRouteTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTableDelete.json + */ + /** + * Sample code: RouteTableDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables().delete("rg1", "virtualHub1", "hubRouteTable1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesGetSamples.java new file mode 100644 index 0000000000000..3d7b2f73f00bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesGetSamples.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.generated; + +/** + * Samples for HubRouteTables Get. + */ +public final class HubRouteTablesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTableGet.json + */ + /** + * Sample code: RouteTableGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables() + .getWithResponse("rg1", "virtualHub1", "hubRouteTable1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesListSamples.java new file mode 100644 index 0000000000000..24370e53315b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubRouteTablesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for HubRouteTables List. + */ +public final class HubRouteTablesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/HubRouteTableList.json + */ + /** + * Sample code: RouteTableList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubRouteTables().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..fa2394b5a23d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.HubVirtualNetworkConnectionInner; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.StaticRoute; +import com.azure.resourcemanager.network.generated.models.StaticRoutesConfig; +import com.azure.resourcemanager.network.generated.models.VnetLocalRouteOverrideCriteria; +import com.azure.resourcemanager.network.generated.models.VnetRoute; +import java.util.Arrays; + +/** + * Samples for HubVirtualNetworkConnections CreateOrUpdate. + */ +public final class HubVirtualNetworkConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionPut.json + */ + /** + * Sample code: HubVirtualNetworkConnectionPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections() + .createOrUpdate("rg1", "virtualHub1", "connection1", new HubVirtualNetworkConnectionInner() + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/SpokeVnet1")) + .withEnableInternetSecurity(false) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")))) + .withVnetRoutes(new VnetRoute() + .withStaticRoutesConfig(new StaticRoutesConfig() + .withVnetLocalRouteOverrideCriteria(VnetLocalRouteOverrideCriteria.EQUAL)) + .withStaticRoutes(Arrays.asList( + new StaticRoute().withName("route1") + .withAddressPrefixes(Arrays.asList("10.1.0.0/16", "10.2.0.0/16")) + .withNextHopIpAddress("10.0.0.68"), + new StaticRoute().withName("route2") + .withAddressPrefixes(Arrays.asList("10.3.0.0/16", "10.4.0.0/16")) + .withNextHopIpAddress("10.0.0.65")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..f2eddc8be36e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsDeleteSamples.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.generated; + +/** + * Samples for HubVirtualNetworkConnections Delete. + */ +public final class HubVirtualNetworkConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionDelete.json + */ + /** + * Sample code: HubVirtualNetworkConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections() + .delete("rg1", "virtualHub1", "connection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsGetSamples.java new file mode 100644 index 0000000000000..e4f4a0cd23557 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsGetSamples.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.generated; + +/** + * Samples for HubVirtualNetworkConnections Get. + */ +public final class HubVirtualNetworkConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionGet.json + */ + /** + * Sample code: HubVirtualNetworkConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections() + .getWithResponse("rg1", "virtualHub1", "connection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsListSamples.java new file mode 100644 index 0000000000000..17df8134984bb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/HubVirtualNetworkConnectionsListSamples.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.generated; + +/** + * Samples for HubVirtualNetworkConnections List. + */ +public final class HubVirtualNetworkConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * HubVirtualNetworkConnectionList.json + */ + /** + * Sample code: HubVirtualNetworkConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + hubVirtualNetworkConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.hubVirtualNetworkConnections().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5bde8a6053ce5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; + +/** + * Samples for InboundNatRules CreateOrUpdate. + */ +public final class InboundNatRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleCreate.json + */ + /** + * Sample code: InboundNatRuleCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules() + .define("natRule1.1") + .withExistingLoadBalancer("testrg", "lb1") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/ip1")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3390) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(4) + .withEnableFloatingIp(false) + .withEnableTcpReset(false) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesDeleteSamples.java new file mode 100644 index 0000000000000..25c36e0cc2b7d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for InboundNatRules Delete. + */ +public final class InboundNatRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleDelete.json + */ + /** + * Sample code: InboundNatRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules().delete("testrg", "lb1", "natRule1.1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesGetSamples.java new file mode 100644 index 0000000000000..ce460b76c5a2a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesGetSamples.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.generated; + +/** + * Samples for InboundNatRules Get. + */ +public final class InboundNatRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleGet.json + */ + /** + * Sample code: InboundNatRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules() + .getWithResponse("testrg", "lb1", "natRule1.1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesListSamples.java new file mode 100644 index 0000000000000..3c98d30890e82 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundNatRulesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for InboundNatRules List. + */ +public final class InboundNatRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundNatRuleList.json + */ + /** + * Sample code: InboundNatRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundNatRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundNatRules().list("testrg", "lb1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b11543f969a38 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.InboundSecurityRuleType; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRules; +import com.azure.resourcemanager.network.generated.models.InboundSecurityRulesProtocol; +import java.util.Arrays; + +/** + * Samples for InboundSecurityRuleOperation CreateOrUpdate. + */ +public final class InboundSecurityRuleOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundSecurityRulePut.json + */ + /** + * Sample code: Create Network Virtual Appliance Inbound Security Rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkVirtualApplianceInboundSecurityRules( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundSecurityRuleOperations() + .define("rule1") + .withExistingNetworkVirtualAppliance("rg1", "nva") + .withRuleType(InboundSecurityRuleType.PERMANENT) + .withRules(Arrays.asList(new InboundSecurityRules().withName("inboundRule1") + .withProtocol(InboundSecurityRulesProtocol.TCP) + .withSourceAddressPrefix("50.20.121.5/32") + .withDestinationPortRange(22) + .withDestinationPortRanges(Arrays.asList("80-100")) + .withAppliesOn(Arrays.asList("slbip1")))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationGetSamples.java new file mode 100644 index 0000000000000..40feed79aba20 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/InboundSecurityRuleOperationGetSamples.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.generated; + +/** + * Samples for InboundSecurityRuleOperation Get. + */ +public final class InboundSecurityRuleOperationGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/InboundSecurityRuleGet.json + */ + /** + * Sample code: Create Network Virtual Appliance Inbound Security Rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkVirtualApplianceInboundSecurityRules( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.inboundSecurityRuleOperations() + .getWithResponse("rg1", "nva", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e2e976835c0d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.IpAllocationType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpAllocations CreateOrUpdate. + */ +public final class IpAllocationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationCreate.json + */ + /** + * Sample code: Create IpAllocation. + * + * @param manager Entry point to NetworkManager. + */ + public static void createIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations() + .define("test-ipallocation") + .withRegion("centraluseuap") + .withExistingResourceGroup("rg1") + .withTypePropertiesType(IpAllocationType.HYPERNET) + .withPrefix("3.2.5.0/24") + .withAllocationTags(mapOf("VNetID", + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsDeleteSamples.java new file mode 100644 index 0000000000000..97da57972d3a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for IpAllocations Delete. + */ +public final class IpAllocationsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationDelete.json + */ + /** + * Sample code: Delete IpAllocation. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations().delete("rg1", "test-ipallocation", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..a29d3f8a2a53c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsGetByResourceGroupSamples.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.generated; + +/** + * Samples for IpAllocations GetByResourceGroup. + */ +public final class IpAllocationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationGet.json + */ + /** + * Sample code: Get IpAllocation. + * + * @param manager Entry point to NetworkManager. + */ + public static void getIpAllocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations() + .getByResourceGroupWithResponse("rg1", "test-ipallocation", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..80d441b9370e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListByResourceGroupSamples.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.generated; + +/** + * Samples for IpAllocations ListByResourceGroup. + */ +public final class IpAllocationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * IpAllocationListByResourceGroup.json + */ + /** + * Sample code: List IpAllocations in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listIpAllocationsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListSamples.java new file mode 100644 index 0000000000000..843895218c5f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for IpAllocations List. + */ +public final class IpAllocationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationList.json + */ + /** + * Sample code: List all IpAllocations. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllIpAllocations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipAllocations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsUpdateTagsSamples.java new file mode 100644 index 0000000000000..7d12e194571ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpAllocationsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.IpAllocation; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpAllocations UpdateTags. + */ +public final class IpAllocationsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpAllocationUpdateTags.json + */ + /** + * Sample code: Update virtual network tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + IpAllocation resource = manager.ipAllocations() + .getByResourceGroupWithResponse("rg1", "test-ipallocation", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..8309add07ace7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsCreateOrUpdateSamples.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.generated; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpGroups CreateOrUpdate. + */ +public final class IpGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsCreate.json + */ + /** + * Sample code: CreateOrUpdate_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups() + .define("ipGroups1") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIpAddresses(Arrays.asList("13.64.39.16/32", "40.74.146.80/31", "40.74.147.32/28")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsDeleteSamples.java new file mode 100644 index 0000000000000..08f2fcde715a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for IpGroups Delete. + */ +public final class IpGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsDelete.json + */ + /** + * Sample code: Delete_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups().delete("myResourceGroup", "ipGroups1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..4d73cf0023f2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsGetByResourceGroupSamples.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.generated; + +/** + * Samples for IpGroups GetByResourceGroup. + */ +public final class IpGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsGet.json + */ + /** + * Sample code: Get_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void getIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups() + .getByResourceGroupWithResponse("myResourceGroup", "ipGroups1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..b499c5b255c55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListByResourceGroupSamples.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.generated; + +/** + * Samples for IpGroups ListByResourceGroup. + */ +public final class IpGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsListByResourceGroup. + * json + */ + /** + * Sample code: ListByResourceGroup_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void listByResourceGroupIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListSamples.java new file mode 100644 index 0000000000000..fcdd08b68bba1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsListSamples.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.generated; + +/** + * Samples for IpGroups List. + */ +public final class IpGroupsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsListBySubscription. + * json + */ + /** + * Sample code: List_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void listIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.ipGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsUpdateGroupsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsUpdateGroupsSamples.java new file mode 100644 index 0000000000000..fcdacd04babf7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/IpGroupsUpdateGroupsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.IpGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IpGroups UpdateGroups. + */ +public final class IpGroupsUpdateGroupsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/IpGroupsUpdateTags.json + */ + /** + * Sample code: Update_IpGroups. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateIpGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + IpGroup resource = manager.ipGroups() + .getByResourceGroupWithResponse("myResourceGroup", "ipGroups1", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..754fd670f4537 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.BackendAddressPool; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import java.util.Arrays; + +/** + * Samples for LoadBalancerBackendAddressPools CreateOrUpdate. + */ +public final class LoadBalancerBackendAddressPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LBBackendAddressPoolWithBackendAddressesPut.json + */ + /** + * Sample code: Update load balancer backend pool with backend addresses containing virtual network and IP address. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateLoadBalancerBackendPoolWithBackendAddressesContainingVirtualNetworkAndIPAddress( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + BackendAddressPool resource = manager.loadBalancerBackendAddressPools() + .getWithResponse("testrg", "lb", "backend", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withLoadBalancerBackendAddresses(Arrays.asList( + new LoadBalancerBackendAddress().withName("address1") + .withVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb")) + .withIpAddress("10.0.0.4"), + new LoadBalancerBackendAddress().withName("address2") + .withVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb")) + .withIpAddress("10.0.0.5"))) + .apply(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsDeleteSamples.java new file mode 100644 index 0000000000000..8347a6897e194 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for LoadBalancerBackendAddressPools Delete. + */ +public final class LoadBalancerBackendAddressPoolsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerBackendAddressPoolDelete.json + */ + /** + * Sample code: BackendAddressPoolDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void backendAddressPoolDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools().delete("testrg", "lb", "backend", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsGetSamples.java new file mode 100644 index 0000000000000..5f92e558b842a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsGetSamples.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.generated; + +/** + * Samples for LoadBalancerBackendAddressPools Get. + */ +public final class LoadBalancerBackendAddressPoolsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerBackendAddressPoolGet.json + */ + /** + * Sample code: LoadBalancerBackendAddressPoolGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerBackendAddressPoolGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools() + .getWithResponse("testrg", "lb", "backend", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LBBackendAddressPoolWithBackendAddressesGet.json + */ + /** + * Sample code: LoadBalancer with BackendAddressPool with BackendAddresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerWithBackendAddressPoolWithBackendAddresses( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools() + .getWithResponse("testrg", "lb", "backend", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsListSamples.java new file mode 100644 index 0000000000000..ceb9d6da8494c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerBackendAddressPoolsListSamples.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.generated; + +/** + * Samples for LoadBalancerBackendAddressPools List. + */ +public final class LoadBalancerBackendAddressPoolsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LBBackendAddressPoolListWithBackendAddressesPoolType.json + */ + /** + * Sample code: Load balancer with BackendAddressPool containing BackendAddresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerWithBackendAddressPoolContainingBackendAddresses( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools().list("testrg", "lb", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerBackendAddressPoolList.json + */ + /** + * Sample code: LoadBalancerBackendAddressPoolList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerBackendAddressPoolList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerBackendAddressPools().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsGetSamples.java new file mode 100644 index 0000000000000..232ddad6dbe3d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsGetSamples.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.generated; + +/** + * Samples for LoadBalancerFrontendIpConfigurations Get. + */ +public final class LoadBalancerFrontendIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerFrontendIPConfigurationGet.json + */ + /** + * Sample code: LoadBalancerFrontendIPConfigurationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerFrontendIPConfigurationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerFrontendIpConfigurations() + .getWithResponse("testrg", "lb", "frontend", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsListSamples.java new file mode 100644 index 0000000000000..db50356320b3b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerFrontendIpConfigurationsListSamples.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.generated; + +/** + * Samples for LoadBalancerFrontendIpConfigurations List. + */ +public final class LoadBalancerFrontendIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerFrontendIPConfigurationList.json + */ + /** + * Sample code: LoadBalancerFrontendIPConfigurationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerFrontendIPConfigurationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerFrontendIpConfigurations().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesGetSamples.java new file mode 100644 index 0000000000000..ecf739055bf21 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesGetSamples.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.generated; + +/** + * Samples for LoadBalancerLoadBalancingRules Get. + */ +public final class LoadBalancerLoadBalancingRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerLoadBalancingRuleGet.json + */ + /** + * Sample code: LoadBalancerLoadBalancingRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerLoadBalancingRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerLoadBalancingRules() + .getWithResponse("testrg", "lb1", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesListSamples.java new file mode 100644 index 0000000000000..bfb14b68dcbd4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerLoadBalancingRulesListSamples.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.generated; + +/** + * Samples for LoadBalancerLoadBalancingRules List. + */ +public final class LoadBalancerLoadBalancingRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerLoadBalancingRuleList.json + */ + /** + * Sample code: LoadBalancerLoadBalancingRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerLoadBalancingRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerLoadBalancingRules().list("testrg", "lb1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerNetworkInterfacesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerNetworkInterfacesListSamples.java new file mode 100644 index 0000000000000..91eed142ca0a0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerNetworkInterfacesListSamples.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.generated; + +/** + * Samples for LoadBalancerNetworkInterfaces List. + */ +public final class LoadBalancerNetworkInterfacesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerNetworkInterfaceListVmss.json + */ + /** + * Sample code: LoadBalancerNetworkInterfaceListVmss. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerNetworkInterfaceListVmss(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerNetworkInterfaces().list("testrg", "lb", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerNetworkInterfaceListSimple.json + */ + /** + * Sample code: LoadBalancerNetworkInterfaceListSimple. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerNetworkInterfaceListSimple(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerNetworkInterfaces().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesGetSamples.java new file mode 100644 index 0000000000000..033f2848cbb4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesGetSamples.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.generated; + +/** + * Samples for LoadBalancerOutboundRules Get. + */ +public final class LoadBalancerOutboundRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerOutboundRuleGet. + * json + */ + /** + * Sample code: LoadBalancerOutboundRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerOutboundRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerOutboundRules().getWithResponse("testrg", "lb1", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesListSamples.java new file mode 100644 index 0000000000000..2e7170dfed706 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerOutboundRulesListSamples.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.generated; + +/** + * Samples for LoadBalancerOutboundRules List. + */ +public final class LoadBalancerOutboundRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerOutboundRuleList. + * json + */ + /** + * Sample code: LoadBalancerOutboundRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + loadBalancerOutboundRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerOutboundRules().list("testrg", "lb1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesGetSamples.java new file mode 100644 index 0000000000000..d17c1f4f0aa07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for LoadBalancerProbes Get. + */ +public final class LoadBalancerProbesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerProbeGet.json + */ + /** + * Sample code: LoadBalancerProbeGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerProbeGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerProbes().getWithResponse("testrg", "lb", "probe1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesListSamples.java new file mode 100644 index 0000000000000..55419fffb8990 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancerProbesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for LoadBalancerProbes List. + */ +public final class LoadBalancerProbesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerProbeList.json + */ + /** + * Sample code: LoadBalancerProbeList. + * + * @param manager Entry point to NetworkManager. + */ + public static void loadBalancerProbeList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancerProbes().list("testrg", "lb", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f43409b0e0b6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersCreateOrUpdateSamples.java @@ -0,0 +1,560 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.core.management.SubResource; +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.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.fluent.models.PublicIpAddressInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterface; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelInterfaceType; +import com.azure.resourcemanager.network.generated.models.GatewayLoadBalancerTunnelProtocol; +import com.azure.resourcemanager.network.generated.models.InboundNatPool; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.LoadBalancerBackendAddress; +import com.azure.resourcemanager.network.generated.models.LoadBalancerOutboundRuleProtocol; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSkuName; +import com.azure.resourcemanager.network.generated.models.LoadBalancerSkuTier; +import com.azure.resourcemanager.network.generated.models.LoadDistribution; +import com.azure.resourcemanager.network.generated.models.ProbeProtocol; +import com.azure.resourcemanager.network.generated.models.SyncMode; +import com.azure.resourcemanager.network.generated.models.TransportProtocol; +import java.util.Arrays; + +/** + * Samples for LoadBalancers CreateOrUpdate. + */ +public final class LoadBalancersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateWithSyncModePropertyOnPool.json + */ + /** + * Sample code: Create load balancer with Sync Mode Property on Pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithSyncModePropertyOnPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb") + .withVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb")) + .withSyncMode(SyncMode.AUTOMATIC))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateGatewayLoadBalancerProviderWithTwoBackendPool.json + */ + /** + * Sample code: Create load balancer with Gateway Load Balancer Provider configured with two Backend Pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.GATEWAY)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb1"), + new BackendAddressPoolInner().withName("be-lb2"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource()) + .withBackendAddressPools(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2"))) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.ALL) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(0) + .withBackendPort(0) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateWithInboundNatPool.json + */ + /** + * Sample code: Create load balancer with inbound nat pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithInboundNatPool(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test") + .withName("test") + .withZones(Arrays.asList()) + .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet")))) + .withBackendAddressPools(Arrays.asList()) + .withLoadBalancingRules(Arrays.asList()) + .withProbes(Arrays.asList()) + .withInboundNatRules(Arrays.asList()) + .withInboundNatPools(Arrays.asList(new InboundNatPool().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test") + .withName("test") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPortRangeStart(8080) + .withFrontendPortRangeEnd(8085) + .withBackendPort(8888) + .withIdleTimeoutInMinutes(10) + .withEnableFloatingIp(true) + .withEnableTcpReset(true))) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreateWithZones. + * json + */ + /** + * Sample code: Create load balancer with Frontend IP in Zone 1. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithFrontendIPInZone1(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withZones(Arrays.asList("1")) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateWithOutboundRules.json + */ + /** + * Sample code: Create load balancer with outbound rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithOutboundRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withPublicIpAddress(new PublicIpAddressInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true) + .withDisableOutboundSnat(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList(new OutboundRuleInner().withName("rule1") + .withFrontendIpConfigurations(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProtocol(LoadBalancerOutboundRuleProtocol.ALL))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateGatewayLoadBalancerProviderWithOneBackendPool.json + */ + /** + * Sample code: Create load balancer with Gateway Load Balancer Provider configured with one Backend Pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithOneBackendPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.GATEWAY)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb") + .withTunnelInterfaces(Arrays.asList( + new GatewayLoadBalancerTunnelInterface().withPort(15000) + .withIdentifier(900) + .withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN) + .withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL), + new GatewayLoadBalancerTunnelInterface().withPort(15001) + .withIdentifier(901) + .withProtocol(GatewayLoadBalancerTunnelProtocol.VXLAN) + .withType(GatewayLoadBalancerTunnelInterfaceType.INTERNAL))))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPools(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb"))) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.ALL) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(0) + .withBackendPort(0) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreate.json + */ + /** + * Sample code: Create load balancer. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true) + .withEnableTcpReset(false))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true) + .withEnableTcpReset(false))) + .withInboundNatPools(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreateGlobalTier. + * json + */ + /** + * Sample code: Create load balancer with Global Tier and one regional load balancer in its backend pool. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGlobalTierAndOneRegionalLoadBalancerInItsBackendPool( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD).withTier(LoadBalancerSkuTier.GLOBAL)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb") + .withLoadBalancerBackendAddresses(Arrays.asList(new LoadBalancerBackendAddress() + .withName("regional-lb1-address") + .withLoadBalancerFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb")))))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(false))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerCreateGatewayLoadBalancerConsumer.json + */ + /** + * Sample code: Create load balancer with Gateway Load Balancer Consumer configured. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLoadBalancerWithGatewayLoadBalancerConsumerConfigured( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")) + .withGatewayLoadBalancer(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerCreateStandardSku + * .json + */ + /** + * Sample code: Create load balancer with Standard SKU. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createLoadBalancerWithStandardSKU(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .define("lb") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new LoadBalancerSku().withName(LoadBalancerSkuName.STANDARD)) + .withFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withName("fe-lb") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")))) + .withBackendAddressPools(Arrays.asList(new BackendAddressPoolInner().withName("be-lb"))) + .withLoadBalancingRules(Arrays.asList(new LoadBalancingRuleInner().withName("rulelb") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withBackendAddressPool(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")) + .withProbe(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")) + .withProtocol(TransportProtocol.TCP) + .withLoadDistribution(LoadDistribution.DEFAULT) + .withFrontendPort(80) + .withBackendPort(80) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withProbes(Arrays.asList(new ProbeInner().withName("probe-lb") + .withProtocol(ProbeProtocol.HTTP) + .withPort(80) + .withIntervalInSeconds(15) + .withNumberOfProbes(2) + .withProbeThreshold(1) + .withRequestPath("healthcheck.aspx"))) + .withInboundNatRules(Arrays.asList(new InboundNatRuleInner().withName("in-nat-rule") + .withFrontendIpConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")) + .withProtocol(TransportProtocol.TCP) + .withFrontendPort(3389) + .withBackendPort(3389) + .withIdleTimeoutInMinutes(15) + .withEnableFloatingIp(true))) + .withInboundNatPools(Arrays.asList()) + .withOutboundRules(Arrays.asList()) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersDeleteSamples.java new file mode 100644 index 0000000000000..f0526e333fb88 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for LoadBalancers Delete. + */ +public final class LoadBalancersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerDelete.json + */ + /** + * Sample code: Delete load balancer. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().delete("rg1", "lb", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..6d6dfa255ba44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersGetByResourceGroupSamples.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.generated; + +/** + * Samples for LoadBalancers GetByResourceGroup. + */ +public final class LoadBalancersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerGet.json + */ + /** + * Sample code: Get load balancer. + * + * @param manager Entry point to NetworkManager. + */ + public static void getLoadBalancer(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().getByResourceGroupWithResponse("rg1", "lb", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancerGetInboundNatRulePortMapping.json + */ + /** + * Sample code: Get load balancer with inbound NAT rule port mapping. + * + * @param manager Entry point to NetworkManager. + */ + public static void getLoadBalancerWithInboundNATRulePortMapping( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().getByResourceGroupWithResponse("rg1", "lb", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..b30800e82006c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListByResourceGroupSamples.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.generated; + +/** + * Samples for LoadBalancers ListByResourceGroup. + */ +public final class LoadBalancersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerList.json + */ + /** + * Sample code: List load balancers in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listLoadBalancersInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListInboundNatRulePortMappingsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListInboundNatRulePortMappingsSamples.java new file mode 100644 index 0000000000000..1452cb443714c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListInboundNatRulePortMappingsSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.QueryInboundNatRulePortMappingRequest; + +/** + * Samples for LoadBalancers ListInboundNatRulePortMappings. + */ +public final class LoadBalancersListInboundNatRulePortMappingsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * QueryInboundNatRulePortMapping.json + */ + /** + * Sample code: Query inbound NAT rule port mapping. + * + * @param manager Entry point to NetworkManager. + */ + public static void + queryInboundNATRulePortMapping(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .listInboundNatRulePortMappings("rg1", "lb1", "bp1", + new QueryInboundNatRulePortMappingRequest().withIpAddress("10.0.0.4"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListSamples.java new file mode 100644 index 0000000000000..3b85b6e82ff70 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for LoadBalancers List. + */ +public final class LoadBalancersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerListAll.json + */ + /** + * Sample code: List all load balancers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllLoadBalancers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersMigrateToIpBasedSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersMigrateToIpBasedSamples.java new file mode 100644 index 0000000000000..a430a1f0d399a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersMigrateToIpBasedSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.MigrateLoadBalancerToIpBasedRequest; +import java.util.Arrays; + +/** + * Samples for LoadBalancers MigrateToIpBased. + */ +public final class LoadBalancersMigrateToIpBasedSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/MigrateLoadBalancerToIPBased. + * json + */ + /** + * Sample code: Migrate load balancer to IP Based. + * + * @param manager Entry point to NetworkManager. + */ + public static void + migrateLoadBalancerToIPBased(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .migrateToIpBasedWithResponse("rg1", "lb1", + new MigrateLoadBalancerToIpBasedRequest().withPools(Arrays.asList("pool1", "pool2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersSwapPublicIpAddressesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersSwapPublicIpAddressesSamples.java new file mode 100644 index 0000000000000..124caad7efc6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersSwapPublicIpAddressesSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequest; +import com.azure.resourcemanager.network.generated.models.LoadBalancerVipSwapRequestFrontendIpConfiguration; +import java.util.Arrays; + +/** + * Samples for LoadBalancers SwapPublicIpAddresses. + */ +public final class LoadBalancersSwapPublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * LoadBalancersSwapPublicIpAddresses.json + */ + /** + * Sample code: Swap VIPs between two load balancers. + * + * @param manager Entry point to NetworkManager. + */ + public static void + swapVIPsBetweenTwoLoadBalancers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.loadBalancers() + .swapPublicIpAddresses("westus", new LoadBalancerVipSwapRequest().withFrontendIpConfigurations( + Arrays.asList(new LoadBalancerVipSwapRequestFrontendIpConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb1/frontendIPConfigurations/lbfe1") + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/publicIPAddresses/pip2")), + new LoadBalancerVipSwapRequestFrontendIpConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/loadBalancers/lb2/frontendIPConfigurations/lbfe2") + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip1")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersUpdateTagsSamples.java new file mode 100644 index 0000000000000..0e8c7a02e66e3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LoadBalancersUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.LoadBalancer; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LoadBalancers UpdateTags. + */ +public final class LoadBalancersUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LoadBalancerUpdateTags.json + */ + /** + * Sample code: Update load balancer tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateLoadBalancerTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + LoadBalancer resource = manager.loadBalancers() + .getByResourceGroupWithResponse("rg1", "lb", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3fd7094ada239 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import java.util.Arrays; + +/** + * Samples for LocalNetworkGateways CreateOrUpdate. + */ +public final class LocalNetworkGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayCreate. + * json + */ + /** + * Sample code: CreateLocalNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void createLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways() + .define("localgw") + .withRegion("Central US") + .withExistingResourceGroup("rg1") + .withLocalNetworkAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.1.0.0/16"))) + .withGatewayIpAddress("11.12.13.14") + .withFqdn("site1.contoso.com") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysDeleteSamples.java new file mode 100644 index 0000000000000..401e5c8745242 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysDeleteSamples.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.generated; + +/** + * Samples for LocalNetworkGateways Delete. + */ +public final class LocalNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayDelete. + * json + */ + /** + * Sample code: DeleteLocalNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways().delete("rg1", "localgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..b8c560ca458c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysGetByResourceGroupSamples.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.generated; + +/** + * Samples for LocalNetworkGateways GetByResourceGroup. + */ +public final class LocalNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayGet.json + */ + /** + * Sample code: GetLocalNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getLocalNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways() + .getByResourceGroupWithResponse("rg1", "localgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..8cbea97497a24 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for LocalNetworkGateways ListByResourceGroup. + */ +public final class LocalNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayList.json + */ + /** + * Sample code: ListLocalNetworkGateways. + * + * @param manager Entry point to NetworkManager. + */ + public static void listLocalNetworkGateways(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.localNetworkGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysUpdateTagsSamples.java new file mode 100644 index 0000000000000..d57e20b0050f6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/LocalNetworkGatewaysUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.LocalNetworkGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LocalNetworkGateways UpdateTags. + */ +public final class LocalNetworkGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/LocalNetworkGatewayUpdateTags + * .json + */ + /** + * Sample code: UpdateLocalNetworkGatewayTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateLocalNetworkGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + LocalNetworkGateway resource = manager.localNetworkGateways() + .getByResourceGroupWithResponse("rg1", "lgw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..fe3bc2250b0f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerConnectionInner; + +/** + * Samples for ManagementGroupNetworkManagerConnections CreateOrUpdate. + */ +public final class ManagementGroupNetworkManagerConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupPut.json + */ + /** + * Sample code: Create or Update Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateManagementGroupNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .createOrUpdateWithResponse("managementGroupA", "TestNMConnection", + new NetworkManagerConnectionInner().withNetworkManagerId( + "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..495820117082e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsDeleteSamples.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.generated; + +/** + * Samples for ManagementGroupNetworkManagerConnections Delete. + */ +public final class ManagementGroupNetworkManagerConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupDelete.json + */ + /** + * Sample code: Delete Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteManagementGroupNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .deleteByResourceGroupWithResponse("managementGroupA", "TestNMConnection", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsGetSamples.java new file mode 100644 index 0000000000000..c170538d3c582 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsGetSamples.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.generated; + +/** + * Samples for ManagementGroupNetworkManagerConnections Get. + */ +public final class ManagementGroupNetworkManagerConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupGet.json + */ + /** + * Sample code: Get Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getManagementGroupNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .getWithResponse("managementGroupA", "TestNMConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsListSamples.java new file mode 100644 index 0000000000000..410178ca22880 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ManagementGroupNetworkManagerConnectionsListSamples.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.generated; + +/** + * Samples for ManagementGroupNetworkManagerConnections List. + */ +public final class ManagementGroupNetworkManagerConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionManagementGroupList.json + */ + /** + * Sample code: List Management Group Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void listManagementGroupNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.managementGroupNetworkManagerConnections() + .list("managementGroupA", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..867fcf878ee5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.NatGatewaySku; +import com.azure.resourcemanager.network.generated.models.NatGatewaySkuName; +import java.util.Arrays; + +/** + * Samples for NatGateways CreateOrUpdate. + */ +public final class NatGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayCreateOrUpdate.json + */ + /** + * Sample code: Create nat gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways() + .define("test-natgateway") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new NatGatewaySku().withName(NatGatewaySkuName.STANDARD)) + .withPublicIpAddresses(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/PublicIpAddress1"))) + .withPublicIpPrefixes(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPPrefixes/PublicIpPrefix1"))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysDeleteSamples.java new file mode 100644 index 0000000000000..fef04ecab9e79 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NatGateways Delete. + */ +public final class NatGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayDelete.json + */ + /** + * Sample code: Delete nat gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways().delete("rg1", "test-natGateway", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..fd49fcd5f920b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysGetByResourceGroupSamples.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.generated; + +/** + * Samples for NatGateways GetByResourceGroup. + */ +public final class NatGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayGet.json + */ + /** + * Sample code: Get nat gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNatGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways() + .getByResourceGroupWithResponse("rg1", "test-natGateway", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..339be97e01ada --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListByResourceGroupSamples.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.generated; + +/** + * Samples for NatGateways ListByResourceGroup. + */ +public final class NatGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayList.json + */ + /** + * Sample code: List nat gateways in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNatGatewaysInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListSamples.java new file mode 100644 index 0000000000000..67afd4f990109 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NatGateways List. + */ +public final class NatGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayListAll.json + */ + /** + * Sample code: List all nat gateways. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNatGateways(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natGateways().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysUpdateTagsSamples.java new file mode 100644 index 0000000000000..a3760a881dc1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatGatewaysUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NatGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NatGateways UpdateTags. + */ +public final class NatGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatGatewayUpdateTags.json + */ + /** + * Sample code: Update nat gateway tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNatGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NatGateway resource = manager.natGateways() + .getByResourceGroupWithResponse("rg1", "test-natGateway", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..1e0113c8fd214 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesCreateOrUpdateSamples.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.generated; + +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.Arrays; + +/** + * Samples for NatRules CreateOrUpdate. + */ +public final class NatRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRulePut.json + */ + /** + * Sample code: NatRulePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRulePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules() + .define("natRule1") + .withExistingVpnGateway("rg1", "gateway1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.4.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.21.0/24"))) + .withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/cloudnet1-VNG/ipConfigurations/default") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesDeleteSamples.java new file mode 100644 index 0000000000000..f7f52ce5834fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NatRules Delete. + */ +public final class NatRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRuleDelete.json + */ + /** + * Sample code: NatRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules().delete("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesGetSamples.java new file mode 100644 index 0000000000000..40e4de46b9240 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NatRules Get. + */ +public final class NatRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRuleGet.json + */ + /** + * Sample code: NatRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules().getWithResponse("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesListByVpnGatewaySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesListByVpnGatewaySamples.java new file mode 100644 index 0000000000000..f139e3c52d47e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NatRulesListByVpnGatewaySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NatRules ListByVpnGateway. + */ +public final class NatRulesListByVpnGatewaySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NatRuleList.json + */ + /** + * Sample code: NatRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void natRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.natRules().listByVpnGateway("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..157a569767fa0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.GroupMemberType; + +/** + * Samples for NetworkGroups CreateOrUpdate. + */ +public final class NetworkGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupPut.json + */ + /** + * Sample code: NetworkGroupsPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups() + .define("testNetworkGroup") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample group") + .withMemberType(GroupMemberType.VIRTUAL_NETWORK) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsDeleteSamples.java new file mode 100644 index 0000000000000..2770b0e463de4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsDeleteSamples.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.generated; + +/** + * Samples for NetworkGroups Delete. + */ +public final class NetworkGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupDelete. + * json + */ + /** + * Sample code: NetworkGroupsDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups() + .delete("rg1", "testNetworkManager", "testNetworkGroup", false, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsGetSamples.java new file mode 100644 index 0000000000000..42e0d84498fa9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsGetSamples.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.generated; + +/** + * Samples for NetworkGroups Get. + */ +public final class NetworkGroupsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupGet.json + */ + /** + * Sample code: NetworkGroupsGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups() + .getWithResponse("rg1", "testNetworkManager", "testNetworkGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsListSamples.java new file mode 100644 index 0000000000000..1b131ed615c1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkGroupsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkGroups List. + */ +public final class NetworkGroupsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGroupList.json + */ + /** + * Sample code: NetworkGroupsList. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkGroupsList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkGroups().list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsGetSamples.java new file mode 100644 index 0000000000000..73e59062e9c95 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsGetSamples.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.generated; + +/** + * Samples for NetworkInterfaceIpConfigurations Get. + */ +public final class NetworkInterfaceIpConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceIPConfigurationGet.json + */ + /** + * Sample code: NetworkInterfaceIPConfigurationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkInterfaceIPConfigurationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceIpConfigurations() + .getWithResponse("testrg", "mynic", "ipconfig1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsListSamples.java new file mode 100644 index 0000000000000..10f43b67c22ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceIpConfigurationsListSamples.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.generated; + +/** + * Samples for NetworkInterfaceIpConfigurations List. + */ +public final class NetworkInterfaceIpConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceIPConfigurationList.json + */ + /** + * Sample code: NetworkInterfaceIPConfigurationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkInterfaceIPConfigurationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceIpConfigurations().list("testrg", "nic1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceLoadBalancersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceLoadBalancersListSamples.java new file mode 100644 index 0000000000000..c8dde6370d7fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceLoadBalancersListSamples.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.generated; + +/** + * Samples for NetworkInterfaceLoadBalancers List. + */ +public final class NetworkInterfaceLoadBalancersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceLoadBalancerList.json + */ + /** + * Sample code: NetworkInterfaceLoadBalancerList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkInterfaceLoadBalancerList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceLoadBalancers().list("testrg", "nic1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b292710cc62c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkTapInner; + +/** + * Samples for NetworkInterfaceTapConfigurations CreateOrUpdate. + */ +public final class NetworkInterfaceTapConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationCreate.json + */ + /** + * Sample code: Create Network Interface Tap Configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkInterfaceTapConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations() + .define("tapconfiguration1") + .withExistingNetworkInterface("testrg", "mynic") + .withVirtualNetworkTap(new VirtualNetworkTapInner().withId( + "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworkTaps/testvtap")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..dc03d7beaa0e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsDeleteSamples.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.generated; + +/** + * Samples for NetworkInterfaceTapConfigurations Delete. + */ +public final class NetworkInterfaceTapConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationDelete.json + */ + /** + * Sample code: Delete tap configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteTapConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations() + .delete("testrg", "mynic", "tapconfiguration1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsGetSamples.java new file mode 100644 index 0000000000000..de71285d67c2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsGetSamples.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.generated; + +/** + * Samples for NetworkInterfaceTapConfigurations Get. + */ +public final class NetworkInterfaceTapConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationGet.json + */ + /** + * Sample code: Get Network Interface Tap Configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getNetworkInterfaceTapConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations() + .getWithResponse("testrg", "mynic", "tapconfiguration1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsListSamples.java new file mode 100644 index 0000000000000..051ac0ba8586c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfaceTapConfigurationsListSamples.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.generated; + +/** + * Samples for NetworkInterfaceTapConfigurations List. + */ +public final class NetworkInterfaceTapConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceTapConfigurationList.json + */ + /** + * Sample code: List virtual network tap configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworkTapConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaceTapConfigurations().list("testrg", "mynic", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..66f3296b812e9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +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 java.util.Arrays; + +/** + * Samples for NetworkInterfaces CreateOrUpdate. + */ +public final class NetworkInterfacesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceCreateGatewayLoadBalancerConsumer.json + */ + /** + * Sample code: Create network interface with Gateway Load Balancer Consumer configured. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkInterfaceWithGatewayLoadBalancerConsumerConfigured( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .define("test-nic") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new NetworkInterfaceIpConfigurationInner().withName("ipconfig1") + .withGatewayLoadBalancer(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider")) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default")) + .withPublicIpAddress(new PublicIpAddressInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip")))) + .withEnableAcceleratedNetworking(true) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceCreate.json + */ + /** + * Sample code: Create network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .define("test-nic") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new NetworkInterfaceIpConfigurationInner().withName("ipconfig1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/rg1-vnet/subnets/default")) + .withPublicIpAddress(new PublicIpAddressInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/test-ip")), + new NetworkInterfaceIpConfigurationInner().withName("ipconfig2").withPrivateIpAddressPrefixLength(28))) + .withEnableAcceleratedNetworking(true) + .withDisableTcpStateTracking(true) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesDeleteSamples.java new file mode 100644 index 0000000000000..47fc096ddf9af --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkInterfaces Delete. + */ +public final class NetworkInterfacesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceDelete.json + */ + /** + * Sample code: Delete network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().delete("rg1", "test-nic", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..738c558edcd7a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkInterfaces GetByResourceGroup. + */ +public final class NetworkInterfacesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceGet.json + */ + /** + * Sample code: Get network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getByResourceGroupWithResponse("rg1", "test-nic", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetCloudServiceNetworkInterfaceSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetCloudServiceNetworkInterfaceSamples.java new file mode 100644 index 0000000000000..50dcfedd43deb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetCloudServiceNetworkInterfaceSamples.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.generated; + +/** + * Samples for NetworkInterfaces GetCloudServiceNetworkInterface. + */ +public final class NetworkInterfacesGetCloudServiceNetworkInterfaceSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceNetworkInterfaceGet.json + */ + /** + * Sample code: Get cloud service network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getCloudServiceNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getCloudServiceNetworkInterfaceWithResponse("rg1", "cs1", "TestVMRole_IN_0", "nic1", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetEffectiveRouteTableSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetEffectiveRouteTableSamples.java new file mode 100644 index 0000000000000..10406e13eed8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetEffectiveRouteTableSamples.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.generated; + +/** + * Samples for NetworkInterfaces GetEffectiveRouteTable. + */ +public final class NetworkInterfacesGetEffectiveRouteTableSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceEffectiveRouteTableList.json + */ + /** + * Sample code: Show network interface effective route tables. + * + * @param manager Entry point to NetworkManager. + */ + public static void + showNetworkInterfaceEffectiveRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().getEffectiveRouteTable("rg1", "nic1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples.java new file mode 100644 index 0000000000000..16333a6520921 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples.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.generated; + +/** + * Samples for NetworkInterfaces GetVirtualMachineScaleSetIpConfiguration. + */ +public final class NetworkInterfacesGetVirtualMachineScaleSetIpConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VmssNetworkInterfaceIpConfigGet.json + */ + /** + * Sample code: Get virtual machine scale set network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualMachineScaleSetNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getVirtualMachineScaleSetIpConfigurationWithResponse("rg1", "vmss1", "2", "nic1", "ip1", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples.java new file mode 100644 index 0000000000000..d6dddcc69083c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples.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.generated; + +/** + * Samples for NetworkInterfaces GetVirtualMachineScaleSetNetworkInterface. + */ +public final class NetworkInterfacesGetVirtualMachineScaleSetNetworkInterfaceSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssNetworkInterfaceGet.json + */ + /** + * Sample code: Get virtual machine scale set network interface. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualMachineScaleSetNetworkInterface(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .getVirtualMachineScaleSetNetworkInterfaceWithResponse("rg1", "vmss1", "1", "nic1", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0cf88ba1920e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkInterfaces ListByResourceGroup. + */ +public final class NetworkInterfacesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceList.json + */ + /** + * Sample code: List network interfaces in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNetworkInterfacesInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceNetworkInterfacesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceNetworkInterfacesSamples.java new file mode 100644 index 0000000000000..2b52f9d22f0e6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceNetworkInterfacesSamples.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.generated; + +/** + * Samples for NetworkInterfaces ListCloudServiceNetworkInterfaces. + */ +public final class NetworkInterfacesListCloudServiceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceNetworkInterfaceList.json + */ + /** + * Sample code: List cloud service network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listCloudServiceNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().listCloudServiceNetworkInterfaces("rg1", "cs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples.java new file mode 100644 index 0000000000000..07593a5fa85b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples.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.generated; + +/** + * Samples for NetworkInterfaces ListCloudServiceRoleInstanceNetworkInterfaces. + */ +public final class NetworkInterfacesListCloudServiceRoleInstanceNetworkInterfacesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceRoleInstanceNetworkInterfaceList.json + */ + /** + * Sample code: List cloud service role instance network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listCloudServiceRoleInstanceNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listCloudServiceRoleInstanceNetworkInterfaces("rg1", "cs1", "TestVMRole_IN_0", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples.java new file mode 100644 index 0000000000000..23af73675394b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples.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.generated; + +/** + * Samples for NetworkInterfaces ListEffectiveNetworkSecurityGroups. + */ +public final class NetworkInterfacesListEffectiveNetworkSecurityGroupsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkInterfaceEffectiveNSGList.json + */ + /** + * Sample code: List network interface effective network security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkInterfaceEffectiveNetworkSecurityGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().listEffectiveNetworkSecurityGroups("rg1", "nic1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListSamples.java new file mode 100644 index 0000000000000..1a919808d0947 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkInterfaces List. + */ +public final class NetworkInterfacesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceListAll.json + */ + /** + * Sample code: List all network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkInterfaces(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples.java new file mode 100644 index 0000000000000..5139f11a7d04f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples.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.generated; + +/** + * Samples for NetworkInterfaces ListVirtualMachineScaleSetIpConfigurations. + */ +public final class NetworkInterfacesListVirtualMachineScaleSetIpConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VmssNetworkInterfaceIpConfigList.json + */ + /** + * Sample code: List virtual machine scale set network interface ip configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualMachineScaleSetNetworkInterfaceIpConfigurations( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listVirtualMachineScaleSetIpConfigurations("rg1", "vmss1", "2", "nic1", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples.java new file mode 100644 index 0000000000000..efb4a05c08313 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples.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.generated; + +/** + * Samples for NetworkInterfaces ListVirtualMachineScaleSetNetworkInterfaces. + */ +public final class NetworkInterfacesListVirtualMachineScaleSetNetworkInterfacesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssNetworkInterfaceList.json + */ + /** + * Sample code: List virtual machine scale set network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualMachineScaleSetNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listVirtualMachineScaleSetNetworkInterfaces("rg1", "vmss1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples.java new file mode 100644 index 0000000000000..53cd906682513 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples.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.generated; + +/** + * Samples for NetworkInterfaces ListVirtualMachineScaleSetVMNetworkInterfaces. + */ +public final class NetworkInterfacesListVirtualMachineScaleSetVMNetworkInterfacesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssVmNetworkInterfaceList. + * json + */ + /** + * Sample code: List virtual machine scale set vm network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualMachineScaleSetVmNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkInterfaces() + .listVirtualMachineScaleSetVMNetworkInterfaces("rg1", "vmss1", "1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesUpdateTagsSamples.java new file mode 100644 index 0000000000000..dcd589a244abd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkInterfacesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkInterface; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkInterfaces UpdateTags. + */ +public final class NetworkInterfacesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkInterfaceUpdateTags. + * json + */ + /** + * Sample code: Update network interface tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNetworkInterfaceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkInterface resource = manager.networkInterfaces() + .getByResourceGroupWithResponse("rg1", "test-nic", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerCommitsPostSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerCommitsPostSamples.java new file mode 100644 index 0000000000000..cac26f4ee790a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerCommitsPostSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkManagerCommitInner; +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import java.util.Arrays; + +/** + * Samples for NetworkManagerCommits Post. + */ +public final class NetworkManagerCommitsPostSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerCommitPost.json + */ + /** + * Sample code: NetworkManageCommitPost. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManageCommitPost(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerCommits() + .post("resoureGroupSample", "testNetworkManager", new NetworkManagerCommitInner() + .withTargetLocations(Arrays.asList("useast")) + .withConfigurationIds(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resoureGroupSample/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/SampleSecurityAdminConfig")) + .withCommitType(ConfigurationType.SECURITY_ADMIN), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerDeploymentStatusOperationListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerDeploymentStatusOperationListSamples.java new file mode 100644 index 0000000000000..3f3c7b8bf5152 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerDeploymentStatusOperationListSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManagerDeploymentStatusParameter; +import java.util.Arrays; + +/** + * Samples for NetworkManagerDeploymentStatusOperation List. + */ +public final class NetworkManagerDeploymentStatusOperationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerDeploymentStatusList.json + */ + /** + * Sample code: NetworkManagerDeploymentStatusList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkManagerDeploymentStatusList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerDeploymentStatusOperations() + .listWithResponse("resoureGroupSample", "testNetworkManager", + new NetworkManagerDeploymentStatusParameter().withRegions(Arrays.asList("eastus", "westus")) + .withDeploymentTypes( + Arrays.asList(ConfigurationType.CONNECTIVITY, ConfigurationType.fromString("AdminPolicy"))) + .withSkipToken("fakeTokenPlaceholder"), + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a1a819fea91cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkManagerRoutingConfigurations CreateOrUpdate. + */ +public final class NetworkManagerRoutingConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationPut.json + */ + /** + * Sample code: Create network manager routing configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkManagerRoutingConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .define("myTestRoutingConfig") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample policy") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..5c121cb9772c6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsDeleteSamples.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.generated; + +/** + * Samples for NetworkManagerRoutingConfigurations Delete. + */ +public final class NetworkManagerRoutingConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationDelete.json + */ + /** + * Sample code: Delete network manager routing configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkManagerRoutingConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .delete("rg1", "testNetworkManager", "myTestRoutingConfig", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsGetSamples.java new file mode 100644 index 0000000000000..37990a4c867f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsGetSamples.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.generated; + +/** + * Samples for NetworkManagerRoutingConfigurations Get. + */ +public final class NetworkManagerRoutingConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationGet.json + */ + /** + * Sample code: Get routing configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRoutingConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .getWithResponse("rg1", "testNetworkManager", "myTestRoutingConfig", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsListSamples.java new file mode 100644 index 0000000000000..ff77017bedc03 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagerRoutingConfigurationsListSamples.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.generated; + +/** + * Samples for NetworkManagerRoutingConfigurations List. + */ +public final class NetworkManagerRoutingConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingConfigurationList.json + */ + /** + * Sample code: List routing configurations in a network manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listRoutingConfigurationsInANetworkManager(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagerRoutingConfigurations() + .list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..1ce6658ddeeb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ConfigurationType; +import com.azure.resourcemanager.network.generated.models.NetworkManagerPropertiesNetworkManagerScopes; +import java.util.Arrays; + +/** + * Samples for NetworkManagers CreateOrUpdate. + */ +public final class NetworkManagersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerPut.json + */ + /** + * Sample code: Put Network Manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void putNetworkManager(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers() + .define("TestNetworkManager") + .withRegion((String) null) + .withExistingResourceGroup("rg1") + .withDescription("My Test Network Manager") + .withNetworkManagerScopes(new NetworkManagerPropertiesNetworkManagerScopes() + .withManagementGroups(Arrays.asList("/Microsoft.Management/testmg")) + .withSubscriptions(Arrays.asList("/subscriptions/00000000-0000-0000-0000-000000000000"))) + .withNetworkManagerScopeAccesses(Arrays.asList(ConfigurationType.CONNECTIVITY)) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersDeleteSamples.java new file mode 100644 index 0000000000000..72d3d253a9f0c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkManagers Delete. + */ +public final class NetworkManagersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerDelete.json + */ + /** + * Sample code: NetworkManagersDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagersDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers().delete("rg1", "testNetworkManager", false, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..f9a45d8877b9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersGetByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkManagers GetByResourceGroup. + */ +public final class NetworkManagersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerGet.json + */ + /** + * Sample code: NetworkManagersGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagersGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers() + .getByResourceGroupWithResponse("rg1", "testNetworkManager", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..e8ef9b65d8ad4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkManagers ListByResourceGroup. + */ +public final class NetworkManagersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerList.json + */ + /** + * Sample code: List Network Manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkManager(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers().listByResourceGroup("rg1", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListSamples.java new file mode 100644 index 0000000000000..95acf6523d3f8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkManagers List. + */ +public final class NetworkManagersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerListAll.json + */ + /** + * Sample code: NetworkManagersList. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagersList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkManagers().list(null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersPatchSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersPatchSamples.java new file mode 100644 index 0000000000000..7e5bbb51c73ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkManagersPatchSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkManager; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkManagers Patch. + */ +public final class NetworkManagersPatchSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerPatch.json + */ + /** + * Sample code: NetworkManagesPatch. + * + * @param manager Entry point to NetworkManager. + */ + public static void networkManagesPatch(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkManager resource = manager.networkManagers() + .getByResourceGroupWithResponse("rg1", "testNetworkManager", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..99222a1c1bd2f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesCreateOrUpdateSamples.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.generated; + +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.ContainerNetworkInterfaceConfiguration; +import java.util.Arrays; + +/** + * Samples for NetworkProfiles CreateOrUpdate. + */ +public final class NetworkProfilesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkProfileCreateConfigOnly.json + */ + /** + * Sample code: Create network profile defaults. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkProfileDefaults(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles() + .define("networkProfile1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withContainerNetworkInterfaceConfigurations(Arrays.asList(new ContainerNetworkInterfaceConfiguration() + .withName("eth1") + .withIpConfigurations(Arrays.asList(new IpConfigurationProfileInner().withName("ipconfig1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/networkProfileVnet/subnets/networkProfileSubnet1")))))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesDeleteSamples.java new file mode 100644 index 0000000000000..3fdbfec86c7c8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkProfiles Delete. + */ +public final class NetworkProfilesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileDelete.json + */ + /** + * Sample code: Delete network profile. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles().delete("rg1", "networkProfile1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..3cc4e0079217f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesGetByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkProfiles GetByResourceGroup. + */ +public final class NetworkProfilesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkProfileGetWithContainerNic.json + */ + /** + * Sample code: Get network profile with container network interfaces. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkProfileWithContainerNetworkInterfaces( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles() + .getByResourceGroupWithResponse("rg1", "networkProfile1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileGetConfigOnly. + * json + */ + /** + * Sample code: Get network profile. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles() + .getByResourceGroupWithResponse("rg1", "networkProfile1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ac55ff359ae4f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkProfiles ListByResourceGroup. + */ +public final class NetworkProfilesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileList.json + */ + /** + * Sample code: List resource group network profiles. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupNetworkProfiles(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListSamples.java new file mode 100644 index 0000000000000..bc96b3423d92e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkProfiles List. + */ +public final class NetworkProfilesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileListAll.json + */ + /** + * Sample code: List all network profiles. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkProfiles(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkProfiles().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesUpdateTagsSamples.java new file mode 100644 index 0000000000000..a0dfe09e7677b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkProfilesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkProfile; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkProfiles UpdateTags. + */ +public final class NetworkProfilesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkProfileUpdateTags.json + */ + /** + * Sample code: Update network profile tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNetworkProfileTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkProfile resource = manager.networkProfiles() + .getByResourceGroupWithResponse("rg1", "test-np", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..096a32fe6e87b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.SecurityRuleInner; +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.Arrays; + +/** + * Samples for NetworkSecurityGroups CreateOrUpdate. + */ +public final class NetworkSecurityGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupCreateWithRule.json + */ + /** + * Sample code: Create network security group with rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkSecurityGroupWithRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups() + .define("testnsg") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSecurityRules(Arrays.asList(new SecurityRuleInner().withName("rule1") + .withProtocol(SecurityRuleProtocol.ASTERISK) + .withSourcePortRange("*") + .withDestinationPortRange("80") + .withSourceAddressPrefix("*") + .withDestinationAddressPrefix("*") + .withAccess(SecurityRuleAccess.ALLOW) + .withPriority(130) + .withDirection(SecurityRuleDirection.INBOUND))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupCreate. + * json + */ + /** + * Sample code: Create network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups() + .define("testnsg") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsDeleteSamples.java new file mode 100644 index 0000000000000..4bf16d645e621 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsDeleteSamples.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.generated; + +/** + * Samples for NetworkSecurityGroups Delete. + */ +public final class NetworkSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupDelete. + * json + */ + /** + * Sample code: Delete network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups().delete("rg1", "testnsg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..cf5f6d44d6376 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsGetByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkSecurityGroups GetByResourceGroup. + */ +public final class NetworkSecurityGroupsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupGet.json + */ + /** + * Sample code: Get network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkSecurityGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups() + .getByResourceGroupWithResponse("rg1", "testnsg", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..c3ada93f342b3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkSecurityGroups ListByResourceGroup. + */ +public final class NetworkSecurityGroupsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupList.json + */ + /** + * Sample code: List network security groups in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNetworkSecurityGroupsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListSamples.java new file mode 100644 index 0000000000000..c3222bfeef0a9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsListSamples.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.generated; + +/** + * Samples for NetworkSecurityGroups List. + */ +public final class NetworkSecurityGroupsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupListAll. + * json + */ + /** + * Sample code: List all network security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllNetworkSecurityGroups(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkSecurityGroups().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsUpdateTagsSamples.java new file mode 100644 index 0000000000000..fa2242db30660 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkSecurityGroupsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkSecurityGroup; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkSecurityGroups UpdateTags. + */ +public final class NetworkSecurityGroupsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupUpdateTags.json + */ + /** + * Sample code: Update network security group tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateNetworkSecurityGroupTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkSecurityGroup resource = manager.networkSecurityGroups() + .getByResourceGroupWithResponse("rg1", "testnsg", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..9d8d084d713c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.NetworkVirtualApplianceConnectionInner; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import java.util.Arrays; + +/** + * Samples for NetworkVirtualApplianceConnections CreateOrUpdate. + */ +public final class NetworkVirtualApplianceConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionPut.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections() + .createOrUpdate("rg1", "nva1", "connection1", new NetworkVirtualApplianceConnectionInner() + .withNamePropertiesName("connection1") + .withAsn(64512L) + .withTunnelIdentifier(0L) + .withBgpPeerAddress(Arrays.asList("169.254.16.13", "169.254.16.14")) + .withEnableInternetSecurity(false) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..082390af08f31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsDeleteSamples.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.generated; + +/** + * Samples for NetworkVirtualApplianceConnections Delete. + */ +public final class NetworkVirtualApplianceConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionDelete.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections() + .delete("rg1", "nva1", "connection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsGetSamples.java new file mode 100644 index 0000000000000..d8b601e3311d9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsGetSamples.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.generated; + +/** + * Samples for NetworkVirtualApplianceConnections Get. + */ +public final class NetworkVirtualApplianceConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionGet.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections() + .getWithResponse("rg1", "nva1", "connection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsListSamples.java new file mode 100644 index 0000000000000..aa71b254b2d55 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualApplianceConnectionsListSamples.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.generated; + +/** + * Samples for NetworkVirtualApplianceConnections List. + */ +public final class NetworkVirtualApplianceConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceConnectionList.json + */ + /** + * Sample code: NetworkVirtualApplianceConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualApplianceConnections().list("rg1", "nva1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..be8007cd20c32 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.DelegationProperties; +import com.azure.resourcemanager.network.generated.models.InternetIngressPublicIpsProperties; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliancePropertiesFormatNetworkProfile; +import com.azure.resourcemanager.network.generated.models.NicTypeInRequest; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceAdditionalNicProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceIpConfigurationProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNetworkInterfaceConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceNetworkInterfaceConfigurationProperties; +import com.azure.resourcemanager.network.generated.models.VirtualApplianceSkuProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkVirtualAppliances CreateOrUpdate. + */ +public final class NetworkVirtualAppliancesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSaaSPut.json + */ + /** + * Sample code: Create SaaS NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSaaSNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances() + .define("nva") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .withDelegation(new DelegationProperties().withServiceName("PaloAltoNetworks.Cloudngfw/firewalls")) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualAppliancePut. + * json + */ + /** + * Sample code: Create NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances() + .define("nva") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withNvaSku(new VirtualApplianceSkuProperties().withVendor("Cisco SDWAN") + .withBundledScaleUnit("1") + .withMarketPlaceVersion("12.1")) + .withBootStrapConfigurationBlobs( + Arrays.asList("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrbootstrapconfig")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .withCloudInitConfigurationBlobs( + Arrays.asList("https://csrncvhdstorage1.blob.core.windows.net/csrncvhdstoragecont/csrcloudinitconfig")) + .withVirtualApplianceAsn(10000L) + .withNetworkProfile( + new NetworkVirtualAppliancePropertiesFormatNetworkProfile() + .withNetworkInterfaceConfigurations( + Arrays + .asList( + new VirtualApplianceNetworkInterfaceConfiguration() + .withNicType(NicTypeInRequest.PUBLIC_NIC) + .withProperties( + new VirtualApplianceNetworkInterfaceConfigurationProperties() + .withIpConfigurations( + Arrays.asList( + new VirtualApplianceIpConfiguration().withName("publicnicipconfig") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(true)), + new VirtualApplianceIpConfiguration() + .withName("publicnicipconfig-2") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(false))))), + new VirtualApplianceNetworkInterfaceConfiguration() + .withNicType(NicTypeInRequest.PRIVATE_NIC) + .withProperties( + new VirtualApplianceNetworkInterfaceConfigurationProperties() + .withIpConfigurations(Arrays.asList( + new VirtualApplianceIpConfiguration().withName("privatenicipconfig") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(true)), + new VirtualApplianceIpConfiguration().withName("privatenicipconfig-2") + .withProperties(new VirtualApplianceIpConfigurationProperties() + .withPrimary(false)))))))) + .withAdditionalNics( + Arrays.asList(new VirtualApplianceAdditionalNicProperties().withName("exrsdwan").withHasPublicIp(true))) + .withInternetIngressPublicIps(Arrays.asList(new InternetIngressPublicIpsProperties().withId( + "/subscriptions/{{subscriptionId}}/resourceGroups/{{rg}}/providers/Microsoft.Network/publicIPAddresses/slbip"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesDeleteSamples.java new file mode 100644 index 0000000000000..2a59d41612d33 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesDeleteSamples.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.generated; + +/** + * Samples for NetworkVirtualAppliances Delete. + */ +public final class NetworkVirtualAppliancesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualApplianceDelete + * .json + */ + /** + * Sample code: Delete NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().delete("rg1", "nva", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..9e898d3d7bbba --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesGetByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkVirtualAppliances GetByResourceGroup. + */ +public final class NetworkVirtualAppliancesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualApplianceGet. + * json + */ + /** + * Sample code: Get NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances() + .getByResourceGroupWithResponse("rg1", "nva", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..f8dade895d757 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListByResourceGroupSamples.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.generated; + +/** + * Samples for NetworkVirtualAppliances ListByResourceGroup. + */ +public final class NetworkVirtualAppliancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceListByResourceGroup.json + */ + /** + * Sample code: List all Network Virtual Appliance for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkVirtualApplianceForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListSamples.java new file mode 100644 index 0000000000000..d6685f36f3200 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesListSamples.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.generated; + +/** + * Samples for NetworkVirtualAppliances List. + */ +public final class NetworkVirtualAppliancesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceListBySubscription.json + */ + /** + * Sample code: List all Network Virtual Appliances for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkVirtualAppliancesForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesRestartSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesRestartSamples.java new file mode 100644 index 0000000000000..4507dfee661f5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesRestartSamples.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.generated; + +/** + * Samples for NetworkVirtualAppliances Restart. + */ +public final class NetworkVirtualAppliancesRestartSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSpecificRestart.json + */ + /** + * Sample code: Restart Specific NetworkVirtualAppliance VMs in VM Scale Set. + * + * @param manager Entry point to NetworkManager. + */ + public static void restartSpecificNetworkVirtualApplianceVMsInVMScaleSet( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().restart("rg1", "nva", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceEmptyRestart.json + */ + /** + * Sample code: Restart All NetworkVirtualAppliance VMs in VM Scale Set. + * + * @param manager Entry point to NetworkManager. + */ + public static void restartAllNetworkVirtualApplianceVMsInVMScaleSet( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkVirtualAppliances().restart("rg1", "nva", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesUpdateTagsSamples.java new file mode 100644 index 0000000000000..9e32c39ff5df8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkVirtualAppliancesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkVirtualAppliance; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkVirtualAppliances UpdateTags. + */ +public final class NetworkVirtualAppliancesUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceUpdateTags.json + */ + /** + * Sample code: Update NetworkVirtualAppliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateNetworkVirtualAppliance(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkVirtualAppliance resource = manager.networkVirtualAppliances() + .getByResourceGroupWithResponse("rg1", "nva", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCheckConnectivitySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCheckConnectivitySamples.java new file mode 100644 index 0000000000000..40f6766b96f26 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCheckConnectivitySamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ConnectivityDestination; +import com.azure.resourcemanager.network.generated.models.ConnectivityParameters; +import com.azure.resourcemanager.network.generated.models.ConnectivitySource; +import com.azure.resourcemanager.network.generated.models.IpVersion; + +/** + * Samples for NetworkWatchers CheckConnectivity. + */ +public final class NetworkWatchersCheckConnectivitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherConnectivityCheck.json + */ + /** + * Sample code: Check connectivity. + * + * @param manager Entry point to NetworkManager. + */ + public static void checkConnectivity(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .checkConnectivity("rg1", "nw1", + new ConnectivityParameters() + .withSource(new ConnectivitySource().withResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1")) + .withDestination(new ConnectivityDestination().withAddress("192.168.100.4").withPort(3389)) + .withPreferredIpVersion(IpVersion.IPV4), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..df88cfaf284aa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersCreateOrUpdateSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkWatchers CreateOrUpdate. + */ +public final class NetworkWatchersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherCreate.json + */ + /** + * Sample code: Create network watcher. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().define("nw1").withRegion("eastus").withExistingResourceGroup("rg1").create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersDeleteSamples.java new file mode 100644 index 0000000000000..99208903a7c0b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkWatchers Delete. + */ +public final class NetworkWatchersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherDelete.json + */ + /** + * Sample code: Delete network watcher. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().delete("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetAzureReachabilityReportSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetAzureReachabilityReportSamples.java new file mode 100644 index 0000000000000..54b514a2b7aa5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetAzureReachabilityReportSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportLocation; +import com.azure.resourcemanager.network.generated.models.AzureReachabilityReportParameters; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for NetworkWatchers GetAzureReachabilityReport. + */ +public final class NetworkWatchersGetAzureReachabilityReportSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherAzureReachabilityReportGet.json + */ + /** + * Sample code: Get Azure Reachability Report. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureReachabilityReport(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getAzureReachabilityReport("rg1", "nw1", + new AzureReachabilityReportParameters() + .withProviderLocation( + new AzureReachabilityReportLocation().withCountry("United States").withState("washington")) + .withProviders(Arrays.asList("Frontier Communications of America, Inc. - ASN 5650")) + .withAzureLocations(Arrays.asList("West US")) + .withStartTime(OffsetDateTime.parse("2017-09-07T00:00:00Z")) + .withEndTime(OffsetDateTime.parse("2017-09-10T00:00:00Z")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d6ad9a7efe04d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkWatchers GetByResourceGroup. + */ +public final class NetworkWatchersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherGet.json + */ + /** + * Sample code: Get network watcher. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkWatcher(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().getByResourceGroupWithResponse("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetFlowLogStatusSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetFlowLogStatusSamples.java new file mode 100644 index 0000000000000..ee4701b7ab5d1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetFlowLogStatusSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.FlowLogStatusParameters; + +/** + * Samples for NetworkWatchers GetFlowLogStatus. + */ +public final class NetworkWatchersGetFlowLogStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherFlowLogStatusQuery.json + */ + /** + * Sample code: Get flow log status. + * + * @param manager Entry point to NetworkManager. + */ + public static void getFlowLogStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getFlowLogStatus("rg1", "nw1", + new FlowLogStatusParameters().withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNetworkConfigurationDiagnosticSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNetworkConfigurationDiagnosticSamples.java new file mode 100644 index 0000000000000..94b6b93ca1858 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNetworkConfigurationDiagnosticSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.Direction; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticParameters; +import com.azure.resourcemanager.network.generated.models.NetworkConfigurationDiagnosticProfile; +import java.util.Arrays; + +/** + * Samples for NetworkWatchers GetNetworkConfigurationDiagnostic. + */ +public final class NetworkWatchersGetNetworkConfigurationDiagnosticSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherNetworkConfigurationDiagnostic.json + */ + /** + * Sample code: Network configuration diagnostic. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkConfigurationDiagnostic(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getNetworkConfigurationDiagnostic("rg1", "nw1", new NetworkConfigurationDiagnosticParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withProfiles(Arrays.asList(new NetworkConfigurationDiagnosticProfile().withDirection(Direction.INBOUND) + .withProtocol("TCP") + .withSource("10.1.0.4") + .withDestination("12.11.12.14") + .withDestinationPort("12100"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNextHopSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNextHopSamples.java new file mode 100644 index 0000000000000..86dde51e95298 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetNextHopSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NextHopParameters; + +/** + * Samples for NetworkWatchers GetNextHop. + */ +public final class NetworkWatchersGetNextHopSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherNextHopGet.json + */ + /** + * Sample code: Get next hop. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNextHop(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getNextHop("rg1", "nw1", + new NextHopParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withSourceIpAddress("10.0.0.5") + .withDestinationIpAddress("10.0.0.10") + .withTargetNicResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTopologySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTopologySamples.java new file mode 100644 index 0000000000000..6dfb80e790d17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTopologySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.TopologyParameters; + +/** + * Samples for NetworkWatchers GetTopology. + */ +public final class NetworkWatchersGetTopologySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherTopologyGet. + * json + */ + /** + * Sample code: Get Topology. + * + * @param manager Entry point to NetworkManager. + */ + public static void getTopology(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getTopologyWithResponse("rg1", "nw1", new TopologyParameters().withTargetResourceGroupName("rg2"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingResultSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingResultSamples.java new file mode 100644 index 0000000000000..9d4cfcd0ef839 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingResultSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.QueryTroubleshootingParameters; + +/** + * Samples for NetworkWatchers GetTroubleshootingResult. + */ +public final class NetworkWatchersGetTroubleshootingResultSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherTroubleshootResultQuery.json + */ + /** + * Sample code: Get troubleshoot result. + * + * @param manager Entry point to NetworkManager. + */ + public static void getTroubleshootResult(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getTroubleshootingResult("rg1", "nw1", + new QueryTroubleshootingParameters().withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingSamples.java new file mode 100644 index 0000000000000..8bbdeed3ca0dc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetTroubleshootingSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.TroubleshootingParameters; + +/** + * Samples for NetworkWatchers GetTroubleshooting. + */ +public final class NetworkWatchersGetTroubleshootingSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherTroubleshootGet + * .json + */ + /** + * Sample code: Get troubleshooting. + * + * @param manager Entry point to NetworkManager. + */ + public static void getTroubleshooting(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getTroubleshooting("rg1", "nw1", + new TroubleshootingParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1") + .withStoragePath("https://st1.blob.core.windows.net/cn1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetVMSecurityRulesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetVMSecurityRulesSamples.java new file mode 100644 index 0000000000000..e86a603f29cb2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersGetVMSecurityRulesSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.SecurityGroupViewParameters; + +/** + * Samples for NetworkWatchers GetVMSecurityRules. + */ +public final class NetworkWatchersGetVMSecurityRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherSecurityGroupViewGet.json + */ + /** + * Sample code: Get security group view. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSecurityGroupView(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .getVMSecurityRules("rg1", "nw1", + new SecurityGroupViewParameters().withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListAvailableProvidersSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListAvailableProvidersSamples.java new file mode 100644 index 0000000000000..2c5667f1e6778 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListAvailableProvidersSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AvailableProvidersListParameters; +import java.util.Arrays; + +/** + * Samples for NetworkWatchers ListAvailableProviders. + */ +public final class NetworkWatchersListAvailableProvidersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherAvailableProvidersListGet.json + */ + /** + * Sample code: Get Available Providers List. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAvailableProvidersList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .listAvailableProviders("rg1", "nw1", + new AvailableProvidersListParameters().withAzureLocations(Arrays.asList("West US")) + .withCountry("United States") + .withState("washington") + .withCity("seattle"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..244c5245c8b98 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkWatchers ListByResourceGroup. + */ +public final class NetworkWatchersListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherList.json + */ + /** + * Sample code: List network watchers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkWatchers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListSamples.java new file mode 100644 index 0000000000000..a9b57d07a2775 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for NetworkWatchers List. + */ +public final class NetworkWatchersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherListAll.json + */ + /** + * Sample code: List all network watchers. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkWatchers(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersSetFlowLogConfigurationSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersSetFlowLogConfigurationSamples.java new file mode 100644 index 0000000000000..762cfe99d2bf5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersSetFlowLogConfigurationSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.FlowLogInformationInner; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentity; +import com.azure.resourcemanager.network.generated.models.ManagedServiceIdentityUserAssignedIdentities; +import com.azure.resourcemanager.network.generated.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkWatchers SetFlowLogConfiguration. + */ +public final class NetworkWatchersSetFlowLogConfigurationSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherFlowLogConfigure.json + */ + /** + * Sample code: Configure flow log. + * + * @param manager Entry point to NetworkManager. + */ + public static void configureFlowLog(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .setFlowLogConfiguration("rg1", "nw1", new FlowLogInformationInner() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1") + .withIdentity(new ManagedServiceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new ManagedServiceIdentityUserAssignedIdentities()))) + .withStorageId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1") + .withEnabled(true), com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersUpdateTagsSamples.java new file mode 100644 index 0000000000000..f70963b3d06a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkWatcher; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for NetworkWatchers UpdateTags. + */ +public final class NetworkWatchersUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherUpdateTags.json + */ + /** + * Sample code: Update network watcher tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateNetworkWatcherTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + NetworkWatcher resource = manager.networkWatchers() + .getByResourceGroupWithResponse("rg1", "nw1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersVerifyIpFlowSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersVerifyIpFlowSamples.java new file mode 100644 index 0000000000000..2e37ea7519cc4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/NetworkWatchersVerifyIpFlowSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.Direction; +import com.azure.resourcemanager.network.generated.models.IpFlowProtocol; +import com.azure.resourcemanager.network.generated.models.VerificationIpFlowParameters; + +/** + * Samples for NetworkWatchers VerifyIpFlow. + */ +public final class NetworkWatchersVerifyIpFlowSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkWatcherIpFlowVerify. + * json + */ + /** + * Sample code: Ip flow verify. + * + * @param manager Entry point to NetworkManager. + */ + public static void ipFlowVerify(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.networkWatchers() + .verifyIpFlow("rg1", "nw1", + new VerificationIpFlowParameters() + .withTargetResourceId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withDirection(Direction.OUTBOUND) + .withProtocol(IpFlowProtocol.TCP) + .withLocalPort("80") + .withRemotePort("80") + .withLocalIpAddress("10.2.0.4") + .withRemoteIpAddress("121.10.1.1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/OperationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..6229f79042356 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/OperationsListSamples.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.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/OperationList.json + */ + /** + * Sample code: Get a list of operations for a resource provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getAListOfOperationsForAResourceProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7a1073ea12c5d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.P2SConnectionConfiguration; +import com.azure.resourcemanager.network.generated.models.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.VnetRoute; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for P2SVpnGateways CreateOrUpdate. + */ +public final class P2SVpnGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayPut.json + */ + /** + * Sample code: P2SVpnGatewayPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .define("p2sVpnGateway1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1")) + .withP2SConnectionConfigurations(Arrays.asList(new P2SConnectionConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/p2sVpnGateways/p2sVpnGateway1/p2sConnectionConfigurations/P2SConnectionConfig1") + .withName("P2SConnectionConfig1") + .withVpnClientAddressPool(new AddressSpace().withAddressPrefixes(Arrays.asList("101.3.0.0/16"))) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable2"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable3")))) + .withVnetRoutes(new VnetRoute().withStaticRoutes(Arrays.asList()))))) + .withVpnGatewayScaleUnit(1) + .withVpnServerConfiguration(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1")) + .withCustomDnsServers(Arrays.asList("1.1.1.1", "2.2.2.2")) + .withIsRoutingPreferenceInternet(false) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDeleteSamples.java new file mode 100644 index 0000000000000..532c9b0300153 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for P2SVpnGateways Delete. + */ +public final class P2SVpnGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayDelete.json + */ + /** + * Sample code: P2SVpnGatewayDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().delete("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples.java new file mode 100644 index 0000000000000..18445380bf779 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import java.util.Arrays; + +/** + * Samples for P2SVpnGateways DisconnectP2SVpnConnections. + */ +public final class P2SVpnGatewaysDisconnectP2SVpnConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2sVpnGatewaysDisconnectP2sVpnConnections.json + */ + /** + * Sample code: Disconnect VpnConnections from P2sVpn Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + disconnectVpnConnectionsFromP2sVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .disconnectP2SVpnConnections("p2s-vpn-gateway-test", "p2svpngateway", + new P2SVpnConnectionRequest().withVpnConnectionIds(Arrays.asList("vpnconnId1", "vpnconnId2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGenerateVpnProfileSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGenerateVpnProfileSamples.java new file mode 100644 index 0000000000000..b7d0f69b6568d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGenerateVpnProfileSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.AuthenticationMethod; +import com.azure.resourcemanager.network.generated.models.P2SVpnProfileParameters; + +/** + * Samples for P2SVpnGateways GenerateVpnProfile. + */ +public final class P2SVpnGatewaysGenerateVpnProfileSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayGenerateVpnProfile.json + */ + /** + * Sample code: GenerateP2SVpnGatewayVPNProfile. + * + * @param manager Entry point to NetworkManager. + */ + public static void + generateP2SVpnGatewayVPNProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .generateVpnProfile("rg1", "p2sVpnGateway1", + new P2SVpnProfileParameters().withAuthenticationMethod(AuthenticationMethod.EAPTLS), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d90f71d90bea0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetByResourceGroupSamples.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.generated; + +/** + * Samples for P2SVpnGateways GetByResourceGroup. + */ +public final class P2SVpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayGet.json + */ + /** + * Sample code: P2SVpnGatewayGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .getByResourceGroupWithResponse("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples.java new file mode 100644 index 0000000000000..1eb99b5066c11 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionHealthRequest; +import java.util.Arrays; + +/** + * Samples for P2SVpnGateways GetP2SVpnConnectionHealthDetailed. + */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthDetailedSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayGetConnectionHealthDetailed.json + */ + /** + * Sample code: P2SVpnGatewayGetConnectionHealthDetailed. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayGetConnectionHealthDetailed(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways() + .getP2SVpnConnectionHealthDetailed("p2s-vpn-gateway-test", "p2svpngateway", + new P2SVpnConnectionHealthRequest().withVpnUserNamesFilter(Arrays.asList("vpnUser1", "vpnUser2")) + .withOutputBlobSasUrl( + "https://blobcortextesturl.blob.core.windows.net/folderforconfig/p2sconnectionhealths?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthSamples.java new file mode 100644 index 0000000000000..3b746c5d6b015 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysGetP2SVpnConnectionHealthSamples.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.generated; + +/** + * Samples for P2SVpnGateways GetP2SVpnConnectionHealth. + */ +public final class P2SVpnGatewaysGetP2SVpnConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayGetConnectionHealth.json + */ + /** + * Sample code: P2SVpnGatewayGetConnectionHealth. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayGetConnectionHealth(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().getP2SVpnConnectionHealth("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..843b382f35196 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListByResourceGroupSamples.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.generated; + +/** + * Samples for P2SVpnGateways ListByResourceGroup. + */ +public final class P2SVpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * P2SVpnGatewayListByResourceGroup.json + */ + /** + * Sample code: P2SVpnGatewayListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListSamples.java new file mode 100644 index 0000000000000..4efc37c6182eb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysListSamples.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.generated; + +/** + * Samples for P2SVpnGateways List. + */ +public final class P2SVpnGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayList.json + */ + /** + * Sample code: P2SVpnGatewayListBySubscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + p2SVpnGatewayListBySubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysResetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysResetSamples.java new file mode 100644 index 0000000000000..a4e19719d273e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysResetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for P2SVpnGateways Reset. + */ +public final class P2SVpnGatewaysResetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayReset.json + */ + /** + * Sample code: ResetP2SVpnGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetP2SVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.p2SVpnGateways().reset("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysUpdateTagsSamples.java new file mode 100644 index 0000000000000..ceaecc0e45814 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/P2SVpnGatewaysUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.P2SVpnGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for P2SVpnGateways UpdateTags. + */ +public final class P2SVpnGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/P2SVpnGatewayUpdateTags.json + */ + /** + * Sample code: P2SVpnGatewayUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void p2SVpnGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + P2SVpnGateway resource = manager.p2SVpnGateways() + .getByResourceGroupWithResponse("rg1", "p2sVpnGateway1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesCreateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesCreateSamples.java new file mode 100644 index 0000000000000..eac83256fba68 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesCreateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.PacketCapture; +import com.azure.resourcemanager.network.generated.models.PacketCaptureFilter; +import com.azure.resourcemanager.network.generated.models.PacketCaptureStorageLocation; +import com.azure.resourcemanager.network.generated.models.PcProtocol; +import java.util.Arrays; + +/** + * Samples for PacketCaptures Create. + */ +public final class PacketCapturesCreateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureCreate.json + */ + /** + * Sample code: Create packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures() + .create("rg1", "nw1", "pc1", new PacketCapture() + .withTarget("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1") + .withBytesToCapturePerPacket(10000L) + .withTotalBytesPerSession(100000L) + .withTimeLimitInSeconds(100) + .withStorageLocation(new PacketCaptureStorageLocation() + .withStorageId( + "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Storage/storageAccounts/pcstore") + .withStoragePath("https://mytestaccountname.blob.core.windows.net/capture/pc1.cap") + .withFilePath("D:\\capture\\pc1.cap")) + .withFilters(Arrays.asList(new PacketCaptureFilter().withProtocol(PcProtocol.TCP) + .withLocalIpAddress("10.0.0.4") + .withLocalPort("80"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesDeleteSamples.java new file mode 100644 index 0000000000000..5731c6ea6cc40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PacketCaptures Delete. + */ +public final class PacketCapturesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureDelete.json + */ + /** + * Sample code: Delete packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().delete("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetSamples.java new file mode 100644 index 0000000000000..660af76f885c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PacketCaptures Get. + */ +public final class PacketCapturesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureGet.json + */ + /** + * Sample code: Get packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().getWithResponse("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetStatusSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetStatusSamples.java new file mode 100644 index 0000000000000..f23f06f59b7bf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesGetStatusSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PacketCaptures GetStatus. + */ +public final class PacketCapturesGetStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureQueryStatus.json + */ + /** + * Sample code: Query packet capture status. + * + * @param manager Entry point to NetworkManager. + */ + public static void queryPacketCaptureStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().getStatus("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesListSamples.java new file mode 100644 index 0000000000000..69b302fb80062 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PacketCaptures List. + */ +public final class PacketCapturesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCapturesList.json + */ + /** + * Sample code: List packet captures. + * + * @param manager Entry point to NetworkManager. + */ + public static void listPacketCaptures(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().list("rg1", "nw1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesStopSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesStopSamples.java new file mode 100644 index 0000000000000..ac0c3940f26ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PacketCapturesStopSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PacketCaptures Stop. + */ +public final class PacketCapturesStopSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkWatcherPacketCaptureStop.json + */ + /** + * Sample code: Stop packet capture. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopPacketCapture(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.packetCaptures().stop("rg1", "nw1", "pc1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsGetSamples.java new file mode 100644 index 0000000000000..bda6fd72b2e1f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsGetSamples.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.generated; + +/** + * Samples for PeerExpressRouteCircuitConnections Get. + */ +public final class PeerExpressRouteCircuitConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PeerExpressRouteCircuitConnectionGet.json + */ + /** + * Sample code: PeerExpressRouteCircuitConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + peerExpressRouteCircuitConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.peerExpressRouteCircuitConnections() + .getWithResponse("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", + "60aee347-e889-4a42-8c1b-0aae8b1e4013", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsListSamples.java new file mode 100644 index 0000000000000..1b23eb6d0fa42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PeerExpressRouteCircuitConnectionsListSamples.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.generated; + +/** + * Samples for PeerExpressRouteCircuitConnections List. + */ +public final class PeerExpressRouteCircuitConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PeerExpressRouteCircuitConnectionList.json + */ + /** + * Sample code: List Peer ExpressRouteCircuit Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPeerExpressRouteCircuitConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.peerExpressRouteCircuitConnections() + .list("rg1", "ExpressRouteARMCircuitA", "AzurePrivatePeering", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..cf59c52035b14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateDnsZoneGroupInner; +import com.azure.resourcemanager.network.generated.models.PrivateDnsZoneConfig; +import java.util.Arrays; + +/** + * Samples for PrivateDnsZoneGroups CreateOrUpdate. + */ +public final class PrivateDnsZoneGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupCreate.json + */ + /** + * Sample code: Create private dns zone group. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups() + .createOrUpdate("rg1", "testPe", "testPdnsgroup", new PrivateDnsZoneGroupInner() + .withPrivateDnsZoneConfigs(Arrays.asList(new PrivateDnsZoneConfig().withPrivateDnsZoneId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateDnsZones/zone1.com"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsDeleteSamples.java new file mode 100644 index 0000000000000..9b3841d8815cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PrivateDnsZoneGroups Delete. + */ +public final class PrivateDnsZoneGroupsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupDelete.json + */ + /** + * Sample code: Delete private dns zone group. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups().delete("rg1", "testPe", "testPdnsgroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsGetSamples.java new file mode 100644 index 0000000000000..692b7f564f16a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsGetSamples.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.generated; + +/** + * Samples for PrivateDnsZoneGroups Get. + */ +public final class PrivateDnsZoneGroupsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupGet.json + */ + /** + * Sample code: Get private dns zone group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateDnsZoneGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups() + .getWithResponse("rg1", "testPe", "testPdnsgroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsListSamples.java new file mode 100644 index 0000000000000..6e7230cac3211 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateDnsZoneGroupsListSamples.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.generated; + +/** + * Samples for PrivateDnsZoneGroups List. + */ +public final class PrivateDnsZoneGroupsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointDnsZoneGroupList.json + */ + /** + * Sample code: List private endpoints in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateEndpointsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateDnsZoneGroups().list("testPe", "rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7543afc8de6c2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ApplicationSecurityGroupInner; +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; +import com.azure.resourcemanager.network.generated.models.PrivateEndpointIpConfiguration; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnection; +import java.util.Arrays; + +/** + * Samples for PrivateEndpoints CreateOrUpdate. + */ +public final class PrivateEndpointsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointCreateWithASG. + * json + */ + /** + * Sample code: Create private endpoint with application security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateEndpointWithApplicationSecurityGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .define("testPe") + .withRegion("eastus2euap") + .withExistingResourceGroup("rg1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .withPrivateLinkServiceConnections(Arrays.asList(new PrivateLinkServiceConnection() + .withPrivateLinkServiceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls") + .withGroupIds(Arrays.asList("groupIdFromResource")) + .withRequestMessage("Please approve my connection."))) + .withApplicationSecurityGroups(Arrays.asList(new ApplicationSecurityGroupInner().withId( + "/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointCreate.json + */ + /** + * Sample code: Create private endpoint. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .define("testPe") + .withRegion("eastus2euap") + .withExistingResourceGroup("rg1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .withPrivateLinkServiceConnections(Arrays.asList(new PrivateLinkServiceConnection() + .withPrivateLinkServiceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls") + .withGroupIds(Arrays.asList("groupIdFromResource")) + .withRequestMessage("Please approve my connection."))) + .withIpConfigurations(Arrays.asList(new PrivateEndpointIpConfiguration().withName("pestaticconfig") + .withGroupId("file") + .withMemberName("file") + .withPrivateIpAddress("192.168.0.6"))) + .withCustomNetworkInterfaceName("testPeNic") + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointCreateForManualApproval.json + */ + /** + * Sample code: Create private endpoint with manual approval connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateEndpointWithManualApprovalConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .define("testPe") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + .withManualPrivateLinkServiceConnections(Arrays.asList(new PrivateLinkServiceConnection() + .withPrivateLinkServiceId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls") + .withGroupIds(Arrays.asList("groupIdFromResource")) + .withRequestMessage("Please manually approve my connection."))) + .withIpConfigurations(Arrays.asList(new PrivateEndpointIpConfiguration().withName("pestaticconfig") + .withGroupId("file") + .withMemberName("file") + .withPrivateIpAddress("192.168.0.5"))) + .withCustomNetworkInterfaceName("testPeNic") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsDeleteSamples.java new file mode 100644 index 0000000000000..39f4c637381b9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PrivateEndpoints Delete. + */ +public final class PrivateEndpointsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointDelete.json + */ + /** + * Sample code: Delete private endpoint. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints().delete("rg1", "testPe", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d5dda18e1dd8b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsGetByResourceGroupSamples.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.generated; + +/** + * Samples for PrivateEndpoints GetByResourceGroup. + */ +public final class PrivateEndpointsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointGetWithASG. + * json + */ + /** + * Sample code: Get private endpoint with application security groups. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateEndpointWithApplicationSecurityGroups( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .getByResourceGroupWithResponse("rg1", "testPe", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateEndpointGetForManualApproval.json + */ + /** + * Sample code: Get private endpoint with manual approval connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateEndpointWithManualApprovalConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .getByResourceGroupWithResponse("rg1", "testPe", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointGet.json + */ + /** + * Sample code: Get private endpoint. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateEndpoint(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints() + .getByResourceGroupWithResponse("rg1", "testPe", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..efaab438a1eab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListByResourceGroupSamples.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.generated; + +/** + * Samples for PrivateEndpoints ListByResourceGroup. + */ +public final class PrivateEndpointsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointList.json + */ + /** + * Sample code: List private endpoints in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateEndpointsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListSamples.java new file mode 100644 index 0000000000000..bc4be39a17b0a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateEndpointsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PrivateEndpoints List. + */ +public final class PrivateEndpointsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateEndpointListAll.json + */ + /** + * Sample code: List all private endpoints. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPrivateEndpoints(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateEndpoints().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples.java new file mode 100644 index 0000000000000..c5dc56f0f2b7e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; + +/** + * Samples for PrivateLinkServices CheckPrivateLinkServiceVisibilityByResourceGroup. + */ +public final class PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CheckPrivateLinkServiceVisibilityByResourceGroup.json + */ + /** + * Sample code: Check private link service visibility. + * + * @param manager Entry point to NetworkManager. + */ + public static void + checkPrivateLinkServiceVisibility(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .checkPrivateLinkServiceVisibilityByResourceGroup("westus", "rg1", + new CheckPrivateLinkServiceVisibilityRequest() + .withPrivateLinkServiceAlias("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples.java new file mode 100644 index 0000000000000..3b3a06906b2d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.CheckPrivateLinkServiceVisibilityRequest; + +/** + * Samples for PrivateLinkServices CheckPrivateLinkServiceVisibility. + */ +public final class PrivateLinkServicesCheckPrivateLinkServiceVisibilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CheckPrivateLinkServiceVisibility.json + */ + /** + * Sample code: Check private link service visibility. + * + * @param manager Entry point to NetworkManager. + */ + public static void + checkPrivateLinkServiceVisibility(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .checkPrivateLinkServiceVisibility("westus", + new CheckPrivateLinkServiceVisibilityRequest() + .withPrivateLinkServiceAlias("mypls.00000000-0000-0000-0000-000000000000.azure.privatelinkservice"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..387a7c762c59e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.FrontendIpConfigurationInner; +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.PrivateLinkServicePropertiesAutoApproval; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServicePropertiesVisibility; +import java.util.Arrays; + +/** + * Samples for PrivateLinkServices CreateOrUpdate. + */ +public final class PrivateLinkServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceCreate.json + */ + /** + * Sample code: Create private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .define("testPls") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withLoadBalancerFrontendIpConfigurations(Arrays.asList(new FrontendIpConfigurationInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb"))) + .withIpConfigurations(Arrays.asList(new PrivateLinkServiceIpConfigurationInner().withName("fe-lb") + .withPrivateIpAddress("10.0.1.4") + .withPrivateIpAllocationMethod(IpAllocationMethod.STATIC) + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")) + .withPrivateIpAddressVersion(IpVersion.IPV4))) + .withVisibility(new PrivateLinkServicePropertiesVisibility() + .withSubscriptions(Arrays.asList("subscription1", "subscription2", "subscription3"))) + .withAutoApproval(new PrivateLinkServicePropertiesAutoApproval() + .withSubscriptions(Arrays.asList("subscription1", "subscription2"))) + .withFqdns(Arrays.asList("fqdn1", "fqdn2", "fqdn3")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeletePrivateEndpointConnectionSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeletePrivateEndpointConnectionSamples.java new file mode 100644 index 0000000000000..ca25a4bc98981 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeletePrivateEndpointConnectionSamples.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.generated; + +/** + * Samples for PrivateLinkServices DeletePrivateEndpointConnection. + */ +public final class PrivateLinkServicesDeletePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceDeletePrivateEndpointConnection.json + */ + /** + * Sample code: delete private end point connection for a private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateEndPointConnectionForAPrivateLinkService( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .deletePrivateEndpointConnection("rg1", "testPls", "testPlePeConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeleteSamples.java new file mode 100644 index 0000000000000..a5109d8b9318d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PrivateLinkServices Delete. + */ +public final class PrivateLinkServicesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceDelete.json + */ + /** + * Sample code: Delete private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices().delete("rg1", "testPls", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..bad49da7a6c12 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetByResourceGroupSamples.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.generated; + +/** + * Samples for PrivateLinkServices GetByResourceGroup. + */ +public final class PrivateLinkServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceGet.json + */ + /** + * Sample code: Get private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPrivateLinkService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .getByResourceGroupWithResponse("rg1", "testPls", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetPrivateEndpointConnectionSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetPrivateEndpointConnectionSamples.java new file mode 100644 index 0000000000000..48ffd0a679e30 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesGetPrivateEndpointConnectionSamples.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.generated; + +/** + * Samples for PrivateLinkServices GetPrivateEndpointConnection. + */ +public final class PrivateLinkServicesGetPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceGetPrivateEndpointConnection.json + */ + /** + * Sample code: Get private end point connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getPrivateEndPointConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .getPrivateEndpointConnectionWithResponse("rg1", "testPls", "testPlePeConnection", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples.java new file mode 100644 index 0000000000000..bf233641581e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples.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.generated; + +/** + * Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServicesByResourceGroup. + */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AutoApprovedPrivateLinkServicesResourceGroupGet.json + */ + /** + * Sample code: Get list of private link service id that can be linked to a private end point with auto approved. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfPrivateLinkServiceIdThatCanBeLinkedToAPrivateEndPointWithAutoApproved( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .listAutoApprovedPrivateLinkServicesByResourceGroup("regionName", "rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples.java new file mode 100644 index 0000000000000..d2cb089edac65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples.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.generated; + +/** + * Samples for PrivateLinkServices ListAutoApprovedPrivateLinkServices. + */ +public final class PrivateLinkServicesListAutoApprovedPrivateLinkServicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AutoApprovedPrivateLinkServicesGet.json + */ + /** + * Sample code: Get list of private link service id that can be linked to a private end point with auto approved. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfPrivateLinkServiceIdThatCanBeLinkedToAPrivateEndPointWithAutoApproved( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .listAutoApprovedPrivateLinkServices("regionName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..fd48408f498cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListByResourceGroupSamples.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.generated; + +/** + * Samples for PrivateLinkServices ListByResourceGroup. + */ +public final class PrivateLinkServicesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceList.json + */ + /** + * Sample code: List private link service in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateLinkServiceInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListPrivateEndpointConnectionsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListPrivateEndpointConnectionsSamples.java new file mode 100644 index 0000000000000..5db559279ddd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListPrivateEndpointConnectionsSamples.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.generated; + +/** + * Samples for PrivateLinkServices ListPrivateEndpointConnections. + */ +public final class PrivateLinkServicesListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceListPrivateEndpointConnection.json + */ + /** + * Sample code: List private link service in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listPrivateLinkServiceInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .listPrivateEndpointConnections("rg1", "testPls", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListSamples.java new file mode 100644 index 0000000000000..a535798da4a14 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesListSamples.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.generated; + +/** + * Samples for PrivateLinkServices List. + */ +public final class PrivateLinkServicesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PrivateLinkServiceListAll. + * json + */ + /** + * Sample code: List all private list service. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPrivateListService(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesUpdatePrivateEndpointConnectionSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesUpdatePrivateEndpointConnectionSamples.java new file mode 100644 index 0000000000000..c272dbbea910b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PrivateLinkServicesUpdatePrivateEndpointConnectionSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.network.generated.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateLinkServices UpdatePrivateEndpointConnection. + */ +public final class PrivateLinkServicesUpdatePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PrivateLinkServiceUpdatePrivateEndpointConnection.json + */ + /** + * Sample code: approve or reject private end point connection for a private link service. + * + * @param manager Entry point to NetworkManager. + */ + public static void approveOrRejectPrivateEndPointConnectionForAPrivateLinkService( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.privateLinkServices() + .updatePrivateEndpointConnectionWithResponse("rg1", "testPls", "testPlePeConnection", + new PrivateEndpointConnectionInner().withName("testPlePeConnection") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus("Approved") + .withDescription("approved it for some reason.")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c0145133df042 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettings; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressDnsSettingsDomainNameLabelScope; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSku; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSkuName; +import com.azure.resourcemanager.network.generated.models.PublicIpAddressSkuTier; + +/** + * Samples for PublicIpAddresses CreateOrUpdate. + */ +public final class PublicIpAddressesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressCreateDns.json + */ + /** + * Sample code: Create public IP address DNS. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPublicIPAddressDNS(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .define("test-ip") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withDnsSettings(new PublicIpAddressDnsSettings().withDomainNameLabel("dnslbl")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpAddressCreateCustomizedValues.json + */ + /** + * Sample code: Create public IP address allocation method. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPAddressAllocationMethod(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .define("test-ip") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withSku(new PublicIpAddressSku().withName(PublicIpAddressSkuName.STANDARD) + .withTier(PublicIpAddressSkuTier.GLOBAL)) + .withPublicIpAllocationMethod(IpAllocationMethod.STATIC) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withIdleTimeoutInMinutes(10) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressCreateDefaults + * .json + */ + /** + * Sample code: Create public IP address defaults. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPAddressDefaults(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().define("test-ip").withRegion("eastus").withExistingResourceGroup("rg1").create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpAddressCreateDnsWithDomainNameLabelScope.json + */ + /** + * Sample code: Create public IP address DNS with Domain Name Label Scope. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPublicIPAddressDNSWithDomainNameLabelScope( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .define("test-ip") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withDnsSettings(new PublicIpAddressDnsSettings().withDomainNameLabel("dnslbl") + .withDomainNameLabelScope(PublicIpAddressDnsSettingsDomainNameLabelScope.TENANT_REUSE)) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDdosProtectionStatusSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDdosProtectionStatusSamples.java new file mode 100644 index 0000000000000..676ad570cf47e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDdosProtectionStatusSamples.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.generated; + +/** + * Samples for PublicIpAddresses DdosProtectionStatus. + */ +public final class PublicIpAddressesDdosProtectionStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpAddressGetDdosProtectionStatus.json + */ + /** + * Sample code: Get Ddos Protection Status of a Public IP Address. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getDdosProtectionStatusOfAPublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().ddosProtectionStatus("rg1", "test-pip", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDeleteSamples.java new file mode 100644 index 0000000000000..e2459fa8d2733 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PublicIpAddresses Delete. + */ +public final class PublicIpAddressesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressDelete.json + */ + /** + * Sample code: Delete public IP address. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().delete("rg1", "test-ip", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..7896a11538ee8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetByResourceGroupSamples.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.generated; + +/** + * Samples for PublicIpAddresses GetByResourceGroup. + */ +public final class PublicIpAddressesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressGet.json + */ + /** + * Sample code: Get public IP address. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPublicIPAddress(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .getByResourceGroupWithResponse("rg1", "testDNS-ip", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetCloudServicePublicIpAddressSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetCloudServicePublicIpAddressSamples.java new file mode 100644 index 0000000000000..b62bf5423f433 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetCloudServicePublicIpAddressSamples.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.generated; + +/** + * Samples for PublicIpAddresses GetCloudServicePublicIpAddress. + */ +public final class PublicIpAddressesGetCloudServicePublicIpAddressSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServicePublicIpGet.json + */ + /** + * Sample code: GetVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .getCloudServicePublicIpAddressWithResponse("cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", "pub1", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples.java new file mode 100644 index 0000000000000..c51b5b0c910ef --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples.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.generated; + +/** + * Samples for PublicIpAddresses GetVirtualMachineScaleSetPublicIpAddress. + */ +public final class PublicIpAddressesGetVirtualMachineScaleSetPublicIpAddressSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssPublicIpGet.json + */ + /** + * Sample code: GetVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .getVirtualMachineScaleSetPublicIpAddressWithResponse("vmss-tester", "vmss1", "1", "nic1", "ip1", "pub1", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..9a0206ea08494 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListByResourceGroupSamples.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.generated; + +/** + * Samples for PublicIpAddresses ListByResourceGroup. + */ +public final class PublicIpAddressesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressList.json + */ + /** + * Sample code: List resource group public IP addresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupPublicIPAddresses(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServicePublicIpAddressesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServicePublicIpAddressesSamples.java new file mode 100644 index 0000000000000..aafc24e2b6657 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServicePublicIpAddressesSamples.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.generated; + +/** + * Samples for PublicIpAddresses ListCloudServicePublicIpAddresses. + */ +public final class PublicIpAddressesListCloudServicePublicIpAddressesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServicePublicIpListAll. + * json + */ + /** + * Sample code: ListVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listCloudServicePublicIpAddresses("cs-tester", "cs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples.java new file mode 100644 index 0000000000000..b4d39584d84cc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples.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.generated; + +/** + * Samples for PublicIpAddresses ListCloudServiceRoleInstancePublicIpAddresses. + */ +public final class PublicIpAddressesListCloudServiceRoleInstancePublicIpAddressesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * CloudServiceRoleInstancePublicIpList.json + */ + /** + * Sample code: ListVMSSVMPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSVMPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listCloudServiceRoleInstancePublicIpAddresses("cs-tester", "cs1", "Test_VM_0", "nic1", "ip1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListSamples.java new file mode 100644 index 0000000000000..ef6ae3cd81ee3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PublicIpAddresses List. + */ +public final class PublicIpAddressesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressListAll.json + */ + /** + * Sample code: List all public IP addresses. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPublicIPAddresses(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples.java new file mode 100644 index 0000000000000..771daa291a393 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples.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.generated; + +/** + * Samples for PublicIpAddresses ListVirtualMachineScaleSetPublicIpAddresses. + */ +public final class PublicIpAddressesListVirtualMachineScaleSetPublicIpAddressesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssPublicIpListAll.json + */ + /** + * Sample code: ListVMSSPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listVirtualMachineScaleSetPublicIpAddresses("vmss-tester", "vmss1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples.java new file mode 100644 index 0000000000000..b847e3229a804 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples.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.generated; + +/** + * Samples for PublicIpAddresses ListVirtualMachineScaleSetVMPublicIpAddresses. + */ +public final class PublicIpAddressesListVirtualMachineScaleSetVMPublicIpAddressesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VmssVmPublicIpList.json + */ + /** + * Sample code: ListVMSSVMPublicIP. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVMSSVMPublicIP(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpAddresses() + .listVirtualMachineScaleSetVMPublicIpAddresses("vmss-tester", "vmss1", "1", "nic1", "ip1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesUpdateTagsSamples.java new file mode 100644 index 0000000000000..aaaa5758b99cd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpAddressesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.PublicIpAddress; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicIpAddresses UpdateTags. + */ +public final class PublicIpAddressesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpAddressUpdateTags. + * json + */ + /** + * Sample code: Update public IP address tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updatePublicIPAddressTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + PublicIpAddress resource = manager.publicIpAddresses() + .getByResourceGroupWithResponse("rg1", "test-ip", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..160ecc7d038f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.IpVersion; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSku; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSkuName; +import com.azure.resourcemanager.network.generated.models.PublicIpPrefixSkuTier; + +/** + * Samples for PublicIpPrefixes CreateOrUpdate. + */ +public final class PublicIpPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixCreateDefaults. + * json + */ + /** + * Sample code: Create public IP prefix defaults. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPPrefixDefaults(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes() + .define("test-ipprefix") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new PublicIpPrefixSku().withName(PublicIpPrefixSkuName.STANDARD)) + .withPrefixLength(30) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * PublicIpPrefixCreateCustomizedValues.json + */ + /** + * Sample code: Create public IP prefix allocation method. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createPublicIPPrefixAllocationMethod(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes() + .define("test-ipprefix") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withSku(new PublicIpPrefixSku().withName(PublicIpPrefixSkuName.STANDARD) + .withTier(PublicIpPrefixSkuTier.REGIONAL)) + .withPublicIpAddressVersion(IpVersion.IPV4) + .withPrefixLength(30) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesDeleteSamples.java new file mode 100644 index 0000000000000..e0d9780179369 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PublicIpPrefixes Delete. + */ +public final class PublicIpPrefixesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixDelete.json + */ + /** + * Sample code: Delete public IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePublicIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes().delete("rg1", "test-ipprefix", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..97fabb5ecf730 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesGetByResourceGroupSamples.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.generated; + +/** + * Samples for PublicIpPrefixes GetByResourceGroup. + */ +public final class PublicIpPrefixesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixGet.json + */ + /** + * Sample code: Get public IP prefix. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPublicIPPrefix(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-ipprefix", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..ee2a6b592a87d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListByResourceGroupSamples.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.generated; + +/** + * Samples for PublicIpPrefixes ListByResourceGroup. + */ +public final class PublicIpPrefixesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixList.json + */ + /** + * Sample code: List resource group public IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupPublicIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListSamples.java new file mode 100644 index 0000000000000..b626529979322 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for PublicIpPrefixes List. + */ +public final class PublicIpPrefixesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixListAll.json + */ + /** + * Sample code: List all public IP prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllPublicIPPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.publicIpPrefixes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesUpdateTagsSamples.java new file mode 100644 index 0000000000000..7fb5ef4680b19 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/PublicIpPrefixesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.PublicIpPrefix; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicIpPrefixes UpdateTags. + */ +public final class PublicIpPrefixesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/PublicIpPrefixUpdateTags.json + */ + /** + * Sample code: Update public IP prefix tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updatePublicIPPrefixTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + PublicIpPrefix resource = manager.publicIpPrefixes() + .getByResourceGroupWithResponse("rg1", "test-ipprefix", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceNavigationLinksListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceNavigationLinksListSamples.java new file mode 100644 index 0000000000000..0867986207f9d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceNavigationLinksListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ResourceNavigationLinks List. + */ +public final class ResourceNavigationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetResourceNavigationLinks.json + */ + /** + * Sample code: Get Resource Navigation Links. + * + * @param manager Entry point to NetworkManager. + */ + public static void getResourceNavigationLinks(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceNavigationLinks().listWithResponse("rg1", "vnet", "subnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderCheckDnsNameAvailabilitySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderCheckDnsNameAvailabilitySamples.java new file mode 100644 index 0000000000000..21d8d00edc716 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderCheckDnsNameAvailabilitySamples.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.generated; + +/** + * Samples for ResourceProvider CheckDnsNameAvailability. + */ +public final class ResourceProviderCheckDnsNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CheckDnsNameAvailability.json + */ + /** + * Sample code: Check Dns Name Availability. + * + * @param manager Entry point to NetworkManager. + */ + public static void checkDnsNameAvailability(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .checkDnsNameAvailabilityWithResponse("westus", "testdns", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkByTokenSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkByTokenSamples.java new file mode 100644 index 0000000000000..081a045e2bf87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkByTokenSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkTokenListRequest; +import java.util.Arrays; + +/** + * Samples for ResourceProvider DeleteBastionShareableLinkByToken. + */ +public final class ResourceProviderDeleteBastionShareableLinkByTokenSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * BastionShareableLinkDeleteByToken.json + */ + /** + * Sample code: Delete Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .deleteBastionShareableLinkByToken("rg1", "bastionhosttenant", + new BastionShareableLinkTokenListRequest().withTokens( + Arrays.asList("abcd1234-efgh-hijk-5678-abcdefgh1234", "dcba4321-hgfe-kjih-8765-hgfedcba4321")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkSamples.java new file mode 100644 index 0000000000000..3d6d3749d6646 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDeleteBastionShareableLinkSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.VM; +import java.util.Arrays; + +/** + * Samples for ResourceProvider DeleteBastionShareableLink. + */ +public final class ResourceProviderDeleteBastionShareableLinkSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionShareableLinkDelete. + * json + */ + /** + * Sample code: Delete Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .deleteBastionShareableLink("rg1", "bastionhosttenant", + new BastionShareableLinkListRequest().withVms(Arrays.asList( + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")), + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDisconnectActiveSessionsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDisconnectActiveSessionsSamples.java new file mode 100644 index 0000000000000..86914af796684 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderDisconnectActiveSessionsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.SessionIds; + +/** + * Samples for ResourceProvider DisconnectActiveSessions. + */ +public final class ResourceProviderDisconnectActiveSessionsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionSessionDelete.json + */ + /** + * Sample code: Deletes the specified active session. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesTheSpecifiedActiveSession(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .disconnectActiveSessions("rg1", "bastionhosttenant", new SessionIds(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderExpressRouteProviderPortSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderExpressRouteProviderPortSamples.java new file mode 100644 index 0000000000000..a6cf5845f12ad --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderExpressRouteProviderPortSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ResourceProvider ExpressRouteProviderPort. + */ +public final class ResourceProviderExpressRouteProviderPortSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/expressRouteProviderPort.json + */ + /** + * Sample code: ExpressRouteProviderPort. + * + * @param manager Entry point to NetworkManager. + */ + public static void expressRouteProviderPort(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders().expressRouteProviderPortWithResponse("abc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples.java new file mode 100644 index 0000000000000..3d740d1b3761d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AuthenticationMethod; +import com.azure.resourcemanager.network.generated.models.VirtualWanVpnProfileParameters; + +/** + * Samples for ResourceProvider Generatevirtualwanvpnserverconfigurationvpnprofile. + */ +public final class ResourceProviderGeneratevirtualwanvpnserverconfigurationvpnprofileSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GenerateVirtualWanVpnServerConfigurationVpnProfile.json + */ + /** + * Sample code: GenerateVirtualWanVpnServerConfigurationVpnProfile. + * + * @param manager Entry point to NetworkManager. + */ + public static void generateVirtualWanVpnServerConfigurationVpnProfile( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .generatevirtualwanvpnserverconfigurationvpnprofile("rg1", "wan1", + new VirtualWanVpnProfileParameters().withVpnServerConfigurationResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnconfig1") + .withAuthenticationMethod(AuthenticationMethod.EAPTLS), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetActiveSessionsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetActiveSessionsSamples.java new file mode 100644 index 0000000000000..0eb579207fb7f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetActiveSessionsSamples.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.generated; + +/** + * Samples for ResourceProvider GetActiveSessions. + */ +public final class ResourceProviderGetActiveSessionsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionSessionsList.json + */ + /** + * Sample code: Returns a list of currently active sessions on the Bastion. + * + * @param manager Entry point to NetworkManager. + */ + public static void returnsAListOfCurrentlyActiveSessionsOnTheBastion( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders().getActiveSessions("rg1", "bastionhosttenant", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetBastionShareableLinkSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetBastionShareableLinkSamples.java new file mode 100644 index 0000000000000..43d1db54a1e01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderGetBastionShareableLinkSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.VM; +import java.util.Arrays; + +/** + * Samples for ResourceProvider GetBastionShareableLink. + */ +public final class ResourceProviderGetBastionShareableLinkSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionShareableLinkGet.json + */ + /** + * Sample code: Returns the Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void returnsTheBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .getBastionShareableLink("rg1", "bastionhosttenant", + new BastionShareableLinkListRequest().withVms(Arrays.asList( + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")), + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveConnectivityConfigurationsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveConnectivityConfigurationsSamples.java new file mode 100644 index 0000000000000..300abddc64a4a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveConnectivityConfigurationsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ActiveConfigurationParameter; +import java.util.Arrays; + +/** + * Samples for ResourceProvider ListActiveConnectivityConfigurations. + */ +public final class ResourceProviderListActiveConnectivityConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerActiveConnectivityConfigurationsList.json + */ + /** + * Sample code: List Active Connectivity Configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listActiveConnectivityConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listActiveConnectivityConfigurationsWithResponse("myResourceGroup", "testNetworkManager", + new ActiveConfigurationParameter().withRegions(Arrays.asList("westus")) + .withSkipToken("fakeTokenPlaceholder"), + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveSecurityAdminRulesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveSecurityAdminRulesSamples.java new file mode 100644 index 0000000000000..f24d4d96fabee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListActiveSecurityAdminRulesSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ActiveConfigurationParameter; +import java.util.Arrays; + +/** + * Samples for ResourceProvider ListActiveSecurityAdminRules. + */ +public final class ResourceProviderListActiveSecurityAdminRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerActiveSecurityAdminRulesList.json + */ + /** + * Sample code: List Active Security Admin Rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listActiveSecurityAdminRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listActiveSecurityAdminRulesWithResponse("myResourceGroup", "testNetworkManager", + new ActiveConfigurationParameter().withRegions(Arrays.asList("westus")) + .withSkipToken("fakeTokenPlaceholder"), + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples.java new file mode 100644 index 0000000000000..3feb6b7ca3c35 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.QueryRequestOptions; + +/** + * Samples for ResourceProvider ListNetworkManagerEffectiveConnectivityConfigurations. + */ +public final class ResourceProviderListNetworkManagerEffectiveConnectivityConfigurationsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerEffectiveConnectivityConfigurationsList.json + */ + /** + * Sample code: List effective connectivity configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listEffectiveConnectivityConfiguration(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listNetworkManagerEffectiveConnectivityConfigurationsWithResponse("myResourceGroup", "testVirtualNetwork", + new QueryRequestOptions().withSkipToken("fakeTokenPlaceholder"), null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples.java new file mode 100644 index 0000000000000..60e65b89127b0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.QueryRequestOptions; + +/** + * Samples for ResourceProvider ListNetworkManagerEffectiveSecurityAdminRules. + */ +public final class ResourceProviderListNetworkManagerEffectiveSecurityAdminRulesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerEffectiveSecurityAdminRulesList.json + */ + /** + * Sample code: List effective security admin rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listEffectiveSecurityAdminRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .listNetworkManagerEffectiveSecurityAdminRulesWithResponse("myResourceGroup", "testVirtualNetwork", + new QueryRequestOptions().withSkipToken("fakeTokenPlaceholder"), null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderPutBastionShareableLinkSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderPutBastionShareableLinkSamples.java new file mode 100644 index 0000000000000..a28043efd82c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderPutBastionShareableLinkSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.BastionShareableLinkInner; +import com.azure.resourcemanager.network.generated.models.BastionShareableLinkListRequest; +import com.azure.resourcemanager.network.generated.models.VM; +import java.util.Arrays; + +/** + * Samples for ResourceProvider PutBastionShareableLink. + */ +public final class ResourceProviderPutBastionShareableLinkSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/BastionShareableLinkCreate. + * json + */ + /** + * Sample code: Create Bastion Shareable Links for the request VMs. + * + * @param manager Entry point to NetworkManager. + */ + public static void createBastionShareableLinksForTheRequestVMs( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .putBastionShareableLink("rg1", "bastionhosttenant", + new BastionShareableLinkListRequest().withVms(Arrays.asList( + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1")), + new BastionShareableLinkInner().withVm(new VM().withId( + "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderSupportedSecurityProvidersSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderSupportedSecurityProvidersSamples.java new file mode 100644 index 0000000000000..26a505e12b091 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ResourceProviderSupportedSecurityProvidersSamples.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.generated; + +/** + * Samples for ResourceProvider SupportedSecurityProviders. + */ +public final class ResourceProviderSupportedSecurityProvidersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualWanSupportedSecurityProviders.json + */ + /** + * Sample code: supportedSecurityProviders. + * + * @param manager Entry point to NetworkManager. + */ + public static void supportedSecurityProviders(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.resourceProviders() + .supportedSecurityProvidersWithResponse("rg1", "wan1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..00efc7dbb4837 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import java.util.Arrays; + +/** + * Samples for RouteFilterRules CreateOrUpdate. + */ +public final class RouteFilterRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterRuleCreate.json + */ + /** + * Sample code: RouteFilterRuleCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterRuleCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules() + .createOrUpdate("rg1", "filterName", "ruleName", + new RouteFilterRuleInner().withAccess(Access.ALLOW) + .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY) + .withCommunities(Arrays.asList("12076:5030", "12076:5040")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesDeleteSamples.java new file mode 100644 index 0000000000000..08a1c83cf6ccc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteFilterRules Delete. + */ +public final class RouteFilterRulesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterRuleDelete.json + */ + /** + * Sample code: RouteFilterRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules().delete("rg1", "filterName", "ruleName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesGetSamples.java new file mode 100644 index 0000000000000..d3524d69093d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteFilterRules Get. + */ +public final class RouteFilterRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterRuleGet.json + */ + /** + * Sample code: RouteFilterRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules().getWithResponse("rg1", "filterName", "filterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesListByRouteFilterSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesListByRouteFilterSamples.java new file mode 100644 index 0000000000000..3c474dbf02f7b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFilterRulesListByRouteFilterSamples.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.generated; + +/** + * Samples for RouteFilterRules ListByRouteFilter. + */ +public final class RouteFilterRulesListByRouteFilterSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * RouteFilterRuleListByRouteFilter.json + */ + /** + * Sample code: RouteFilterRuleListByRouteFilter. + * + * @param manager Entry point to NetworkManager. + */ + public static void + routeFilterRuleListByRouteFilter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilterRules().listByRouteFilter("rg1", "filterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..fad14d5e4bec5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteFilterRuleInner; +import com.azure.resourcemanager.network.generated.models.Access; +import com.azure.resourcemanager.network.generated.models.RouteFilterRuleType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RouteFilters CreateOrUpdate. + */ +public final class RouteFiltersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterCreate.json + */ + /** + * Sample code: RouteFilterCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters() + .define("filterName") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withRules(Arrays.asList(new RouteFilterRuleInner().withName("ruleName") + .withAccess(Access.ALLOW) + .withRouteFilterRuleType(RouteFilterRuleType.COMMUNITY) + .withCommunities(Arrays.asList("12076:5030", "12076:5040")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersDeleteSamples.java new file mode 100644 index 0000000000000..70a3e7ee9b852 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteFilters Delete. + */ +public final class RouteFiltersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterDelete.json + */ + /** + * Sample code: RouteFilterDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters().delete("rg1", "filterName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..e19f31f9c2364 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersGetByResourceGroupSamples.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.generated; + +/** + * Samples for RouteFilters GetByResourceGroup. + */ +public final class RouteFiltersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterGet.json + */ + /** + * Sample code: RouteFilterGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters() + .getByResourceGroupWithResponse("rg1", "filterName", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d811436561acb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListByResourceGroupSamples.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.generated; + +/** + * Samples for RouteFilters ListByResourceGroup. + */ +public final class RouteFiltersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * RouteFilterListByResourceGroup.json + */ + /** + * Sample code: RouteFilterListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + routeFilterListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListSamples.java new file mode 100644 index 0000000000000..ddb23f2ad81b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteFilters List. + */ +public final class RouteFiltersListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterList.json + */ + /** + * Sample code: RouteFilterList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeFilterList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeFilters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersUpdateTagsSamples.java new file mode 100644 index 0000000000000..23ccf48b29671 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteFiltersUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.RouteFilter; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RouteFilters UpdateTags. + */ +public final class RouteFiltersUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteFilterUpdateTags.json + */ + /** + * Sample code: Update route filter tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateRouteFilterTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + RouteFilter resource = manager.routeFilters() + .getByResourceGroupWithResponse("rg1", "filterName", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..fa1063d8f9edb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.Action; +import com.azure.resourcemanager.network.generated.models.Criterion; +import com.azure.resourcemanager.network.generated.models.NextStep; +import com.azure.resourcemanager.network.generated.models.Parameter; +import com.azure.resourcemanager.network.generated.models.RouteMapActionType; +import com.azure.resourcemanager.network.generated.models.RouteMapMatchCondition; +import com.azure.resourcemanager.network.generated.models.RouteMapRule; +import java.util.Arrays; + +/** + * Samples for RouteMaps CreateOrUpdate. + */ +public final class RouteMapsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapPut.json + */ + /** + * Sample code: RouteMapPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps() + .define("routeMap1") + .withExistingVirtualHub("rg1", "virtualHub1") + .withAssociatedInboundConnections(Arrays.asList( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1")) + .withAssociatedOutboundConnections(Arrays.asList()) + .withRules(Arrays.asList(new RouteMapRule().withName("rule1") + .withMatchCriteria(Arrays.asList(new Criterion().withRoutePrefix(Arrays.asList("10.0.0.0/8")) + .withCommunity(Arrays.asList()) + .withAsPath(Arrays.asList()) + .withMatchCondition(RouteMapMatchCondition.CONTAINS))) + .withActions(Arrays.asList(new Action().withType(RouteMapActionType.ADD) + .withParameters(Arrays.asList(new Parameter().withRoutePrefix(Arrays.asList()) + .withCommunity(Arrays.asList()) + .withAsPath(Arrays.asList("22334")))))) + .withNextStepIfMatched(NextStep.CONTINUE))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsDeleteSamples.java new file mode 100644 index 0000000000000..86427a2a80632 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteMaps Delete. + */ +public final class RouteMapsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapDelete.json + */ + /** + * Sample code: RouteMapDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps().delete("rg1", "virtualHub1", "routeMap1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsGetSamples.java new file mode 100644 index 0000000000000..d34b0bf648953 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteMaps Get. + */ +public final class RouteMapsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapGet.json + */ + /** + * Sample code: RouteMapGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps().getWithResponse("rg1", "virtualHub1", "routeMap1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsListSamples.java new file mode 100644 index 0000000000000..6d5e7394bc6ca --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteMapsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteMaps List. + */ +public final class RouteMapsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteMapList.json + */ + /** + * Sample code: RouteMapList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeMapList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeMaps().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c54b1964884fe --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.RouteInner; +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; +import java.util.Arrays; + +/** + * Samples for RouteTables CreateOrUpdate. + */ +public final class RouteTablesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableCreate.json + */ + /** + * Sample code: Create route table. + * + * @param manager Entry point to NetworkManager. + */ + public static void createRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().define("testrt").withRegion("westus").withExistingResourceGroup("rg1").create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableCreateWithRoute. + * json + */ + /** + * Sample code: Create route table with route. + * + * @param manager Entry point to NetworkManager. + */ + public static void createRouteTableWithRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables() + .define("testrt") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withRoutes(Arrays.asList(new RouteInner().withName("route1") + .withAddressPrefix("10.0.3.0/24") + .withNextHopType(RouteNextHopType.VIRTUAL_NETWORK_GATEWAY))) + .withDisableBgpRoutePropagation(true) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesDeleteSamples.java new file mode 100644 index 0000000000000..9afc90333eeb3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteTables Delete. + */ +public final class RouteTablesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableDelete.json + */ + /** + * Sample code: Delete route table. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().delete("rg1", "testrt", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..f4a70d5332309 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteTables GetByResourceGroup. + */ +public final class RouteTablesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableGet.json + */ + /** + * Sample code: Get route table. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRouteTable(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().getByResourceGroupWithResponse("rg1", "testrt", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a888e9bc1c677 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListByResourceGroupSamples.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.generated; + +/** + * Samples for RouteTables ListByResourceGroup. + */ +public final class RouteTablesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableList.json + */ + /** + * Sample code: List route tables in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listRouteTablesInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListSamples.java new file mode 100644 index 0000000000000..93560d0a6a6e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RouteTables List. + */ +public final class RouteTablesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableListAll.json + */ + /** + * Sample code: List all route tables. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllRouteTables(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routeTables().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesUpdateTagsSamples.java new file mode 100644 index 0000000000000..643b2859182e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RouteTablesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.RouteTable; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RouteTables UpdateTags. + */ +public final class RouteTablesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableUpdateTags.json + */ + /** + * Sample code: Update route table tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateRouteTableTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + RouteTable resource = manager.routeTables() + .getByResourceGroupWithResponse("rg1", "testrt", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..cda9ec69ce563 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.RouteNextHopType; + +/** + * Samples for Routes CreateOrUpdate. + */ +public final class RoutesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteCreate.json + */ + /** + * Sample code: Create route. + * + * @param manager Entry point to NetworkManager. + */ + public static void createRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes() + .define("route1") + .withExistingRouteTable("rg1", "testrt") + .withAddressPrefix("10.0.3.0/24") + .withNextHopType(RouteNextHopType.VIRTUAL_NETWORK_GATEWAY) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesDeleteSamples.java new file mode 100644 index 0000000000000..3586306cf9b51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for Routes Delete. + */ +public final class RoutesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteDelete.json + */ + /** + * Sample code: Delete route. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes().delete("rg1", "testrt", "route1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesGetSamples.java new file mode 100644 index 0000000000000..c805c54135158 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for Routes Get. + */ +public final class RoutesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteGet.json + */ + /** + * Sample code: Get route. + * + * @param manager Entry point to NetworkManager. + */ + public static void getRoute(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes().getWithResponse("rg1", "testrt", "route1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesListSamples.java new file mode 100644 index 0000000000000..ab1a23fb4841c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for Routes List. + */ +public final class RoutesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RouteTableRouteList.json + */ + /** + * Sample code: List routes. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routes().list("rg1", "testrt", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e164fffe7e3d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.RoutingPolicy; +import java.util.Arrays; + +/** + * Samples for RoutingIntent CreateOrUpdate. + */ +public final class RoutingIntentCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentPut.json + */ + /** + * Sample code: RouteTablePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTablePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents() + .define("Intent1") + .withExistingVirtualHub("rg1", "virtualHub1") + .withRoutingPolicies(Arrays.asList( + new RoutingPolicy().withName("InternetTraffic") + .withDestinations(Arrays.asList("Internet")) + .withNextHop( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"), + new RoutingPolicy().withName("PrivateTrafficPolicy") + .withDestinations(Arrays.asList("PrivateTraffic")) + .withNextHop( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/azureFirewalls/azfw1"))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentDeleteSamples.java new file mode 100644 index 0000000000000..043c9bc50376a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RoutingIntent Delete. + */ +public final class RoutingIntentDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentDelete.json + */ + /** + * Sample code: RouteTableDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents().delete("rg1", "virtualHub1", "Intent1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentGetSamples.java new file mode 100644 index 0000000000000..6a4c704678cb6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RoutingIntent Get. + */ +public final class RoutingIntentGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentGet.json + */ + /** + * Sample code: RouteTableGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void routeTableGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents().getWithResponse("rg1", "virtualHub1", "Intent1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentListSamples.java new file mode 100644 index 0000000000000..54422a0c15d17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingIntentListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for RoutingIntent List. + */ +public final class RoutingIntentListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/RoutingIntentList.json + */ + /** + * Sample code: RoutingIntentList. + * + * @param manager Entry point to NetworkManager. + */ + public static void routingIntentList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingIntents().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d0269313ef1d5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkManagerRoutingGroupItem; +import java.util.Arrays; + +/** + * Samples for RoutingRuleCollections CreateOrUpdate. + */ +public final class RoutingRuleCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionPut.json + */ + /** + * Sample code: Create or Update a routing rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateARoutingRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .define("testRuleCollection") + .withExistingRoutingConfiguration("rg1", "testNetworkManager", "myTestRoutingConfig") + .withDescription("A sample policy") + .withAppliesTo(Arrays.asList(new NetworkManagerRoutingGroupItem().withNetworkGroupId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsDeleteSamples.java new file mode 100644 index 0000000000000..f69dd65631573 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsDeleteSamples.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.generated; + +/** + * Samples for RoutingRuleCollections Delete. + */ +public final class RoutingRuleCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionDelete.json + */ + /** + * Sample code: Deletes an routing rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesAnRoutingRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .delete("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsGetSamples.java new file mode 100644 index 0000000000000..e4bba9e8fb2b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsGetSamples.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.generated; + +/** + * Samples for RoutingRuleCollections Get. + */ +public final class RoutingRuleCollectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionGet.json + */ + /** + * Sample code: Gets routing rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsRoutingRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .getWithResponse("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsListSamples.java new file mode 100644 index 0000000000000..e9e270519206f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRuleCollectionsListSamples.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.generated; + +/** + * Samples for RoutingRuleCollections List. + */ +public final class RoutingRuleCollectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleCollectionList.json + */ + /** + * Sample code: List routing rule collections. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRoutingRuleCollections(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRuleCollections() + .list("rg1", "testNetworkManager", "myTestRoutingConfig", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..6e7286abde1e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.RoutingRuleDestinationType; +import com.azure.resourcemanager.network.generated.models.RoutingRuleNextHop; +import com.azure.resourcemanager.network.generated.models.RoutingRuleNextHopType; +import com.azure.resourcemanager.network.generated.models.RoutingRuleRouteDestination; + +/** + * Samples for RoutingRules CreateOrUpdate. + */ +public final class RoutingRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRulePut. + * json + */ + /** + * Sample code: Create an routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createAnRoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .define("SampleRoutingRule") + .withExistingRuleCollection("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection") + .withDescription("This is Sample Routing Rule") + .withDestination(new RoutingRuleRouteDestination().withType(RoutingRuleDestinationType.ADDRESS_PREFIX) + .withDestinationAddress("10.0.0.0/16")) + .withNextHop(new RoutingRuleNextHop().withNextHopType(RoutingRuleNextHopType.VIRTUAL_NETWORK_GATEWAY)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRulePut. + * json + */ + /** + * Sample code: Create a default routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createADefaultRoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .define("SampleRoutingRule") + .withExistingRuleCollection("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection") + .withDescription("This is Sample Routing Rule") + .withDestination(new RoutingRuleRouteDestination().withType(RoutingRuleDestinationType.ADDRESS_PREFIX) + .withDestinationAddress("10.0.0.0/16")) + .withNextHop(new RoutingRuleNextHop().withNextHopType(RoutingRuleNextHopType.VIRTUAL_NETWORK_GATEWAY)) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesDeleteSamples.java new file mode 100644 index 0000000000000..fe6f3c9948b00 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesDeleteSamples.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.generated; + +/** + * Samples for RoutingRules Delete. + */ +public final class RoutingRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerRoutingRuleDelete.json + */ + /** + * Sample code: Deletes a routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletesARoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .delete("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", "sampleRule", false, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesGetSamples.java new file mode 100644 index 0000000000000..9a527fea4426a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesGetSamples.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.generated; + +/** + * Samples for RoutingRules Get. + */ +public final class RoutingRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRuleGet. + * json + */ + /** + * Sample code: Gets routing rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsRoutingRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleRoutingRule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesListSamples.java new file mode 100644 index 0000000000000..88c1cf72552be --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/RoutingRulesListSamples.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.generated; + +/** + * Samples for RoutingRules List. + */ +public final class RoutingRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerRoutingRuleList + * .json + */ + /** + * Sample code: List routing rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRoutingRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.routingRules() + .list("rg1", "testNetworkManager", "myTestRoutingConfig", "testRuleCollection", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..80dbcde5ea033 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ScopeConnections CreateOrUpdate. + */ +public final class ScopeConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionPut.json + */ + /** + * Sample code: Create or Update Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateNetworkManagerScopeConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections() + .define("TestScopeConnection") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withTenantId("6babcaad-604b-40ac-a9d7-9fd97c0b779f") + .withResourceId("subscriptions/f0dc2b34-dfad-40e4-83e0-2309fed8d00b") + .withDescription("This is a scope connection to a cross tenant subscription.") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..f43f388016212 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsDeleteSamples.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.generated; + +/** + * Samples for ScopeConnections Delete. + */ +public final class ScopeConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionDelete.json + */ + /** + * Sample code: Delete Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkManagerScopeConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections() + .deleteWithResponse("rg1", "testNetworkManager", "TestScopeConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsGetSamples.java new file mode 100644 index 0000000000000..a1fe77cb718d6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsGetSamples.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.generated; + +/** + * Samples for ScopeConnections Get. + */ +public final class ScopeConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionGet.json + */ + /** + * Sample code: Get Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getNetworkManagerScopeConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections() + .getWithResponse("rg1", "testNetworkManager", "TestScopeConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsListSamples.java new file mode 100644 index 0000000000000..362b4bece3c6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ScopeConnectionsListSamples.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.generated; + +/** + * Samples for ScopeConnections List. + */ +public final class ScopeConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerScopeConnectionList.json + */ + /** + * Sample code: List Network Manager Scope Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listNetworkManagerScopeConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.scopeConnections().list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..399cac5018598 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.NetworkIntentPolicyBasedService; +import java.util.Arrays; + +/** + * Samples for SecurityAdminConfigurations CreateOrUpdate. + */ +public final class SecurityAdminConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationPut.json + */ + /** + * Sample code: Create network manager security admin configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkManagerSecurityAdminConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .define("myTestSecurityConfig") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample policy") + .withApplyOnNetworkIntentPolicyBasedServices(Arrays.asList(NetworkIntentPolicyBasedService.NONE)) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..cc00a32a30103 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsDeleteSamples.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.generated; + +/** + * Samples for SecurityAdminConfigurations Delete. + */ +public final class SecurityAdminConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationDelete.json + */ + /** + * Sample code: Delete network manager security admin configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkManagerSecurityAdminConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", false, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsGetSamples.java new file mode 100644 index 0000000000000..4066528526068 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsGetSamples.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.generated; + +/** + * Samples for SecurityAdminConfigurations Get. + */ +public final class SecurityAdminConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationGet.json + */ + /** + * Sample code: Get security admin configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getSecurityAdminConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsListSamples.java new file mode 100644 index 0000000000000..31ecd6c674091 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityAdminConfigurationsListSamples.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.generated; + +/** + * Samples for SecurityAdminConfigurations List. + */ +public final class SecurityAdminConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityAdminConfigurationList.json + */ + /** + * Sample code: List security admin configurations in a network manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityAdminConfigurationsInANetworkManager( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityAdminConfigurations() + .list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4dd576a93fb59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.SecurityProviderName; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecurityPartnerProviders CreateOrUpdate. + */ +public final class SecurityPartnerProvidersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SecurityPartnerProviderPut. + * json + */ + /** + * Sample code: Create Security Partner Provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSecurityPartnerProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders() + .define("securityPartnerProvider") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withSecurityProviderName(SecurityProviderName.ZSCALER) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersDeleteSamples.java new file mode 100644 index 0000000000000..0e355cf6692a1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersDeleteSamples.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.generated; + +/** + * Samples for SecurityPartnerProviders Delete. + */ +public final class SecurityPartnerProvidersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SecurityPartnerProviderDelete + * .json + */ + /** + * Sample code: Delete Security Partner Provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteSecurityPartnerProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders().delete("rg1", "securityPartnerProvider", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..87717a7a56640 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersGetByResourceGroupSamples.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.generated; + +/** + * Samples for SecurityPartnerProviders GetByResourceGroup. + */ +public final class SecurityPartnerProvidersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SecurityPartnerProviderGet. + * json + */ + /** + * Sample code: Get Security Partner Provider. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSecurityPartnerProvider(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders() + .getByResourceGroupWithResponse("rg1", "securityPartnerProvider", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a811339efe141 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListByResourceGroupSamples.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.generated; + +/** + * Samples for SecurityPartnerProviders ListByResourceGroup. + */ +public final class SecurityPartnerProvidersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SecurityPartnerProviderListByResourceGroup.json + */ + /** + * Sample code: List all Security Partner Providers for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllSecurityPartnerProvidersForAGivenResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListSamples.java new file mode 100644 index 0000000000000..49b28ef34efd7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersListSamples.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.generated; + +/** + * Samples for SecurityPartnerProviders List. + */ +public final class SecurityPartnerProvidersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SecurityPartnerProviderListBySubscription.json + */ + /** + * Sample code: List all Security Partner Providers for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllSecurityPartnerProvidersForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityPartnerProviders().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersUpdateTagsSamples.java new file mode 100644 index 0000000000000..b2b994e8d3351 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityPartnerProvidersUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.SecurityPartnerProvider; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecurityPartnerProviders UpdateTags. + */ +public final class SecurityPartnerProvidersUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SecurityPartnerProviderUpdateTags.json + */ + /** + * Sample code: Update Security Partner Provider Tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateSecurityPartnerProviderTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + SecurityPartnerProvider resource = manager.securityPartnerProviders() + .getByResourceGroupWithResponse("rg1", "securityPartnerProvider", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..854ad9b8888fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.SecurityRuleAccess; +import com.azure.resourcemanager.network.generated.models.SecurityRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityRuleProtocol; + +/** + * Samples for SecurityRules CreateOrUpdate. + */ +public final class SecurityRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupRuleCreate.json + */ + /** + * Sample code: Create security rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSecurityRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules() + .define("rule1") + .withExistingNetworkSecurityGroup("rg1", "testnsg") + .withProtocol(SecurityRuleProtocol.ASTERISK) + .withSourcePortRange("*") + .withDestinationPortRange("8080") + .withSourceAddressPrefix("10.0.0.0/8") + .withDestinationAddressPrefix("11.0.0.0/8") + .withAccess(SecurityRuleAccess.DENY) + .withPriority(100) + .withDirection(SecurityRuleDirection.OUTBOUND) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesDeleteSamples.java new file mode 100644 index 0000000000000..314a9939af7e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesDeleteSamples.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.generated; + +/** + * Samples for SecurityRules Delete. + */ +public final class SecurityRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkSecurityGroupRuleDelete.json + */ + /** + * Sample code: Delete network security rule from network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkSecurityRuleFromNetworkSecurityGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules().delete("rg1", "testnsg", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesGetSamples.java new file mode 100644 index 0000000000000..86ec7e83cf3ac --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesGetSamples.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.generated; + +/** + * Samples for SecurityRules Get. + */ +public final class SecurityRulesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupRuleGet. + * json + */ + /** + * Sample code: Get network security rule in network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void getNetworkSecurityRuleInNetworkSecurityGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules().getWithResponse("rg1", "testnsg", "rule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesListSamples.java new file mode 100644 index 0000000000000..4c42f3fbf2caf --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityRulesListSamples.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.generated; + +/** + * Samples for SecurityRules List. + */ +public final class SecurityRulesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkSecurityGroupRuleList. + * json + */ + /** + * Sample code: List network security rules in network security group. + * + * @param manager Entry point to NetworkManager. + */ + public static void listNetworkSecurityRulesInNetworkSecurityGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityRules().list("rg1", "testnsg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3a3c9c574ecd5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for SecurityUserConfigurations CreateOrUpdate. + */ +public final class SecurityUserConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationPut.json + */ + /** + * Sample code: Create network manager security user configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void createNetworkManagerSecurityUserConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .define("myTestSecurityConfig") + .withExistingNetworkManager("rg1", "testNetworkManager") + .withDescription("A sample policy") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..17363f32531a6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsDeleteSamples.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.generated; + +/** + * Samples for SecurityUserConfigurations Delete. + */ +public final class SecurityUserConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationDelete.json + */ + /** + * Sample code: Delete network manager security user configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteNetworkManagerSecurityUserConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", false, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsGetSamples.java new file mode 100644 index 0000000000000..f5e9bd61eceab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsGetSamples.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.generated; + +/** + * Samples for SecurityUserConfigurations Get. + */ +public final class SecurityUserConfigurationsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationGet.json + */ + /** + * Sample code: Get security user configurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getSecurityUserConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsListSamples.java new file mode 100644 index 0000000000000..b55c297f6742b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserConfigurationsListSamples.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.generated; + +/** + * Samples for SecurityUserConfigurations List. + */ +public final class SecurityUserConfigurationsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserConfigurationList.json + */ + /** + * Sample code: List security user configurations in a network manager. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityUserConfigurationsInANetworkManager( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserConfigurations() + .list("rg1", "testNetworkManager", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..13b552da959c4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.SecurityUserGroupItem; +import java.util.Arrays; + +/** + * Samples for SecurityUserRuleCollections CreateOrUpdate. + */ +public final class SecurityUserRuleCollectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionPut.json + */ + /** + * Sample code: Create or Update a Security User Rule Collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createOrUpdateASecurityUserRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .define("testRuleCollection") + .withExistingSecurityUserConfiguration("rg1", "testNetworkManager", "myTestSecurityConfig") + .withDescription("A sample policy") + .withAppliesToGroups(Arrays.asList(new SecurityUserGroupItem().withNetworkGroupId( + "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsDeleteSamples.java new file mode 100644 index 0000000000000..2e31d09bbd897 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsDeleteSamples.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.generated; + +/** + * Samples for SecurityUserRuleCollections Delete. + */ +public final class SecurityUserRuleCollectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionDelete.json + */ + /** + * Sample code: Deletes a Security User Rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesASecurityUserRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", false, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsGetSamples.java new file mode 100644 index 0000000000000..542841a336180 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsGetSamples.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.generated; + +/** + * Samples for SecurityUserRuleCollections Get. + */ +public final class SecurityUserRuleCollectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionGet.json + */ + /** + * Sample code: Gets security user rule collection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsSecurityUserRuleCollection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsListSamples.java new file mode 100644 index 0000000000000..e99ef99393c1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRuleCollectionsListSamples.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.generated; + +/** + * Samples for SecurityUserRuleCollections List. + */ +public final class SecurityUserRuleCollectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleCollectionList.json + */ + /** + * Sample code: List rule collections in a security configuration. + * + * @param manager Entry point to NetworkManager. + */ + public static void listRuleCollectionsInASecurityConfiguration( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRuleCollections() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7320e05abb008 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.AddressPrefixItem; +import com.azure.resourcemanager.network.generated.models.AddressPrefixType; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleDirection; +import com.azure.resourcemanager.network.generated.models.SecurityConfigurationRuleProtocol; +import java.util.Arrays; + +/** + * Samples for SecurityUserRules CreateOrUpdate. + */ +public final class SecurityUserRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRulePut.json + */ + /** + * Sample code: Create a security user rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void createASecurityUserRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .define("SampleUserRule") + .withExistingRuleCollection("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection") + .withDescription("Sample User Rule") + .withProtocol(SecurityConfigurationRuleProtocol.TCP) + .withSources(Arrays.asList( + new AddressPrefixItem().withAddressPrefix("*").withAddressPrefixType(AddressPrefixType.IPPREFIX))) + .withDestinations(Arrays.asList( + new AddressPrefixItem().withAddressPrefix("*").withAddressPrefixType(AddressPrefixType.IPPREFIX))) + .withSourcePortRanges(Arrays.asList("0-65535")) + .withDestinationPortRanges(Arrays.asList("22")) + .withDirection(SecurityConfigurationRuleDirection.INBOUND) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesDeleteSamples.java new file mode 100644 index 0000000000000..60be5197b23c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesDeleteSamples.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.generated; + +/** + * Samples for SecurityUserRules Delete. + */ +public final class SecurityUserRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleDelete.json + */ + /** + * Sample code: Delete a security user rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteASecurityUserRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .delete("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", "SampleUserRule", false, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesGetSamples.java new file mode 100644 index 0000000000000..c1416f4c86b10 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesGetSamples.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.generated; + +/** + * Samples for SecurityUserRules Get. + */ +public final class SecurityUserRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleGet.json + */ + /** + * Sample code: Gets a security user rule. + * + * @param manager Entry point to NetworkManager. + */ + public static void getsASecurityUserRule(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .getWithResponse("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", + "SampleUserRule", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesListSamples.java new file mode 100644 index 0000000000000..dfe35cac89671 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SecurityUserRulesListSamples.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.generated; + +/** + * Samples for SecurityUserRules List. + */ +public final class SecurityUserRulesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerSecurityUserRuleList.json + */ + /** + * Sample code: List security user rules. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSecurityUserRules(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.securityUserRules() + .list("rg1", "testNetworkManager", "myTestSecurityConfig", "testRuleCollection", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceAssociationLinksListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceAssociationLinksListSamples.java new file mode 100644 index 0000000000000..33ab55502a46f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceAssociationLinksListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ServiceAssociationLinks List. + */ +public final class ServiceAssociationLinksListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetServiceAssociationLinks.json + */ + /** + * Sample code: Get Service Association Links. + * + * @param manager Entry point to NetworkManager. + */ + public static void getServiceAssociationLinks(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceAssociationLinks().listWithResponse("rg1", "vnet", "subnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..af32675763ad8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ServiceEndpointPolicyDefinitionInner; +import java.util.Arrays; + +/** + * Samples for ServiceEndpointPolicies CreateOrUpdate. + */ +public final class ServiceEndpointPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyCreate. + * json + */ + /** + * Sample code: Create service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies() + .define("testPolicy") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyCreateWithDefinition.json + */ + /** + * Sample code: Create service endpoint policy with definition. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createServiceEndpointPolicyWithDefinition(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies() + .define("testPolicy") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withServiceEndpointPolicyDefinitions(Arrays.asList(new ServiceEndpointPolicyDefinitionInner() + .withName("StorageServiceEndpointPolicyDefinition") + .withDescription("Storage Service EndpointPolicy Definition") + .withService("Microsoft.Storage") + .withServiceResources(Arrays.asList("/subscriptions/subid1", + "/subscriptions/subid1/resourceGroups/storageRg", + "/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..0499e93307a65 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesDeleteSamples.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.generated; + +/** + * Samples for ServiceEndpointPolicies Delete. + */ +public final class ServiceEndpointPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyDelete. + * json + */ + /** + * Sample code: Delete service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies().delete("rg1", "serviceEndpointPolicy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..23c28624ff50a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesGetByResourceGroupSamples.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.generated; + +/** + * Samples for ServiceEndpointPolicies GetByResourceGroup. + */ +public final class ServiceEndpointPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyGet.json + */ + /** + * Sample code: Get service endPoint Policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getServiceEndPointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies() + .getByResourceGroupWithResponse("rg1", "testServiceEndpointPolicy", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..c76bd28c65d97 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListByResourceGroupSamples.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.generated; + +/** + * Samples for ServiceEndpointPolicies ListByResourceGroup. + */ +public final class ServiceEndpointPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyList. + * json + */ + /** + * Sample code: List resource group service endpoint policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listResourceGroupServiceEndpointPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListSamples.java new file mode 100644 index 0000000000000..c98f1da4e9d67 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesListSamples.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.generated; + +/** + * Samples for ServiceEndpointPolicies List. + */ +public final class ServiceEndpointPoliciesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceEndpointPolicyListAll. + * json + */ + /** + * Sample code: List all service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllServiceEndpointPolicy(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesUpdateTagsSamples.java new file mode 100644 index 0000000000000..b99816556e46e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPoliciesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPolicy; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ServiceEndpointPolicies UpdateTags. + */ +public final class ServiceEndpointPoliciesUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyUpdateTags.json + */ + /** + * Sample code: Update service endpoint policy tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateServiceEndpointPolicyTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + ServiceEndpointPolicy resource = manager.serviceEndpointPolicies() + .getByResourceGroupWithResponse("rg1", "testServiceEndpointPolicy", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f8326b8dea71e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples.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.generated; + +import java.util.Arrays; + +/** + * Samples for ServiceEndpointPolicyDefinitions CreateOrUpdate. + */ +public final class ServiceEndpointPolicyDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionCreate.json + */ + /** + * Sample code: Create service endpoint policy definition. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createServiceEndpointPolicyDefinition(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .define("testDefinition") + .withExistingServiceEndpointPolicy("rg1", "testPolicy") + .withDescription("Storage Service EndpointPolicy Definition") + .withService("Microsoft.Storage") + .withServiceResources(Arrays.asList("/subscriptions/subid1", + "/subscriptions/subid1/resourceGroups/storageRg", + "/subscriptions/subid1/resourceGroups/storageRg/providers/Microsoft.Storage/storageAccounts/stAccount")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsDeleteSamples.java new file mode 100644 index 0000000000000..8436d84e25dc7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsDeleteSamples.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.generated; + +/** + * Samples for ServiceEndpointPolicyDefinitions Delete. + */ +public final class ServiceEndpointPolicyDefinitionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionDelete.json + */ + /** + * Sample code: Delete service endpoint policy definitions from service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteServiceEndpointPolicyDefinitionsFromServiceEndpointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .delete("rg1", "testPolicy", "testDefinition", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsGetSamples.java new file mode 100644 index 0000000000000..b944d4024cddd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsGetSamples.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.generated; + +/** + * Samples for ServiceEndpointPolicyDefinitions Get. + */ +public final class ServiceEndpointPolicyDefinitionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionGet.json + */ + /** + * Sample code: Get service endpoint definition in service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void getServiceEndpointDefinitionInServiceEndpointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .getWithResponse("rg1", "testPolicy", "testDefinition", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a7c5efce5d766 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceEndpointPolicyDefinitionsListByResourceGroupSamples.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.generated; + +/** + * Samples for ServiceEndpointPolicyDefinitions ListByResourceGroup. + */ +public final class ServiceEndpointPolicyDefinitionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceEndpointPolicyDefinitionList.json + */ + /** + * Sample code: List service endpoint definitions in service end point policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void listServiceEndpointDefinitionsInServiceEndPointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceEndpointPolicyDefinitions() + .listByResourceGroup("rg1", "testPolicy", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagInformationListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagInformationListSamples.java new file mode 100644 index 0000000000000..2210f47acb30b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagInformationListSamples.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.generated; + +/** + * Samples for ServiceTagInformation List. + */ +public final class ServiceTagInformationListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceTagInformationListResultWithNoAddressPrefixes.json + */ + /** + * Sample code: Get list of service tags with no address prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getListOfServiceTagsWithNoAddressPrefixes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTagInformations().list("westeurope", true, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceTagInformationListResult.json + */ + /** + * Sample code: Get list of service tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfServiceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTagInformations().list("westeurope", null, null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * ServiceTagInformationListResultWithTagname.json + */ + /** + * Sample code: Get list of service tags with tag name. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getListOfServiceTagsWithTagName(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTagInformations().list("westeurope", null, "ApiManagement", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagsListSamples.java new file mode 100644 index 0000000000000..259fa1421c5f0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/ServiceTagsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for ServiceTags List. + */ +public final class ServiceTagsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ServiceTagsList.json + */ + /** + * Sample code: Get list of service tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void getListOfServiceTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.serviceTags().listWithResponse("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b0b9d0775cf8a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for StaticMembers CreateOrUpdate. + */ +public final class StaticMembersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerStaticMemberPut + * .json + */ + /** + * Sample code: StaticMemberPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMemberPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .define("testStaticMember") + .withExistingNetworkGroup("rg1", "testNetworkManager", "testNetworkGroup") + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersDeleteSamples.java new file mode 100644 index 0000000000000..f5faa7b2ba94c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersDeleteSamples.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.generated; + +/** + * Samples for StaticMembers Delete. + */ +public final class StaticMembersDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerStaticMemberDelete.json + */ + /** + * Sample code: StaticMembersDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMembersDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .deleteWithResponse("SampleRG", "TestNM", "testNetworkGroup", "testStaticMember", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersGetSamples.java new file mode 100644 index 0000000000000..c552e5a0ea9cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersGetSamples.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.generated; + +/** + * Samples for StaticMembers Get. + */ +public final class StaticMembersGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkManagerStaticMemberGet + * .json + */ + /** + * Sample code: StaticMembersGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMembersGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .getWithResponse("rg1", "testNetworkManager", "testNetworkGroup", "testStaticMember", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersListSamples.java new file mode 100644 index 0000000000000..b24bab56fd2d0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/StaticMembersListSamples.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.generated; + +/** + * Samples for StaticMembers List. + */ +public final class StaticMembersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerStaticMemberList.json + */ + /** + * Sample code: StaticMembersList. + * + * @param manager Entry point to NetworkManager. + */ + public static void staticMembersList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.staticMembers() + .list("rg1", "testNetworkManager", "testNetworkGroup", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a4dda35d1ca83 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import java.util.Arrays; + +/** + * Samples for Subnets CreateOrUpdate. + */ +public final class SubnetsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreate.json + */ + /** + * Sample code: Create subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SubnetCreateServiceEndpointNetworkIdentifier.json + */ + /** + * Sample code: Create subnet with service endpoints with network identifier. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnetWithServiceEndpointsWithNetworkIdentifier( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints(Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage") + .withNetworkIdentifier(new SubResource().withId( + "/subscriptions/subid/resourceGroups/subnet-test/providers/Microsoft.Network/publicIPAddresses/test-ip")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreateServiceEndpoint. + * json + */ + /** + * Sample code: Create subnet with service endpoints. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSubnetWithServiceEndpoints(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints(Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage"))) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreateWithDelegation. + * json + */ + /** + * Sample code: Create subnet with a delegation. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnetWithADelegation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetCreateWithSharingScope. + * json + */ + /** + * Sample code: Create subnet with sharing scope. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createSubnetWithSharingScope(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .define("subnet1") + .withExistingVirtualNetwork("subnet-test", "vnetname") + .withAddressPrefix("10.0.0.0/16") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsDeleteSamples.java new file mode 100644 index 0000000000000..8faafcf6cd4ce --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for Subnets Delete. + */ +public final class SubnetsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetDelete.json + */ + /** + * Sample code: Delete subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().delete("subnet-test", "vnetname", "subnet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsGetSamples.java new file mode 100644 index 0000000000000..4f9530b971a51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsGetSamples.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.generated; + +/** + * Samples for Subnets Get. + */ +public final class SubnetsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetGetWithSharingScope. + * json + */ + /** + * Sample code: Get subnet with sharing scope. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnetWithSharingScope(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetGet.json + */ + /** + * Sample code: Get subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetGetWithDelegation.json + */ + /** + * Sample code: Get subnet with a delegation. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnetWithADelegation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().getWithResponse("subnet-test", "vnetname", "subnet1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsListSamples.java new file mode 100644 index 0000000000000..0ecf1a295b93a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for Subnets List. + */ +public final class SubnetsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetList.json + */ + /** + * Sample code: List subnets. + * + * @param manager Entry point to NetworkManager. + */ + public static void listSubnets(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets().list("subnet-test", "vnetname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsPrepareNetworkPoliciesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsPrepareNetworkPoliciesSamples.java new file mode 100644 index 0000000000000..345dcb62674d2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsPrepareNetworkPoliciesSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.PrepareNetworkPoliciesRequest; + +/** + * Samples for Subnets PrepareNetworkPolicies. + */ +public final class SubnetsPrepareNetworkPoliciesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/SubnetPrepareNetworkPolicies. + * json + */ + /** + * Sample code: Prepare Network Policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void prepareNetworkPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .prepareNetworkPolicies("rg1", "test-vnet", "subnet1", + new PrepareNetworkPoliciesRequest().withServiceName("Microsoft.Sql/managedInstances"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsUnprepareNetworkPoliciesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsUnprepareNetworkPoliciesSamples.java new file mode 100644 index 0000000000000..40c3fc147e960 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubnetsUnprepareNetworkPoliciesSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.UnprepareNetworkPoliciesRequest; + +/** + * Samples for Subnets UnprepareNetworkPolicies. + */ +public final class SubnetsUnprepareNetworkPoliciesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * SubnetUnprepareNetworkPolicies.json + */ + /** + * Sample code: Unprepare Network Policies. + * + * @param manager Entry point to NetworkManager. + */ + public static void unprepareNetworkPolicies(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subnets() + .unprepareNetworkPolicies("rg1", "test-vnet", "subnet1", + new UnprepareNetworkPoliciesRequest().withServiceName("Microsoft.Sql/managedInstances"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7307a5a7e0562 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for SubscriptionNetworkManagerConnections CreateOrUpdate. + */ +public final class SubscriptionNetworkManagerConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionPut.json + */ + /** + * Sample code: Create or Update Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void createOrUpdateSubscriptionNetworkManagerConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections() + .define("TestNMConnection") + .withNetworkManagerId( + "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..35ec3ef123e71 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsDeleteSamples.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.generated; + +/** + * Samples for SubscriptionNetworkManagerConnections Delete. + */ +public final class SubscriptionNetworkManagerConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionDelete.json + */ + /** + * Sample code: Delete Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteSubscriptionNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections() + .deleteWithResponse("TestNMConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsGetSamples.java new file mode 100644 index 0000000000000..fcf5bc57d23cb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsGetSamples.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.generated; + +/** + * Samples for SubscriptionNetworkManagerConnections Get. + */ +public final class SubscriptionNetworkManagerConnectionsGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionGet.json + */ + /** + * Sample code: Get Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getSubscriptionNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections() + .getWithResponse("TestNMConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsListSamples.java new file mode 100644 index 0000000000000..8223beb222851 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/SubscriptionNetworkManagerConnectionsListSamples.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.generated; + +/** + * Samples for SubscriptionNetworkManagerConnections List. + */ +public final class SubscriptionNetworkManagerConnectionsListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkManagerConnectionSubscriptionList.json + */ + /** + * Sample code: List Subscription Network Manager Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listSubscriptionNetworkManagerConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.subscriptionNetworkManagerConnections().list(null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/UsagesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/UsagesListSamples.java new file mode 100644 index 0000000000000..23ae5ce7a8df9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/UsagesListSamples.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.generated; + +/** + * Samples for Usages List. + */ +public final class UsagesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/UsageList.json + */ + /** + * Sample code: List usages. + * + * @param manager Entry point to NetworkManager. + */ + public static void listUsages(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.usages().list("westus", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/UsageListSpacedLocation.json + */ + /** + * Sample code: List usages spaced location. + * + * @param manager Entry point to NetworkManager. + */ + public static void listUsagesSpacedLocation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.usages().list("West US", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapCreateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapCreateSamples.java new file mode 100644 index 0000000000000..9cdce0a7efa01 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapCreateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.SwapResourceInner; +import com.azure.resourcemanager.network.generated.models.SlotType; +import com.azure.resourcemanager.network.generated.models.SwapResourceProperties; + +/** + * Samples for VipSwap Create. + */ +public final class VipSwapCreateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServiceSwapPut.json + */ + /** + * Sample code: Put vip swap operation. + * + * @param manager Entry point to NetworkManager. + */ + public static void putVipSwapOperation(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vipSwaps() + .create("rg1", "testCloudService", + new SwapResourceInner().withProperties(new SwapResourceProperties().withSlotType(SlotType.PRODUCTION)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapGetSamples.java new file mode 100644 index 0000000000000..086bfec706278 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VipSwap Get. + */ +public final class VipSwapGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServiceSwapGet.json + */ + /** + * Sample code: Get swap resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSwapResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vipSwaps().getWithResponse("rg1", "testCloudService", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapListSamples.java new file mode 100644 index 0000000000000..3fb9b4c49354d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VipSwapListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VipSwap List. + */ +public final class VipSwapListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/CloudServiceSwapList.json + */ + /** + * Sample code: Get swap resource list. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSwapResourceList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vipSwaps().listWithResponse("rg1", "testCloudService", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..80e3b5cfc1551 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.BreakOutCategoryPolicies; +import com.azure.resourcemanager.network.generated.models.Office365PolicyProperties; + +/** + * Samples for VirtualApplianceSites CreateOrUpdate. + */ +public final class VirtualApplianceSitesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSitePut.json + */ + /** + * Sample code: Create Network Virtual Appliance Site. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createNetworkVirtualApplianceSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites() + .define("site1") + .withExistingNetworkVirtualAppliance("rg1", "nva") + .withAddressPrefix("192.168.1.0/24") + .withO365Policy(new Office365PolicyProperties().withBreakOutCategories( + new BreakOutCategoryPolicies().withAllow(true).withOptimize(true).withDefaultProperty(true))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesDeleteSamples.java new file mode 100644 index 0000000000000..610031d198c9a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesDeleteSamples.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.generated; + +/** + * Samples for VirtualApplianceSites Delete. + */ +public final class VirtualApplianceSitesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSiteDelete.json + */ + /** + * Sample code: Delete Network Virtual Appliance Site. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteNetworkVirtualApplianceSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites().delete("rg1", "nva", "site1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesGetSamples.java new file mode 100644 index 0000000000000..ab677ecd16d22 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesGetSamples.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.generated; + +/** + * Samples for VirtualApplianceSites Get. + */ +public final class VirtualApplianceSitesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSiteGet.json + */ + /** + * Sample code: GetNetwork Virtual Appliance Site. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getNetworkVirtualApplianceSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites().getWithResponse("rg1", "nva", "site1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesListSamples.java new file mode 100644 index 0000000000000..fb5d6f6e73edd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSitesListSamples.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.generated; + +/** + * Samples for VirtualApplianceSites List. + */ +public final class VirtualApplianceSitesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSiteList.json + */ + /** + * Sample code: List all Network Virtual Appliance sites for a given Network Virtual Appliance. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllNetworkVirtualApplianceSitesForAGivenNetworkVirtualAppliance( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSites().list("rg1", "nva", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusGetSamples.java new file mode 100644 index 0000000000000..013c53daa1cd2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusGetSamples.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.generated; + +/** + * Samples for VirtualApplianceSkus Get. + */ +public final class VirtualApplianceSkusGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/NetworkVirtualApplianceSkuGet + * .json + */ + /** + * Sample code: NetworkVirtualApplianceSkuGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceSkuGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSkus().getWithResponse("ciscoSdwan", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusListSamples.java new file mode 100644 index 0000000000000..4d341f07792e2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualApplianceSkusListSamples.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.generated; + +/** + * Samples for VirtualApplianceSkus List. + */ +public final class VirtualApplianceSkusListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * NetworkVirtualApplianceSkuList.json + */ + /** + * Sample code: NetworkVirtualApplianceSkuListResult. + * + * @param manager Entry point to NetworkManager. + */ + public static void + networkVirtualApplianceSkuListResult(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualApplianceSkus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..13ab14e611acd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; + +/** + * Samples for VirtualHubBgpConnections CreateOrUpdate. + */ +public final class VirtualHubBgpConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionPut. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2Put. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2Put(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections() + .define("conn1") + .withExistingVirtualHub("rg1", "hub1") + .withPeerAsn(20000L) + .withPeerIp("192.168.1.5") + .withHubVirtualNetworkConnection(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubVirtualNetworkConnections/hubVnetConn1")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..0452a5128e3b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsDeleteSamples.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.generated; + +/** + * Samples for VirtualHubBgpConnections Delete. + */ +public final class VirtualHubBgpConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionDelete + * .json + */ + /** + * Sample code: VirtualHubRouteTableV2Delete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubRouteTableV2Delete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections().delete("rg1", "hub1", "conn1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsGetSamples.java new file mode 100644 index 0000000000000..02f75a0667b18 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsGetSamples.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.generated; + +/** + * Samples for VirtualHubBgpConnections Get. + */ +public final class VirtualHubBgpConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionGet. + * json + */ + /** + * Sample code: VirtualHubVirtualHubRouteTableV2Get. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubVirtualHubRouteTableV2Get(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections().getWithResponse("rg1", "hub1", "conn1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListAdvertisedRoutesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListAdvertisedRoutesSamples.java new file mode 100644 index 0000000000000..5beef75ccf7ab --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListAdvertisedRoutesSamples.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.generated; + +/** + * Samples for VirtualHubBgpConnections ListAdvertisedRoutes. + */ +public final class VirtualHubBgpConnectionsListAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterPeerListAdvertisedRoute.json + */ + /** + * Sample code: VirtualRouterPeerListAdvertisedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualRouterPeerListAdvertisedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections() + .listAdvertisedRoutes("rg1", "virtualRouter1", "peer1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListLearnedRoutesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListLearnedRoutesSamples.java new file mode 100644 index 0000000000000..1a5a87cbb6de2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListLearnedRoutesSamples.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.generated; + +/** + * Samples for VirtualHubBgpConnections ListLearnedRoutes. + */ +public final class VirtualHubBgpConnectionsListLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterPeerListLearnedRoute.json + */ + /** + * Sample code: VirtualRouterPeerListLearnedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualRouterPeerListLearnedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections() + .listLearnedRoutes("rg1", "virtualRouter1", "peer1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListSamples.java new file mode 100644 index 0000000000000..3200134b96315 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubBgpConnectionsListSamples.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.generated; + +/** + * Samples for VirtualHubBgpConnections List. + */ +public final class VirtualHubBgpConnectionsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubBgpConnectionList. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2List. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubBgpConnections().list("rg1", "hub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..21bb9062fea40 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.SubnetInner; + +/** + * Samples for VirtualHubIpConfiguration CreateOrUpdate. + */ +public final class VirtualHubIpConfigurationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubIpConfigurationPut. + * json + */ + /** + * Sample code: VirtualHubIpConfigurationPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubIpConfigurationPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations() + .define("ipconfig1") + .withExistingVirtualHub("rg1", "hub1") + .withSubnet(new SubnetInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationDeleteSamples.java new file mode 100644 index 0000000000000..8f0a0990b0a51 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationDeleteSamples.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.generated; + +/** + * Samples for VirtualHubIpConfiguration Delete. + */ +public final class VirtualHubIpConfigurationDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualHubIpConfigurationDelete.json + */ + /** + * Sample code: VirtualHubIpConfigurationDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubIpConfigurationDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations().delete("rg1", "hub1", "ipconfig1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationGetSamples.java new file mode 100644 index 0000000000000..9b7db7c0654f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationGetSamples.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.generated; + +/** + * Samples for VirtualHubIpConfiguration Get. + */ +public final class VirtualHubIpConfigurationGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubIpConfigurationGet. + * json + */ + /** + * Sample code: VirtualHubVirtualHubRouteTableV2Get. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubVirtualHubRouteTableV2Get(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations() + .getWithResponse("rg1", "hub1", "ipconfig1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationListSamples.java new file mode 100644 index 0000000000000..7080110add8e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubIpConfigurationListSamples.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.generated; + +/** + * Samples for VirtualHubIpConfiguration List. + */ +public final class VirtualHubIpConfigurationListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubIpConfigurationList + * .json + */ + /** + * Sample code: VirtualHubRouteTableV2List. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubIpConfigurations().list("rg1", "hub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2d9574cd904b4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.VirtualHubRouteTableV2Inner; +import com.azure.resourcemanager.network.generated.models.VirtualHubRouteV2; +import java.util.Arrays; + +/** + * Samples for VirtualHubRouteTableV2S CreateOrUpdate. + */ +public final class VirtualHubRouteTableV2SCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2Put. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2Put. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2Put(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S() + .createOrUpdate("rg1", "virtualHub1", "virtualHubRouteTable1a", + new VirtualHubRouteTableV2Inner() + .withRoutes(Arrays.asList( + new VirtualHubRouteV2().withDestinationType("CIDR") + .withDestinations(Arrays.asList("20.10.0.0/16", "20.20.0.0/16")) + .withNextHopType("IPAddress") + .withNextHops(Arrays.asList("10.0.0.68")), + new VirtualHubRouteV2().withDestinationType("CIDR") + .withDestinations(Arrays.asList("0.0.0.0/0")) + .withNextHopType("IPAddress") + .withNextHops(Arrays.asList("10.0.0.68")))) + .withAttachedConnections(Arrays.asList("All_Vnets")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SDeleteSamples.java new file mode 100644 index 0000000000000..546d9dc3a3775 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SDeleteSamples.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.generated; + +/** + * Samples for VirtualHubRouteTableV2S Delete. + */ +public final class VirtualHubRouteTableV2SDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2Delete. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2Delete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubRouteTableV2Delete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S() + .delete("rg1", "virtualHub1", "virtualHubRouteTable1a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SGetSamples.java new file mode 100644 index 0000000000000..c874982074d1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SGetSamples.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.generated; + +/** + * Samples for VirtualHubRouteTableV2S Get. + */ +public final class VirtualHubRouteTableV2SGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2Get. + * json + */ + /** + * Sample code: VirtualHubVirtualHubRouteTableV2Get. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubVirtualHubRouteTableV2Get(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S() + .getWithResponse("rg1", "virtualHub1", "virtualHubRouteTable1a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SListSamples.java new file mode 100644 index 0000000000000..b0e0030cdfda5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubRouteTableV2SListSamples.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.generated; + +/** + * Samples for VirtualHubRouteTableV2S List. + */ +public final class VirtualHubRouteTableV2SListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubRouteTableV2List. + * json + */ + /** + * Sample code: VirtualHubRouteTableV2List. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubRouteTableV2List(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubRouteTableV2S().list("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..22e1ec2c780e7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualHubs CreateOrUpdate. + */ +public final class VirtualHubsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubPut.json + */ + /** + * Sample code: VirtualHubPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .define("virtualHub2") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualWan(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1")) + .withAddressPrefix("10.168.0.0/24") + .withSku("Basic") + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsDeleteSamples.java new file mode 100644 index 0000000000000..3090bb64f47e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualHubs Delete. + */ +public final class VirtualHubsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubDelete.json + */ + /** + * Sample code: VirtualHubDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().delete("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..568c1254f84ff --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualHubs GetByResourceGroup. + */ +public final class VirtualHubsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubGet.json + */ + /** + * Sample code: VirtualHubGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().getByResourceGroupWithResponse("rg1", "virtualHub1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetEffectiveVirtualHubRoutesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetEffectiveVirtualHubRoutesSamples.java new file mode 100644 index 0000000000000..6d50c9204019f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetEffectiveVirtualHubRoutesSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.EffectiveRoutesParameters; + +/** + * Samples for VirtualHubs GetEffectiveVirtualHubRoutes. + */ +public final class VirtualHubsGetEffectiveVirtualHubRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * EffectiveRoutesListForRouteTable.json + */ + /** + * Sample code: Effective Routes for a Route Table resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void + effectiveRoutesForARouteTableResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getEffectiveVirtualHubRoutes("rg1", "virtualHub1", new EffectiveRoutesParameters().withResourceId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/hubRouteTables/hubRouteTable1") + .withVirtualWanResourceType("RouteTable"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * EffectiveRoutesListForConnection.json + */ + /** + * Sample code: Effective Routes for a Connection resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void + effectiveRoutesForAConnectionResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getEffectiveVirtualHubRoutes("rg1", "virtualHub1", new EffectiveRoutesParameters().withResourceId( + "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName") + .withVirtualWanResourceType("ExpressRouteConnection"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * EffectiveRoutesListForVirtualHub.json + */ + /** + * Sample code: Effective Routes for the Virtual Hub. + * + * @param manager Entry point to NetworkManager. + */ + public static void + effectiveRoutesForTheVirtualHub(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getEffectiveVirtualHubRoutes("rg1", "virtualHub1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetInboundRoutesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetInboundRoutesSamples.java new file mode 100644 index 0000000000000..78042a02bf5d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetInboundRoutesSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.GetInboundRoutesParameters; + +/** + * Samples for VirtualHubs GetInboundRoutes. + */ +public final class VirtualHubsGetInboundRoutesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/GetInboundRoutes.json + */ + /** + * Sample code: Inbound Routes for the Virtual Hub on a Particular Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void inboundRoutesForTheVirtualHubOnAParticularConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getInboundRoutes("rg1", "virtualHub1", new GetInboundRoutesParameters().withResourceUri( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1") + .withConnectionType("ExpressRouteConnection"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetOutboundRoutesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetOutboundRoutesSamples.java new file mode 100644 index 0000000000000..ccdd46ec5e74e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsGetOutboundRoutesSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.GetOutboundRoutesParameters; + +/** + * Samples for VirtualHubs GetOutboundRoutes. + */ +public final class VirtualHubsGetOutboundRoutesSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/GetOutboundRoutes.json + */ + /** + * Sample code: Outbound Routes for the Virtual Hub on a Particular Connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void outboundRoutesForTheVirtualHubOnAParticularConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs() + .getOutboundRoutes("rg1", "virtualHub1", new GetOutboundRoutesParameters().withResourceUri( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGw1/expressRouteConnections/exrConn1") + .withConnectionType("ExpressRouteConnection"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..dfcf4a54bfd99 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualHubs ListByResourceGroup. + */ +public final class VirtualHubsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubListByResourceGroup + * .json + */ + /** + * Sample code: VirtualHubListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualHubListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListSamples.java new file mode 100644 index 0000000000000..74bd7426a3334 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualHubs List. + */ +public final class VirtualHubsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubList.json + */ + /** + * Sample code: VirtualHubList. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualHubs().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsUpdateTagsSamples.java new file mode 100644 index 0000000000000..67ad2ba9f098b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualHubsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VirtualHub; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualHubs UpdateTags. + */ +public final class VirtualHubsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualHubUpdateTags.json + */ + /** + * Sample code: VirtualHubUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualHubUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualHub resource = manager.virtualHubs() + .getByResourceGroupWithResponse("rg1", "virtualHub2", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4f0c08b15d2b5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.LocalNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.GatewayCustomBgpIpAddressIpConfiguration; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionMode; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionType; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuName; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuTier; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkGatewayConnections CreateOrUpdate. + */ +public final class VirtualNetworkGatewayConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionCreate.json + */ + /** + * Sample code: CreateVirtualNetworkGatewayConnection_S2S. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkGatewayConnectionS2S(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .define("connS2S") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withVirtualNetworkGateway1(new VirtualNetworkGatewayInner().withLocation("centralus") + .withTags(mapOf()) + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw") + .withIpConfigurations(Arrays.asList(new VirtualNetworkGatewayIpConfiguration().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/gwipconfig1") + .withName("gwipconfig1") + .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC) + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip")))) + .withGatewayType(VirtualNetworkGatewayType.VPN) + .withVpnType(VpnType.ROUTE_BASED) + .withEnableBgp(false) + .withActive(false) + .withSku(new VirtualNetworkGatewaySku().withName(VirtualNetworkGatewaySkuName.VPN_GW1) + .withTier(VirtualNetworkGatewaySkuTier.VPN_GW1)) + .withBgpSettings( + new BgpSettings().withAsn(65514L).withBgpPeeringAddress("10.0.1.30").withPeerWeight(0))) + .withConnectionType(VirtualNetworkGatewayConnectionType.IPSEC) + .withLocalNetworkGateway2(new LocalNetworkGatewayInner().withLocation("centralus") + .withTags(mapOf()) + .withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/localNetworkGateways/localgw") + .withLocalNetworkAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.1.0.0/16"))) + .withGatewayIpAddress("x.x.x.x")) + .withIngressNatRules(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1"))) + .withEgressNatRules(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2"))) + .withConnectionProtocol(VirtualNetworkGatewayConnectionProtocol.IKEV2) + .withRoutingWeight(0) + .withDpdTimeoutSeconds(30) + .withConnectionMode(VirtualNetworkGatewayConnectionMode.DEFAULT) + .withSharedKey("Abc123") + .withEnableBgp(false) + .withGatewayCustomBgpIpAddresses(Arrays.asList( + new GatewayCustomBgpIpAddressIpConfiguration().withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/default") + .withCustomBgpIpAddress("169.254.21.1"), + new GatewayCustomBgpIpAddressIpConfiguration().withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/ipConfigurations/ActiveActive") + .withCustomBgpIpAddress("169.254.21.3"))) + .withUsePolicyBasedTrafficSelectors(false) + .withIpsecPolicies(Arrays.asList()) + .withTrafficSelectorPolicies(Arrays.asList()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..be3a90ffae856 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsDeleteSamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayConnections Delete. + */ +public final class VirtualNetworkGatewayConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionDelete.json + */ + /** + * Sample code: DeleteVirtualNetworkGatewayConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteVirtualNetworkGatewayConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().delete("rg1", "conn1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..8052abb3cc79b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayConnections GetByResourceGroup. + */ +public final class VirtualNetworkGatewayConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionGet.json + */ + /** + * Sample code: GetVirtualNetworkGatewayConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .getByResourceGroupWithResponse("rg1", "connS2S", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetIkeSasSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetIkeSasSamples.java new file mode 100644 index 0000000000000..3655ace1be50f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetIkeSasSamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayConnections GetIkeSas. + */ +public final class VirtualNetworkGatewayConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionGetIkeSas.json + */ + /** + * Sample code: GetVirtualNetworkGatewayConnectionIkeSa. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayConnectionIkeSa(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().getIkeSas("rg1", "vpngwcn1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetSharedKeySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetSharedKeySamples.java new file mode 100644 index 0000000000000..d92c2e0e1fa59 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsGetSharedKeySamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayConnections GetSharedKey. + */ +public final class VirtualNetworkGatewayConnectionsGetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionGetSharedKey.json + */ + /** + * Sample code: GetVirtualNetworkGatewayConnectionSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayConnectionSharedKey( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .getSharedKeyWithResponse("rg1", "connS2S", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..065788afc070f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsListByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayConnections ListByResourceGroup. + */ +public final class VirtualNetworkGatewayConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionsList.json + */ + /** + * Sample code: ListVirtualNetworkGatewayConnectionsinResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualNetworkGatewayConnectionsinResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetConnectionSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetConnectionSamples.java new file mode 100644 index 0000000000000..89f1ab9653905 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetConnectionSamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayConnections ResetConnection. + */ +public final class VirtualNetworkGatewayConnectionsResetConnectionSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionReset.json + */ + /** + * Sample code: ResetVirtualNetworkGatewayConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void + resetVirtualNetworkGatewayConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections().resetConnection("rg1", "conn1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetSharedKeySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetSharedKeySamples.java new file mode 100644 index 0000000000000..f60b3a5b3cd41 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsResetSharedKeySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionResetSharedKeyInner; + +/** + * Samples for VirtualNetworkGatewayConnections ResetSharedKey. + */ +public final class VirtualNetworkGatewayConnectionsResetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionResetSharedKey.json + */ + /** + * Sample code: ResetVirtualNetworkGatewayConnectionSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVirtualNetworkGatewayConnectionSharedKey( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .resetSharedKey("rg1", "conn1", new ConnectionResetSharedKeyInner().withKeyLength(128), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsSetSharedKeySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsSetSharedKeySamples.java new file mode 100644 index 0000000000000..44622040314b2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsSetSharedKeySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyInner; + +/** + * Samples for VirtualNetworkGatewayConnections SetSharedKey. + */ +public final class VirtualNetworkGatewayConnectionsSetSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionSetSharedKey.json + */ + /** + * Sample code: SetVirtualNetworkGatewayConnectionSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void setVirtualNetworkGatewayConnectionSharedKey( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .setSharedKey("rg1", "connS2S", new ConnectionSharedKeyInner().withValue("AzureAbc123"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStartPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStartPacketCaptureSamples.java new file mode 100644 index 0000000000000..3a5e7e071663a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStartPacketCaptureSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; + +/** + * Samples for VirtualNetworkGatewayConnections StartPacketCapture. + */ +public final class VirtualNetworkGatewayConnectionsStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionStartPacketCapture.json + */ + /** + * Sample code: Start packet capture on virtual network gateway connection without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayConnectionWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .startPacketCapture("rg1", "vpngwcn1", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on virtual network gateway connection with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayConnectionWithFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .startPacketCapture("rg1", "vpngwcn1", new VpnPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStopPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStopPacketCaptureSamples.java new file mode 100644 index 0000000000000..60e1b4af906fc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsStopPacketCaptureSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; + +/** + * Samples for VirtualNetworkGatewayConnections StopPacketCapture. + */ +public final class VirtualNetworkGatewayConnectionsStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionStopPacketCapture.json + */ + /** + * Sample code: Stop packet capture on virtual network gateway connection. + * + * @param manager Entry point to NetworkManager. + */ + public static void stopPacketCaptureOnVirtualNetworkGatewayConnection( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayConnections() + .stopPacketCapture("rg1", "vpngwcn1", new VpnPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsUpdateTagsSamples.java new file mode 100644 index 0000000000000..8b3ada3716265 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayConnectionsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnection; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkGatewayConnections UpdateTags. + */ +public final class VirtualNetworkGatewayConnectionsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayConnectionUpdateTags.json + */ + /** + * Sample code: UpdateVirtualNetworkGatewayConnectionTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateVirtualNetworkGatewayConnectionTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetworkGatewayConnection resource = manager.virtualNetworkGatewayConnections() + .getByResourceGroupWithResponse("rg1", "test", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..1d0c744c43a5b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesCreateOrUpdateSamples.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.generated; + +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.Arrays; + +/** + * Samples for VirtualNetworkGatewayNatRules CreateOrUpdate. + */ +public final class VirtualNetworkGatewayNatRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRulePut.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRulePut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRulePut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules() + .define("natRule1") + .withExistingVirtualNetworkGateway("rg1", "gateway1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings( + Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.4.0.0/24").withPortRange("200-300"))) + .withExternalMappings( + Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.21.0/24").withPortRange("300-400"))) + .withIpConfigurationId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gateway1/ipConfigurations/default") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesDeleteSamples.java new file mode 100644 index 0000000000000..623c03a7a7934 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesDeleteSamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayNatRules Delete. + */ +public final class VirtualNetworkGatewayNatRulesDeleteSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRuleDelete.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRuleDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRuleDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules().delete("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesGetSamples.java new file mode 100644 index 0000000000000..03cec6da590d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesGetSamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayNatRules Get. + */ +public final class VirtualNetworkGatewayNatRulesGetSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRuleGet.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRuleGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRuleGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules() + .getWithResponse("rg1", "gateway1", "natRule1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples.java new file mode 100644 index 0000000000000..bc3b17dbc8c6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples.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.generated; + +/** + * Samples for VirtualNetworkGatewayNatRules ListByVirtualNetworkGateway. + */ +public final class VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewaySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayNatRuleList.json + */ + /** + * Sample code: VirtualNetworkGatewayNatRuleList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewayNatRuleList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGatewayNatRules() + .listByVirtualNetworkGateway("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..da4f63e9eedb0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VirtualNetworkGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.IpAllocationMethod; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayIpConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySku; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuName; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewaySkuTier; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayType; +import com.azure.resourcemanager.network.generated.models.VpnClientConfiguration; +import com.azure.resourcemanager.network.generated.models.VpnClientProtocol; +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.azure.resourcemanager.network.generated.models.VpnType; +import java.util.Arrays; + +/** + * Samples for VirtualNetworkGateways CreateOrUpdate. + */ +public final class VirtualNetworkGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayUpdate. + * json + */ + /** + * Sample code: UpdateVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .define("vpngw") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new VirtualNetworkGatewayIpConfiguration().withName("gwipconfig1") + .withPrivateIpAllocationMethod(IpAllocationMethod.DYNAMIC) + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip")))) + .withGatewayType(VirtualNetworkGatewayType.VPN) + .withVpnType(VpnType.ROUTE_BASED) + .withEnableBgp(false) + .withActive(false) + .withDisableIpSecReplayProtection(false) + .withSku(new VirtualNetworkGatewaySku().withName(VirtualNetworkGatewaySkuName.VPN_GW1) + .withTier(VirtualNetworkGatewaySkuTier.VPN_GW1)) + .withVpnClientConfiguration(new VpnClientConfiguration().withVpnClientRootCertificates(Arrays.asList()) + .withVpnClientRevokedCertificates(Arrays.asList()) + .withVpnClientProtocols(Arrays.asList(VpnClientProtocol.OPEN_VPN)) + .withRadiusServers(Arrays.asList(new RadiusServer().withRadiusServerAddress("10.2.0.0") + .withRadiusServerScore(20L) + .withRadiusServerSecret("fakeTokenPlaceholder")))) + .withBgpSettings(new BgpSettings().withAsn(65515L).withBgpPeeringAddress("10.0.1.30").withPeerWeight(0)) + .withCustomRoutes(new AddressSpace().withAddressPrefixes(Arrays.asList("101.168.0.6/32"))) + .withEnableDnsForwarding(true) + .withNatRules(Arrays.asList(new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule1") + .withName("natRule1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("50.0.0.0/24"))) + .withIpConfigurationId(""), + new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/natRules/natRule2") + .withName("natRule2") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.INGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("20.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("30.0.0.0/24"))) + .withIpConfigurationId(""))) + .withEnableBgpRouteTranslationForNat(false) + .withAllowVirtualWanTraffic(false) + .withAllowRemoteVnetTraffic(false) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkScalableGatewayUpdate.json + */ + /** + * Sample code: UpdateVirtualNetworkScalableGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateVirtualNetworkScalableGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .define("ergw") + .withRegion("centralus") + .withExistingResourceGroup("rg1") + .withIpConfigurations(Arrays.asList(new VirtualNetworkGatewayIpConfiguration().withName("gwipconfig1") + .withPrivateIpAllocationMethod(IpAllocationMethod.STATIC) + .withSubnet(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/GatewaySubnet")) + .withPublicIpAddress(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/gwpip")))) + .withGatewayType(VirtualNetworkGatewayType.EXPRESS_ROUTE) + .withVpnType(VpnType.POLICY_BASED) + .withEnableBgp(false) + .withActive(false) + .withDisableIpSecReplayProtection(false) + .withSku(new VirtualNetworkGatewaySku().withName(VirtualNetworkGatewaySkuName.ER_GW_SCALE) + .withTier(VirtualNetworkGatewaySkuTier.ER_GW_SCALE)) + .withNatRules(Arrays.asList(new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/natRules/natRule1") + .withName("natRule1") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("10.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("50.0.0.0/24"))) + .withIpConfigurationId(""), + new VirtualNetworkGatewayNatRuleInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/ergw/natRules/natRule2") + .withName("natRule2") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.INGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("20.10.0.0/24"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("30.0.0.0/24"))) + .withIpConfigurationId(""))) + .withEnableBgpRouteTranslationForNat(false) + .withAllowVirtualWanTraffic(false) + .withAllowRemoteVnetTraffic(false) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDeleteSamples.java new file mode 100644 index 0000000000000..24168f1ef4da0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDeleteSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways Delete. + */ +public final class VirtualNetworkGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayDelete. + * json + */ + /** + * Sample code: DeleteVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().delete("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples.java new file mode 100644 index 0000000000000..469753ab232da --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.P2SVpnConnectionRequest; +import java.util.Arrays; + +/** + * Samples for VirtualNetworkGateways DisconnectVirtualNetworkGatewayVpnConnections. + */ +public final class VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaysDisconnectP2sVpnConnections.json + */ + /** + * Sample code: Disconnect VpnConnections from Virtual Network Gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void disconnectVpnConnectionsFromVirtualNetworkGateway( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .disconnectVirtualNetworkGatewayVpnConnections("vpn-gateway-test", "vpngateway", + new P2SVpnConnectionRequest().withVpnConnectionIds(Arrays.asList("vpnconnId1", "vpnconnId2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGenerateVpnProfileSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGenerateVpnProfileSamples.java new file mode 100644 index 0000000000000..b38e5dd15bd4d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGenerateVpnProfileSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; + +/** + * Samples for VirtualNetworkGateways GenerateVpnProfile. + */ +public final class VirtualNetworkGatewaysGenerateVpnProfileSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGenerateVpnProfile.json + */ + /** + * Sample code: GenerateVirtualNetworkGatewayVPNProfile. + * + * @param manager Entry point to NetworkManager. + */ + public static void + generateVirtualNetworkGatewayVPNProfile(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .generateVpnProfile("rg1", "vpngw", new VpnClientParameters(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGeneratevpnclientpackageSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGeneratevpnclientpackageSamples.java new file mode 100644 index 0000000000000..ca78bfafd3e0f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGeneratevpnclientpackageSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnClientParameters; + +/** + * Samples for VirtualNetworkGateways Generatevpnclientpackage. + */ +public final class VirtualNetworkGatewaysGeneratevpnclientpackageSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGenerateVpnClientPackage.json + */ + /** + * Sample code: GenerateVPNClientPackage. + * + * @param manager Entry point to NetworkManager. + */ + public static void generateVPNClientPackage(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .generatevpnclientpackage("rg1", "vpngw", new VpnClientParameters(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetAdvertisedRoutesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetAdvertisedRoutesSamples.java new file mode 100644 index 0000000000000..5f650b1a7cfc8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetAdvertisedRoutesSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways GetAdvertisedRoutes. + */ +public final class VirtualNetworkGatewaysGetAdvertisedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetAdvertisedRoutes.json + */ + /** + * Sample code: GetVirtualNetworkGatewayAdvertisedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayAdvertisedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getAdvertisedRoutes("rg1", "vpngw", "test", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetBgpPeerStatusSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetBgpPeerStatusSamples.java new file mode 100644 index 0000000000000..935f438754c2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetBgpPeerStatusSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways GetBgpPeerStatus. + */ +public final class VirtualNetworkGatewaysGetBgpPeerStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetBGPPeerStatus.json + */ + /** + * Sample code: GetVirtualNetworkGatewayBGPPeerStatus. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayBGPPeerStatus(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getBgpPeerStatus("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..2c891da5f641d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways GetByResourceGroup. + */ +public final class VirtualNetworkGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayGet.json + */ + /** + * Sample code: GetVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .getByResourceGroupWithResponse("rg1", "vpngw", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkScalableGatewayGet.json + */ + /** + * Sample code: GetVirtualNetworkScalableGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkScalableGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .getByResourceGroupWithResponse("rg1", "ergw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetLearnedRoutesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetLearnedRoutesSamples.java new file mode 100644 index 0000000000000..933667fa294c0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetLearnedRoutesSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways GetLearnedRoutes. + */ +public final class VirtualNetworkGatewaysGetLearnedRoutesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayLearnedRoutes.json + */ + /** + * Sample code: GetVirtualNetworkGatewayLearnedRoutes. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkGatewayLearnedRoutes(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getLearnedRoutes("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples.java new file mode 100644 index 0000000000000..8f4bc5ea71df7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways GetVpnProfilePackageUrl. + */ +public final class VirtualNetworkGatewaysGetVpnProfilePackageUrlSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetVpnProfilePackageUrl.json + */ + /** + * Sample code: GetVirtualNetworkGatewayVPNProfilePackageURL. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayVPNProfilePackageURL( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getVpnProfilePackageUrl("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples.java new file mode 100644 index 0000000000000..65225f4b571b6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways GetVpnclientConnectionHealth. + */ +public final class VirtualNetworkGatewaysGetVpnclientConnectionHealthSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetVpnclientConnectionHealth.json + */ + /** + * Sample code: GetVirtualNetworkGatewayVpnclientConnectionHealth. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayVpnclientConnectionHealth( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .getVpnclientConnectionHealth("p2s-vnet-test", "vpnp2sgw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples.java new file mode 100644 index 0000000000000..9f7dffc89685a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways GetVpnclientIpsecParameters. + */ +public final class VirtualNetworkGatewaysGetVpnclientIpsecParametersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayGetVpnClientIpsecParameters.json + */ + /** + * Sample code: Get VirtualNetworkGateway VpnClientIpsecParameters. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkGatewayVpnClientIpsecParameters( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().getVpnclientIpsecParameters("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..f096ef081d166 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways ListByResourceGroup. + */ +public final class VirtualNetworkGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayList. + * json + */ + /** + * Sample code: ListVirtualNetworkGatewaysinResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworkGatewaysinResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListConnectionsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListConnectionsSamples.java new file mode 100644 index 0000000000000..183733dd9dfe1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysListConnectionsSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways ListConnections. + */ +public final class VirtualNetworkGatewaysListConnectionsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaysListConnections.json + */ + /** + * Sample code: VirtualNetworkGatewaysListConnections. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualNetworkGatewaysListConnections(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .listConnections("testrg", "test-vpn-gateway-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetSamples.java new file mode 100644 index 0000000000000..7e91aae188774 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways Reset. + */ +public final class VirtualNetworkGatewaysResetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGatewayReset. + * json + */ + /** + * Sample code: ResetVirtualNetworkGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().reset("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetVpnClientSharedKeySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetVpnClientSharedKeySamples.java new file mode 100644 index 0000000000000..2d4d91dab9db6 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysResetVpnClientSharedKeySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualNetworkGateways ResetVpnClientSharedKey. + */ +public final class VirtualNetworkGatewaysResetVpnClientSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayResetVpnClientSharedKey.json + */ + /** + * Sample code: ResetVpnClientSharedKey. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVpnClientSharedKey(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().resetVpnClientSharedKey("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples.java new file mode 100644 index 0000000000000..73347b104ea44 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples.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.generated; + +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; + +/** + * Samples for VirtualNetworkGateways SetVpnclientIpsecParameters. + */ +public final class VirtualNetworkGatewaysSetVpnclientIpsecParametersSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaySetVpnClientIpsecParameters.json + */ + /** + * Sample code: Set VirtualNetworkGateway VpnClientIpsecParameters. + * + * @param manager Entry point to NetworkManager. + */ + public static void setVirtualNetworkGatewayVpnClientIpsecParameters( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .setVpnclientIpsecParameters("rg1", "vpngw", + new VpnClientIPsecParametersInner().withSaLifeTimeSeconds(86473) + .withSaDataSizeKilobytes(429497) + .withIpsecEncryption(IpsecEncryption.AES256) + .withIpsecIntegrity(IpsecIntegrity.SHA256) + .withIkeEncryption(IkeEncryption.AES256) + .withIkeIntegrity(IkeIntegrity.SHA384) + .withDhGroup(DhGroup.DHGROUP2) + .withPfsGroup(PfsGroup.PFS2), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStartPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStartPacketCaptureSamples.java new file mode 100644 index 0000000000000..a827398d37a31 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStartPacketCaptureSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStartParameters; + +/** + * Samples for VirtualNetworkGateways StartPacketCapture. + */ +public final class VirtualNetworkGatewaysStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on virtual network gateway with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayWithFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .startPacketCapture("rg1", "vpngw", new VpnPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayStartPacketCapture.json + */ + /** + * Sample code: Start packet capture on virtual network gateway without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVirtualNetworkGatewayWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways().startPacketCapture("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStopPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStopPacketCaptureSamples.java new file mode 100644 index 0000000000000..9675b3ad740c9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysStopPacketCaptureSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.VpnPacketCaptureStopParameters; + +/** + * Samples for VirtualNetworkGateways StopPacketCapture. + */ +public final class VirtualNetworkGatewaysStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayStopPacketCapture.json + */ + /** + * Sample code: Stop packet capture on virtual network gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + stopPacketCaptureOnVirtualNetworkGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .stopPacketCapture("rg1", "vpngw", new VpnPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSupportedVpnDevicesSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSupportedVpnDevicesSamples.java new file mode 100644 index 0000000000000..8a274d2fb4c07 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysSupportedVpnDevicesSamples.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.generated; + +/** + * Samples for VirtualNetworkGateways SupportedVpnDevices. + */ +public final class VirtualNetworkGatewaysSupportedVpnDevicesSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewaySupportedVpnDevice.json + */ + /** + * Sample code: ListVirtualNetworkGatewaySupportedVPNDevices. + * + * @param manager Entry point to NetworkManager. + */ + public static void listVirtualNetworkGatewaySupportedVPNDevices( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .supportedVpnDevicesWithResponse("rg1", "vpngw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysUpdateTagsSamples.java new file mode 100644 index 0000000000000..74890dc739b76 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkGateways UpdateTags. + */ +public final class VirtualNetworkGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayUpdateTags.json + */ + /** + * Sample code: UpdateVirtualNetworkGatewayTags. + * + * @param manager Entry point to NetworkManager. + */ + public static void + updateVirtualNetworkGatewayTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetworkGateway resource = manager.virtualNetworkGateways() + .getByResourceGroupWithResponse("rg1", "vpngw", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples.java new file mode 100644 index 0000000000000..c9f24e7108642 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnDeviceScriptParameters; + +/** + * Samples for VirtualNetworkGateways VpnDeviceConfigurationScript. + */ +public final class VirtualNetworkGatewaysVpnDeviceConfigurationScriptSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGatewayVpnDeviceConfigurationScript.json + */ + /** + * Sample code: GetVPNDeviceConfigurationScript. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVPNDeviceConfigurationScript(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkGateways() + .vpnDeviceConfigurationScriptWithResponse("rg1", "vpngw", + new VpnDeviceScriptParameters().withVendor("Cisco") + .withDeviceFamily("ISR") + .withFirmwareVersion("IOS 15.1 (Preview)"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..92870aa1bde87 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.models.SyncRemoteAddressSpace; +import java.util.Arrays; + +/** + * Samples for VirtualNetworkPeerings CreateOrUpdate. + */ +public final class VirtualNetworkPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkSubnetPeeringSync.json + */ + /** + * Sample code: Sync subnet Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void syncSubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(false) + .withSyncRemoteAddressSpace(SyncRemoteAddressSpace.TRUE) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkV6SubnetPeeringCreate.json + */ + /** + * Sample code: Create V6 Subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createV6SubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(true) + .withLocalSubnetNames(Arrays.asList("Subnet1", "Subnet4")) + .withRemoteSubnetNames(Arrays.asList("Subnet2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringSync. + * json + */ + /** + * Sample code: Sync Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void syncPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withSyncRemoteAddressSpace(SyncRemoteAddressSpace.TRUE) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringCreate. + * json + */ + /** + * Sample code: Create peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkPeeringCreateWithRemoteVirtualNetworkEncryption.json + */ + /** + * Sample code: Create peering with remote virtual network encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void createPeeringWithRemoteVirtualNetworkEncryption( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkSubnetPeeringCreate.json + */ + /** + * Sample code: Create subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createSubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(false) + .withLocalSubnetNames(Arrays.asList("Subnet1", "Subnet4")) + .withRemoteSubnetNames(Arrays.asList("Subnet2")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkV6SubnetPeeringSync.json + */ + /** + * Sample code: Sync V6 Subnet Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void syncV6SubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings() + .define("peer") + .withExistingVirtualNetwork("peerTest", "vnet1") + .withAllowVirtualNetworkAccess(true) + .withAllowForwardedTraffic(true) + .withAllowGatewayTransit(false) + .withUseRemoteGateways(false) + .withRemoteVirtualNetwork(new SubResource().withId( + "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2")) + .withPeerCompleteVnets(false) + .withEnableOnlyIPv6Peering(true) + .withSyncRemoteAddressSpace(SyncRemoteAddressSpace.TRUE) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsDeleteSamples.java new file mode 100644 index 0000000000000..420ddfed117f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsDeleteSamples.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.generated; + +/** + * Samples for VirtualNetworkPeerings Delete. + */ +public final class VirtualNetworkPeeringsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringDelete. + * json + */ + /** + * Sample code: Delete peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void deletePeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().delete("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsGetSamples.java new file mode 100644 index 0000000000000..8ed89a20b909c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsGetSamples.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.generated; + +/** + * Samples for VirtualNetworkPeerings Get. + */ +public final class VirtualNetworkPeeringsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringGet.json + */ + /** + * Sample code: Get peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkPeeringGetWithRemoteVirtualNetworkEncryption.json + */ + /** + * Sample code: Get peering with remote virtual network encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void getPeeringWithRemoteVirtualNetworkEncryption( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkSubnetPeeringGet.json + */ + /** + * Sample code: Get subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getSubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkV6SubnetPeeringGet.json + */ + /** + * Sample code: Get V6 subnet peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getV6SubnetPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().getWithResponse("peerTest", "vnet1", "peer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsListSamples.java new file mode 100644 index 0000000000000..7b0f06c7af51e --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkPeeringsListSamples.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.generated; + +/** + * Samples for VirtualNetworkPeerings List. + */ +public final class VirtualNetworkPeeringsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkPeeringList. + * json + */ + /** + * Sample code: List peerings. + * + * @param manager Entry point to NetworkManager. + */ + public static void listPeerings(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().list("peerTest", "vnet1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkPeeringListWithRemoteVirtualNetworkEncryption.json + */ + /** + * Sample code: List peerings with remote virtual network encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void listPeeringsWithRemoteVirtualNetworkEncryption( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkPeerings().list("peerTest", "vnet1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5451570ee90d4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.NetworkInterfaceIpConfigurationInner; + +/** + * Samples for VirtualNetworkTaps CreateOrUpdate. + */ +public final class VirtualNetworkTapsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapCreate.json + */ + /** + * Sample code: Create Virtual Network Tap. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetworkTap(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps() + .define("test-vtap") + .withRegion("centraluseuap") + .withExistingResourceGroup("rg1") + .withDestinationNetworkInterfaceIpConfiguration(new NetworkInterfaceIpConfigurationInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/testNetworkInterface/ipConfigurations/ipconfig1")) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsDeleteSamples.java new file mode 100644 index 0000000000000..bed2a11c5afa0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsDeleteSamples.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.generated; + +/** + * Samples for VirtualNetworkTaps Delete. + */ +public final class VirtualNetworkTapsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapDelete.json + */ + /** + * Sample code: Delete Virtual Network Tap resource. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deleteVirtualNetworkTapResource(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps().delete("rg1", "test-vtap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..475838b522807 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsGetByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworkTaps GetByResourceGroup. + */ +public final class VirtualNetworkTapsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapGet.json + */ + /** + * Sample code: Get Virtual Network Tap. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkTap(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps() + .getByResourceGroupWithResponse("rg1", "testvtap", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..5c22c39069677 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworkTaps ListByResourceGroup. + */ +public final class VirtualNetworkTapsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapList.json + */ + /** + * Sample code: List virtual network taps in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworkTapsInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListSamples.java new file mode 100644 index 0000000000000..4e9aad512e0c5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualNetworkTaps List. + */ +public final class VirtualNetworkTapsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapListAll.json + */ + /** + * Sample code: List all virtual network taps. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllVirtualNetworkTaps(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworkTaps().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsUpdateTagsSamples.java new file mode 100644 index 0000000000000..9df2ef2ab7280 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworkTapsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VirtualNetworkTap; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworkTaps UpdateTags. + */ +public final class VirtualNetworkTapsUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkTapUpdateTags. + * json + */ + /** + * Sample code: Update virtual network tap tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkTapTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetworkTap resource = manager.virtualNetworkTaps() + .getByResourceGroupWithResponse("rg1", "test-vtap", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCheckIpAddressAvailabilitySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCheckIpAddressAvailabilitySamples.java new file mode 100644 index 0000000000000..f2353c0f43665 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCheckIpAddressAvailabilitySamples.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.generated; + +/** + * Samples for VirtualNetworks CheckIpAddressAvailability. + */ +public final class VirtualNetworksCheckIpAddressAvailabilitySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCheckIPAddressAvailability.json + */ + /** + * Sample code: Check IP address availability. + * + * @param manager Entry point to NetworkManager. + */ + public static void checkIPAddressAvailability(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .checkIpAddressAvailabilityWithResponse("rg1", "test-vnet", "10.0.1.4", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d1a561996e62a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksCreateOrUpdateSamples.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.generated; + +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.AddressSpace; +import com.azure.resourcemanager.network.generated.models.Delegation; +import com.azure.resourcemanager.network.generated.models.ServiceEndpointPropertiesFormat; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkBgpCommunities; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryption; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkEncryptionEnforcement; +import java.util.Arrays; + +/** + * Samples for VirtualNetworks CreateOrUpdate. + */ +public final class VirtualNetworksCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkCreateSubnet. + * json + */ + /** + * Sample code: Create virtual network with subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24"))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateWithBgpCommunities.json + */ + /** + * Sample code: Create virtual network with Bgp Communities. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithBgpCommunities(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24"))) + .withBgpCommunities(new VirtualNetworkBgpCommunities().withVirtualNetworkCommunity("12076:20000")) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateSubnetWithAddressPrefixes.json + */ + /** + * Sample code: Create virtual network with subnet containing address prefixes. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetworkWithSubnetContainingAddressPrefixes( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList( + new SubnetInner().withName("test-2").withAddressPrefixes(Arrays.asList("10.0.0.0/28", "10.0.1.0/28")))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateSubnetWithDelegation.json + */ + /** + * Sample code: Create virtual network with delegated subnets. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithDelegatedSubnets(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("westcentralus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1") + .withAddressPrefix("10.0.0.0/24") + .withDelegations(Arrays.asList( + new Delegation().withName("myDelegation").withServiceName("Microsoft.Sql/managedInstances"))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateWithEncryption.json + */ + /** + * Sample code: Create virtual network with encryption. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithEncryption(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1").withAddressPrefix("10.0.0.0/24"))) + .withEncryption(new VirtualNetworkEncryption().withEnabled(true) + .withEnforcement(VirtualNetworkEncryptionEnforcement.ALLOW_UNENCRYPTED)) + .create(); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkCreate.json + */ + /** + * Sample code: Create virtual network. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("test-vnet") + .withRegion("eastus") + .withExistingResourceGroup("rg1") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withFlowTimeoutInMinutes(10) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateServiceEndpointPolicy.json + */ + /** + * Sample code: Create virtual network with service endpoints and service endpoint policy. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualNetworkWithServiceEndpointsAndServiceEndpointPolicy( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("vnet1") + .withRegion("eastus2euap") + .withExistingResourceGroup("vnetTest") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints( + Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage"))) + .withServiceEndpointPolicies(Arrays.asList(new ServiceEndpointPolicyInner().withId( + "/subscriptions/subid/resourceGroups/vnetTest/providers/Microsoft.Network/serviceEndpointPolicies/ServiceEndpointPolicy1"))))) + .create(); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkCreateServiceEndpoints.json + */ + /** + * Sample code: Create virtual network with service endpoints. + * + * @param manager Entry point to NetworkManager. + */ + public static void + createVirtualNetworkWithServiceEndpoints(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .define("vnet1") + .withRegion("eastus") + .withExistingResourceGroup("vnetTest") + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withSubnets(Arrays.asList(new SubnetInner().withName("test-1") + .withAddressPrefix("10.0.0.0/16") + .withServiceEndpoints( + Arrays.asList(new ServiceEndpointPropertiesFormat().withService("Microsoft.Storage"))))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksDeleteSamples.java new file mode 100644 index 0000000000000..404f0494204de --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualNetworks Delete. + */ +public final class VirtualNetworksDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkDelete.json + */ + /** + * Sample code: Delete virtual network. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().delete("rg1", "test-vnet", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..aea474bb20975 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksGetByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworks GetByResourceGroup. + */ +public final class VirtualNetworksGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetWithSubnetDelegation.json + */ + /** + * Sample code: Get virtual network with a delegated subnet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualNetworkWithADelegatedSubnet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetWithServiceAssociationLink.json + */ + /** + * Sample code: Get virtual network with service association links. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetworkWithServiceAssociationLinks( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkGet.json + */ + /** + * Sample code: Get virtual network. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListByResourceGroupSamples.java new file mode 100644 index 0000000000000..4a828be56f359 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualNetworks ListByResourceGroup. + */ +public final class VirtualNetworksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkList.json + */ + /** + * Sample code: List virtual networks in resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listVirtualNetworksInResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListDdosProtectionStatusSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListDdosProtectionStatusSamples.java new file mode 100644 index 0000000000000..78e2c6b8b7efd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListDdosProtectionStatusSamples.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.generated; + +/** + * Samples for VirtualNetworks ListDdosProtectionStatus. + */ +public final class VirtualNetworksListDdosProtectionStatusSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualNetworkGetDdosProtectionStatus.json + */ + /** + * Sample code: Get Ddos Protection Status of a Virtual Network. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getDdosProtectionStatusOfAVirtualNetwork(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks() + .listDdosProtectionStatus("rg1", "test-vnet", 75, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListSamples.java new file mode 100644 index 0000000000000..1b26b0b861679 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualNetworks List. + */ +public final class VirtualNetworksListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkListAll.json + */ + /** + * Sample code: List all virtual networks. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllVirtualNetworks(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListUsageSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListUsageSamples.java new file mode 100644 index 0000000000000..05cf2d9576b27 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksListUsageSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualNetworks ListUsage. + */ +public final class VirtualNetworksListUsageSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkListUsage.json + */ + /** + * Sample code: VnetGetUsage. + * + * @param manager Entry point to NetworkManager. + */ + public static void vnetGetUsage(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualNetworks().listUsage("rg1", "vnetName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksUpdateTagsSamples.java new file mode 100644 index 0000000000000..81bad41e5e555 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualNetworksUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VirtualNetwork; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualNetworks UpdateTags. + */ +public final class VirtualNetworksUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualNetworkUpdateTags.json + */ + /** + * Sample code: Update virtual network tags. + * + * @param manager Entry point to NetworkManager. + */ + public static void updateVirtualNetworkTags(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualNetwork resource = manager.virtualNetworks() + .getByResourceGroupWithResponse("rg1", "test-vnet", null, com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..373dafafc201f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualRouterPeerings CreateOrUpdate. + */ +public final class VirtualRouterPeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringPut.json + */ + /** + * Sample code: Create Virtual Router Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings() + .define("peering1") + .withExistingVirtualRouter("rg1", "virtualRouter") + .withPeerAsn(20000L) + .withPeerIp("192.168.1.5") + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsDeleteSamples.java new file mode 100644 index 0000000000000..35e3cb28a2f42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsDeleteSamples.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.generated; + +/** + * Samples for VirtualRouterPeerings Delete. + */ +public final class VirtualRouterPeeringsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringDelete. + * json + */ + /** + * Sample code: Delete VirtualRouterPeering. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings().delete("rg1", "virtualRouter", "peering1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsGetSamples.java new file mode 100644 index 0000000000000..3e87f4b3eb4b1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsGetSamples.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.generated; + +/** + * Samples for VirtualRouterPeerings Get. + */ +public final class VirtualRouterPeeringsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringGet.json + */ + /** + * Sample code: Get Virtual Router Peering. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualRouterPeering(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings() + .getWithResponse("rg1", "virtualRouter", "peering1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsListSamples.java new file mode 100644 index 0000000000000..2a8801beb30f4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRouterPeeringsListSamples.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.generated; + +/** + * Samples for VirtualRouterPeerings List. + */ +public final class VirtualRouterPeeringsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPeeringList.json + */ + /** + * Sample code: List all Virtual Router Peerings for a given Virtual Router. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllVirtualRouterPeeringsForAGivenVirtualRouter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouterPeerings().list("rg1", "virtualRouter", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c5668ddf56020 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualRouters CreateOrUpdate. + */ +public final class VirtualRoutersCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterPut.json + */ + /** + * Sample code: Create VirtualRouter. + * + * @param manager Entry point to NetworkManager. + */ + public static void createVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters() + .define("virtualRouter") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withHostedGateway(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vnetGateway")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersDeleteSamples.java new file mode 100644 index 0000000000000..7064f4ed4a7e0 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualRouters Delete. + */ +public final class VirtualRoutersDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterDelete.json + */ + /** + * Sample code: Delete VirtualRouter. + * + * @param manager Entry point to NetworkManager. + */ + public static void deleteVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters().delete("rg1", "virtualRouter", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d62939ac41a1d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersGetByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualRouters GetByResourceGroup. + */ +public final class VirtualRoutersGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualRouterGet.json + */ + /** + * Sample code: Get VirtualRouter. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVirtualRouter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters() + .getByResourceGroupWithResponse("rg1", "virtualRouter", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..79a8ba9e04e6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualRouters ListByResourceGroup. + */ +public final class VirtualRoutersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterListByResourceGroup.json + */ + /** + * Sample code: List all Virtual Router for a given resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllVirtualRouterForAGivenResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListSamples.java new file mode 100644 index 0000000000000..8e413be63d973 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualRoutersListSamples.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.generated; + +/** + * Samples for VirtualRouters List. + */ +public final class VirtualRoutersListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VirtualRouterListBySubscription.json + */ + /** + * Sample code: List all Virtual Routers for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listAllVirtualRoutersForAGivenSubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualRouters().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..3abe7cd454676 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansCreateOrUpdateSamples.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.generated; + +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualWans CreateOrUpdate. + */ +public final class VirtualWansCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANPut.json + */ + /** + * Sample code: VirtualWANCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans() + .define("wan1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withDisableVpnEncryption(false) + .withTypePropertiesType("Basic") + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansDeleteSamples.java new file mode 100644 index 0000000000000..02304d0b7e6e1 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualWans Delete. + */ +public final class VirtualWansDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANDelete.json + */ + /** + * Sample code: VirtualWANDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().delete("rg1", "virtualWan1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..fdb40c2f03ede --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualWans GetByResourceGroup. + */ +public final class VirtualWansGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANGet.json + */ + /** + * Sample code: VirtualWANGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().getByResourceGroupWithResponse("rg1", "wan1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d5b51fca87911 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListByResourceGroupSamples.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.generated; + +/** + * Samples for VirtualWans ListByResourceGroup. + */ +public final class VirtualWansListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANListByResourceGroup + * .json + */ + /** + * Sample code: VirtualWANListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + virtualWANListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListSamples.java new file mode 100644 index 0000000000000..f46ae4389a3ee --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VirtualWans List. + */ +public final class VirtualWansListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANList.json + */ + /** + * Sample code: VirtualWANList. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.virtualWans().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansUpdateTagsSamples.java new file mode 100644 index 0000000000000..ce69fc70a68f2 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VirtualWansUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VirtualWan; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VirtualWans UpdateTags. + */ +public final class VirtualWansUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VirtualWANUpdateTags.json + */ + /** + * Sample code: VirtualWANUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void virtualWANUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VirtualWan resource = manager.virtualWans() + .getByResourceGroupWithResponse("rg1", "wan1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..feae3d2c73546 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsCreateOrUpdateSamples.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.generated; + +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.PropagatedRouteTable; +import com.azure.resourcemanager.network.generated.models.RoutingConfiguration; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +import com.azure.resourcemanager.network.generated.models.VpnLinkConnectionMode; +import java.util.Arrays; + +/** + * Samples for VpnConnections CreateOrUpdate. + */ +public final class VpnConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionPut.json + */ + /** + * Sample code: VpnConnectionPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .createOrUpdate("rg1", "gateway1", "vpnConnection1", new VpnConnectionInner() + .withRemoteVpnSite(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1")) + .withTrafficSelectorPolicies(Arrays.asList()) + .withVpnLinkConnections(Arrays.asList(new VpnSiteLinkConnectionInner().withName("Connection-Link1") + .withVpnSiteLink(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1")) + .withVpnLinkConnectionMode(VpnLinkConnectionMode.DEFAULT) + .withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol.IKEV2) + .withConnectionBandwidth(200) + .withSharedKey("fakeTokenPlaceholder") + .withUsePolicyBasedTrafficSelectors(false))) + .withRoutingConfiguration(new RoutingConfiguration().withAssociatedRouteTable(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1")) + .withPropagatedRouteTables(new PropagatedRouteTable().withLabels(Arrays.asList("label1", "label2")) + .withIds(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable1"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable2"), + new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/hub1/hubRouteTables/hubRouteTable3")))) + .withInboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1")) + .withOutboundRouteMap(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..20853185099fd --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnConnections Delete. + */ +public final class VpnConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionDelete.json + */ + /** + * Sample code: VpnConnectionDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections().delete("rg1", "gateway1", "vpnConnection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsGetSamples.java new file mode 100644 index 0000000000000..131a0acafb195 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnConnections Get. + */ +public final class VpnConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionGet.json + */ + /** + * Sample code: VpnConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections().getWithResponse("rg1", "gateway1", "vpnConnection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsListByVpnGatewaySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsListByVpnGatewaySamples.java new file mode 100644 index 0000000000000..a9bb908276f1c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsListByVpnGatewaySamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnConnections ListByVpnGateway. + */ +public final class VpnConnectionsListByVpnGatewaySamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnConnectionList.json + */ + /** + * Sample code: VpnConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections().listByVpnGateway("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStartPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStartPacketCaptureSamples.java new file mode 100644 index 0000000000000..3d9173dedcf81 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStartPacketCaptureSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStartParameters; +import java.util.Arrays; + +/** + * Samples for VpnConnections StartPacketCapture. + */ +public final class VpnConnectionsStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnConnectionStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on vpn connection with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnConnectionWithFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .startPacketCapture("rg1", "gateway1", "vpnConnection1", + new VpnConnectionPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}") + .withLinkConnectionNames(Arrays.asList("siteLink1", "siteLink2")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnConnectionStartPacketCapture.json + */ + /** + * Sample code: Start packet capture on vpn connection without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnConnectionWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .startPacketCapture( + "rg1", "gateway1", "vpnConnection1", new VpnConnectionPacketCaptureStartParameters() + .withLinkConnectionNames(Arrays.asList("siteLink1", "siteLink2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStopPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStopPacketCaptureSamples.java new file mode 100644 index 0000000000000..8e39294731fb9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnConnectionsStopPacketCaptureSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnConnectionPacketCaptureStopParameters; +import java.util.Arrays; + +/** + * Samples for VpnConnections StopPacketCapture. + */ +public final class VpnConnectionsStopPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnConnectionStopPacketCapture.json + */ + /** + * Sample code: Start packet capture on vpn connection without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnConnectionWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnConnections() + .stopPacketCapture("rg1", "gateway1", "vpnConnection1", + new VpnConnectionPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D") + .withLinkConnectionNames(Arrays.asList("vpnSiteLink1", "vpnSiteLink2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5c639a5310858 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnConnectionInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnGatewayNatRuleInner; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkConnectionInner; +import com.azure.resourcemanager.network.generated.models.BgpSettings; +import com.azure.resourcemanager.network.generated.models.IpConfigurationBgpPeeringAddress; +import com.azure.resourcemanager.network.generated.models.VirtualNetworkGatewayConnectionProtocol; +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.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnGateways CreateOrUpdate. + */ +public final class VpnGatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayPut.json + */ + /** + * Sample code: VpnGatewayPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways() + .define("gateway1") + .withRegion("westcentralus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualHub(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1")) + .withConnections(Arrays.asList(new VpnConnectionInner().withName("vpnConnection1") + .withRemoteVpnSite(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1")) + .withVpnLinkConnections(Arrays.asList(new VpnSiteLinkConnectionInner().withName("Connection-Link1") + .withVpnSiteLink(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/vpnSite1/vpnSiteLinks/siteLink1")) + .withVpnConnectionProtocolType(VirtualNetworkGatewayConnectionProtocol.IKEV2) + .withConnectionBandwidth(200) + .withSharedKey("fakeTokenPlaceholder") + .withEgressNatRules(Arrays.asList(new SubResource().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnGateways/gateway1/natRules/nat03"))))))) + .withBgpSettings(new BgpSettings().withAsn(65515L) + .withPeerWeight(0) + .withBgpPeeringAddresses(Arrays.asList( + new IpConfigurationBgpPeeringAddress().withIpconfigurationId("Instance0") + .withCustomBgpIpAddresses(Arrays.asList("169.254.21.5")), + new IpConfigurationBgpPeeringAddress().withIpconfigurationId("Instance1") + .withCustomBgpIpAddresses(Arrays.asList("169.254.21.10"))))) + .withEnableBgpRouteTranslationForNat(false) + .withIsRoutingPreferenceInternet(false) + .withNatRules(Arrays.asList(new VpnGatewayNatRuleInner().withName("nat03") + .withTypePropertiesType(VpnNatRuleType.STATIC) + .withMode(VpnNatRuleMode.EGRESS_SNAT) + .withInternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("0.0.0.0/26"))) + .withExternalMappings(Arrays.asList(new VpnNatRuleMapping().withAddressSpace("192.168.0.0/26"))) + .withIpConfigurationId(""))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysDeleteSamples.java new file mode 100644 index 0000000000000..b6b4eeee3f3d8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnGateways Delete. + */ +public final class VpnGatewaysDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayDelete.json + */ + /** + * Sample code: VpnGatewayDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().delete("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..a3cac2283487c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnGateways GetByResourceGroup. + */ +public final class VpnGatewaysGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayGet.json + */ + /** + * Sample code: VpnGatewayGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().getByResourceGroupWithResponse("rg1", "gateway1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListByResourceGroupSamples.java new file mode 100644 index 0000000000000..1c6c565ae87f7 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListByResourceGroupSamples.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.generated; + +/** + * Samples for VpnGateways ListByResourceGroup. + */ +public final class VpnGatewaysListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayListByResourceGroup + * .json + */ + /** + * Sample code: VpnGatewayListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnGatewayListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListSamples.java new file mode 100644 index 0000000000000..bc8dafc0a79c3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysListSamples.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.generated; + +/** + * Samples for VpnGateways List. + */ +public final class VpnGatewaysListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayList.json + */ + /** + * Sample code: VpnGatewayListBySubscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnGatewayListBySubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysResetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysResetSamples.java new file mode 100644 index 0000000000000..c6d3b16df50e4 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysResetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnGateways Reset. + */ +public final class VpnGatewaysResetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayReset.json + */ + /** + * Sample code: ResetVpnGateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().reset("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStartPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStartPacketCaptureSamples.java new file mode 100644 index 0000000000000..2d74b5be266a5 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStartPacketCaptureSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStartParameters; + +/** + * Samples for VpnGateways StartPacketCapture. + */ +public final class VpnGatewaysStartPacketCaptureSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnGatewayStartPacketCaptureFilterData.json + */ + /** + * Sample code: Start packet capture on vpn gateway with filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void + startPacketCaptureOnVpnGatewayWithFilter(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways() + .startPacketCapture("rg1", "vpngw", new VpnGatewayPacketCaptureStartParameters().withFilterData( + "{'TracingFlags': 11,'MaxPacketBufferSize': 120,'MaxFileSize': 200,'Filters': [{'SourceSubnets': ['20.1.1.0/24'],'DestinationSubnets': ['10.1.1.0/24'],'SourcePort': [500],'DestinationPort': [4500],'Protocol': 6,'TcpFlags': 16,'CaptureSingleDirectionTrafficOnly': true}]}"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayStartPacketCapture. + * json + */ + /** + * Sample code: Start packet capture on vpn gateway without filter. + * + * @param manager Entry point to NetworkManager. + */ + public static void startPacketCaptureOnVpnGatewayWithoutFilter( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways().startPacketCapture("rg1", "vpngw", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStopPacketCaptureSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStopPacketCaptureSamples.java new file mode 100644 index 0000000000000..95b847bd717f3 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysStopPacketCaptureSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +import com.azure.resourcemanager.network.generated.models.VpnGatewayPacketCaptureStopParameters; + +/** + * Samples for VpnGateways StopPacketCapture. + */ +public final class VpnGatewaysStopPacketCaptureSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayStopPacketCapture. + * json + */ + /** + * Sample code: Stop packet capture on vpn gateway. + * + * @param manager Entry point to NetworkManager. + */ + public static void + stopPacketCaptureOnVpnGateway(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnGateways() + .stopPacketCapture("rg1", "vpngw", new VpnGatewayPacketCaptureStopParameters().withSasUrl( + "https://teststorage.blob.core.windows.net/?sv=2018-03-28&ss=bfqt&srt=sco&sp=rwdlacup&se=2019-09-13T07:44:05Z&st=2019-09-06T23:44:05Z&spr=https&sig=V1h9D1riltvZMI69d6ihENnFo%2FrCvTqGgjO2lf%2FVBhE%3D"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysUpdateTagsSamples.java new file mode 100644 index 0000000000000..f654289142c6c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnGatewaysUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnGateway; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnGateways UpdateTags. + */ +public final class VpnGatewaysUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnGatewayUpdateTags.json + */ + /** + * Sample code: VpnGatewayUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnGatewayUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VpnGateway resource = manager.vpnGateways() + .getByResourceGroupWithResponse("rg1", "gateway1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetAllSharedKeysSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetAllSharedKeysSamples.java new file mode 100644 index 0000000000000..6d22f85299f6f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetAllSharedKeysSamples.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.generated; + +/** + * Samples for VpnLinkConnections GetAllSharedKeys. + */ +public final class VpnLinkConnectionsGetAllSharedKeysSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionSharedKeysGet.json + */ + /** + * Sample code: VpnSiteLinkConnectionSharedKeysGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionSharedKeysGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .getAllSharedKeys("rg1", "gateway1", "vpnConnection1", "Connection-Link1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetDefaultSharedKeySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetDefaultSharedKeySamples.java new file mode 100644 index 0000000000000..b986e5c652e50 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetDefaultSharedKeySamples.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.generated; + +/** + * Samples for VpnLinkConnections GetDefaultSharedKey. + */ +public final class VpnLinkConnectionsGetDefaultSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionDefaultSharedKeyGet.json + */ + /** + * Sample code: VpnSiteLinkConnectionDefaultSharedKeyGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionDefaultSharedKeyGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .getDefaultSharedKeyWithResponse("rg1", "gateway1", "vpnConnection1", "Connection-Link1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetIkeSasSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetIkeSasSamples.java new file mode 100644 index 0000000000000..a5313994dce58 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsGetIkeSasSamples.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.generated; + +/** + * Samples for VpnLinkConnections GetIkeSas. + */ +public final class VpnLinkConnectionsGetIkeSasSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionGetIkeSas.json + */ + /** + * Sample code: GetVpnLinkConnectionIkeSa. + * + * @param manager Entry point to NetworkManager. + */ + public static void getVpnLinkConnectionIkeSa(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .getIkeSas("rg1", "gateway1", "vpnConnection1", "Connection-Link1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListByVpnConnectionSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListByVpnConnectionSamples.java new file mode 100644 index 0000000000000..a39b90d0a6224 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListByVpnConnectionSamples.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.generated; + +/** + * Samples for VpnLinkConnections ListByVpnConnection. + */ +public final class VpnLinkConnectionsListByVpnConnectionSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkConnectionList. + * json + */ + /** + * Sample code: VpnSiteLinkConnectionList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteLinkConnectionList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .listByVpnConnection("rg1", "gateway1", "vpnConnection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListDefaultSharedKeySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListDefaultSharedKeySamples.java new file mode 100644 index 0000000000000..b7a44c6b44028 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsListDefaultSharedKeySamples.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.generated; + +/** + * Samples for VpnLinkConnections ListDefaultSharedKey. + */ +public final class VpnLinkConnectionsListDefaultSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionDefaultSharedKeyList.json + */ + /** + * Sample code: VpnSiteLinkConnectionDefaultSharedKeyList. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionDefaultSharedKeyList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .listDefaultSharedKeyWithResponse("rg1", "gateway1", "vpnConnection1", "Connection-Link1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsResetConnectionSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsResetConnectionSamples.java new file mode 100644 index 0000000000000..86165069db59b --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsResetConnectionSamples.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.generated; + +/** + * Samples for VpnLinkConnections ResetConnection. + */ +public final class VpnLinkConnectionsResetConnectionSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkConnectionReset. + * json + */ + /** + * Sample code: ResetVpnLinkConnection. + * + * @param manager Entry point to NetworkManager. + */ + public static void resetVpnLinkConnection(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .resetConnection("rg1", "gateway1", "vpnConnection1", "Connection-Link1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsSetOrInitDefaultSharedKeySamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsSetOrInitDefaultSharedKeySamples.java new file mode 100644 index 0000000000000..9afb516c28264 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnLinkConnectionsSetOrInitDefaultSharedKeySamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.ConnectionSharedKeyResultInner; +import com.azure.resourcemanager.network.generated.models.SharedKeyProperties; + +/** + * Samples for VpnLinkConnections SetOrInitDefaultSharedKey. + */ +public final class VpnLinkConnectionsSetOrInitDefaultSharedKeySamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnSiteLinkConnectionDefaultSharedKeyPut.json + */ + /** + * Sample code: VpnSiteLinkConnectionDefaultSharedKeyPut. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSiteLinkConnectionDefaultSharedKeyPut(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnLinkConnections() + .setOrInitDefaultSharedKey( + "rg1", "gateway1", "vpnConnection1", "Connection-Link1", new ConnectionSharedKeyResultInner() + .withProperties(new SharedKeyProperties().withSharedKey("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsAssociatedWithVirtualWanListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsAssociatedWithVirtualWanListSamples.java new file mode 100644 index 0000000000000..8856c9a469623 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsAssociatedWithVirtualWanListSamples.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.generated; + +/** + * Samples for VpnServerConfigurationsAssociatedWithVirtualWan List. + */ +public final class VpnServerConfigurationsAssociatedWithVirtualWanListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * GetVirtualWanVpnServerConfigurations.json + */ + /** + * Sample code: GetVirtualWanVpnServerConfigurations. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getVirtualWanVpnServerConfigurations(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurationsAssociatedWithVirtualWans() + .list("rg1", "wan1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..6e1f299c64f52 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.fluent.models.VpnServerConfigurationPolicyGroupInner; +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.IpsecPolicy; +import com.azure.resourcemanager.network.generated.models.PfsGroup; +import com.azure.resourcemanager.network.generated.models.RadiusServer; +import com.azure.resourcemanager.network.generated.models.VpnGatewayTunnelingProtocol; +import com.azure.resourcemanager.network.generated.models.VpnPolicyMemberAttributeType; +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.VpnServerConfigurationPolicyGroupMember; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnServerConfigurations CreateOrUpdate. + */ +public final class VpnServerConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationPut. + * json + */ + /** + * Sample code: VpnServerConfigurationCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations() + .define("vpnServerConfiguration1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVpnProtocols(Arrays.asList(VpnGatewayTunnelingProtocol.IKE_V2)) + .withVpnClientRootCertificates(Arrays.asList(new VpnServerConfigVpnClientRootCertificate() + .withName("vpnServerConfigVpnClientRootCert1") + .withPublicCertData( + "MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuN"))) + .withVpnClientRevokedCertificates(Arrays.asList( + new VpnServerConfigVpnClientRevokedCertificate().withName("vpnServerConfigVpnClientRevokedCert1") + .withThumbprint("83FFBFC8848B5A5836C94D0112367E16148A286F"))) + .withRadiusServerRootCertificates(Arrays.asList(new VpnServerConfigRadiusServerRootCertificate() + .withName("vpnServerConfigRadiusServerRootCer1") + .withPublicCertData( + "MIIC5zCCAc+gAwIBAgIQErQ0Hk4aDJxIA+Q5RagB+jANBgkqhkiG9w0BAQsFADAWMRQwEgYDVQQDDAtQMlNSb290Q2VydDAeFw0xNzEyMTQyMTA3MzhaFw0xODEyMTQyMTI3MzhaMBYxFDASBgNVBAMMC1AyU1Jvb3RDZXJ0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP7/NQXmW7cQ/ZR1mv3Y3I29Lt7HTOqzo/1KUOoVH3NItbQIRAQbwKy3UWrOFz4eGNX2GWtNRMdCyWsKeqy9Ltsdfcm1IbKXkl84DFeU/ZacXu4Dl3xX3gV5du4TLZjEowJELyur11Ea2YcjPRQ/FzAF9/hGuboS1HZQEPLx4FdUs9OxCYOtc0MxBCwLfVTTRqarb0Ne+arNYd4kCzIhAke1nOyKAJBda5ZL+VHy3S5S8qGlD46jm8HXugmAkUygS4oIIXOmj/1O9sNAi3LN60zufSzCmP8Rm/iUGX+DHAGGiXxwZOKQLEDaZXKqoHjMPP0XudmSWwOIbyeQVrLhkwIDAQABozEwLzAOBgNVHQ8BAf8EBAMCAgQwHQYDVR0OBBYEFEfeNU2trYxNLF9ONmuJUsT13pKDMA0GCSqGSIb3DQEBCwUAA4IBAQBmM6RJzsGGipxyMhimHKN2xlkejhVsgBoTAhOU0llW9aUSwINJ9zFUGgI8IzUFy1VG776fchHp0LMRmPSIUYk5btEPxbsrPtumPuMH8EQGrS+Rt4pD+78c8H1fEPkq5CmDl/PKu4JoFGv+aFcE+Od0hlILstIF10Qysf++QXDolKfzJa/56bgMeYKFiju73loiRM57ns8ddXpfLl792UVpRkFU62LNns6Y1LKTwapmUF4IvIuAIzd6LZNOQng64LAKXtKnViJ1JQiXwf4CEzhgvAti3/ejpb3U90hsrUcyZi6wBv9bZLcAJRWpz61JNYliM1d1grSwQDKGXNQE4xuM"))) + .withRadiusClientRootCertificates(Arrays.asList( + new VpnServerConfigRadiusClientRootCertificate().withName("vpnServerConfigRadiusClientRootCert1") + .withThumbprint("83FFBFC8848B5A5836C94D0112367E16148A286F"))) + .withVpnClientIpsecPolicies(Arrays.asList(new IpsecPolicy().withSaLifeTimeSeconds(86472) + .withSaDataSizeKilobytes(429497) + .withIpsecEncryption(IpsecEncryption.AES256) + .withIpsecIntegrity(IpsecIntegrity.SHA256) + .withIkeEncryption(IkeEncryption.AES256) + .withIkeIntegrity(IkeIntegrity.SHA384) + .withDhGroup(DhGroup.DHGROUP14) + .withPfsGroup(PfsGroup.PFS14))) + .withRadiusServers(Arrays.asList(new RadiusServer().withRadiusServerAddress("10.0.0.0") + .withRadiusServerScore(25L) + .withRadiusServerSecret("fakeTokenPlaceholder"))) + .withConfigurationPolicyGroups(Arrays.asList(new VpnServerConfigurationPolicyGroupInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup1") + .withName("policyGroup1") + .withIsDefault(true) + .withPriority(0) + .withPolicyMembers(Arrays.asList(new VpnServerConfigurationPolicyGroupMember().withName("policy1") + .withAttributeType(VpnPolicyMemberAttributeType.RADIUS_AZURE_GROUP_ID) + .withAttributeValue("6ad1bd08"))), + new VpnServerConfigurationPolicyGroupInner().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfiguration1/vpnServerConfigurationPolicyGroups/policyGroup2") + .withName("policyGroup2") + .withIsDefault(true) + .withPriority(0) + .withPolicyMembers(Arrays.asList(new VpnServerConfigurationPolicyGroupMember().withName("policy2") + .withAttributeType(VpnPolicyMemberAttributeType.CERTIFICATE_GROUP_ID) + .withAttributeValue("red.com"))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..200e57ebc9d54 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsDeleteSamples.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.generated; + +/** + * Samples for VpnServerConfigurations Delete. + */ +public final class VpnServerConfigurationsDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationDelete. + * json + */ + /** + * Sample code: VpnServerConfigurationDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations().delete("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..60b3d4e177679 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsGetByResourceGroupSamples.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.generated; + +/** + * Samples for VpnServerConfigurations GetByResourceGroup. + */ +public final class VpnServerConfigurationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationGet. + * json + */ + /** + * Sample code: VpnServerConfigurationGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnServerConfigurationGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations() + .getByResourceGroupWithResponse("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..9152fa51553e8 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListByResourceGroupSamples.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.generated; + +/** + * Samples for VpnServerConfigurations ListByResourceGroup. + */ +public final class VpnServerConfigurationsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnServerConfigurationListByResourceGroup.json + */ + /** + * Sample code: VpnServerConfigurationListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListSamples.java new file mode 100644 index 0000000000000..55578c53915fa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsListSamples.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.generated; + +/** + * Samples for VpnServerConfigurations List. + */ +public final class VpnServerConfigurationsListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnServerConfigurationList. + * json + */ + /** + * Sample code: VpnServerConfigurationList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnServerConfigurationList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnServerConfigurations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsUpdateTagsSamples.java new file mode 100644 index 0000000000000..2006ac6328d2c --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnServerConfigurationsUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnServerConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnServerConfigurations UpdateTags. + */ +public final class VpnServerConfigurationsUpdateTagsSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * VpnServerConfigurationUpdateTags.json + */ + /** + * Sample code: VpnServerConfigurationUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnServerConfigurationUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VpnServerConfiguration resource = manager.vpnServerConfigurations() + .getByResourceGroupWithResponse("rg1", "vpnServerConfiguration1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinkConnectionsGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinkConnectionsGetSamples.java new file mode 100644 index 0000000000000..a9fcb8ec1f400 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinkConnectionsGetSamples.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.generated; + +/** + * Samples for VpnSiteLinkConnections Get. + */ +public final class VpnSiteLinkConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkConnectionGet.json + */ + /** + * Sample code: VpnSiteLinkConnectionGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteLinkConnectionGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSiteLinkConnections() + .getWithResponse("rg1", "gateway1", "vpnConnection1", "Connection-Link1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksGetSamples.java new file mode 100644 index 0000000000000..93f9c88d345ae --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnSiteLinks Get. + */ +public final class VpnSiteLinksGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkGet.json + */ + /** + * Sample code: VpnSiteGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSiteLinks().getWithResponse("rg1", "vpnSite1", "vpnSiteLink1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksListByVpnSiteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksListByVpnSiteSamples.java new file mode 100644 index 0000000000000..428f952e00516 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSiteLinksListByVpnSiteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnSiteLinks ListByVpnSite. + */ +public final class VpnSiteLinksListByVpnSiteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteLinkListByVpnSite.json + */ + /** + * Sample code: VpnSiteLinkListByVpnSite. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteLinkListByVpnSite(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSiteLinks().listByVpnSite("rg1", "vpnSite1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesConfigurationDownloadSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesConfigurationDownloadSamples.java new file mode 100644 index 0000000000000..ab5f16bac335f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesConfigurationDownloadSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.GetVpnSitesConfigurationRequest; +import java.util.Arrays; + +/** + * Samples for VpnSitesConfiguration Download. + */ +public final class VpnSitesConfigurationDownloadSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSitesConfigurationDownload + * .json + */ + /** + * Sample code: VpnSitesConfigurationDownload. + * + * @param manager Entry point to NetworkManager. + */ + public static void + vpnSitesConfigurationDownload(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSitesConfigurations() + .download("rg1", "wan1", new GetVpnSitesConfigurationRequest() + .withVpnSites( + Arrays.asList("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/vpnSites/abc")) + .withOutputBlobSasUrl( + "https://blobcortextesturl.blob.core.windows.net/folderforconfig/vpnFile?sp=rw&se=2018-01-10T03%3A42%3A04Z&sv=2017-04-17&sig=WvXrT5bDmDFfgHs%2Brz%2BjAu123eRCNE9BO0eQYcPDT7pY%3D&sr=b"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..769987dd3958d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.network.generated.fluent.models.VpnSiteLinkInner; +import com.azure.resourcemanager.network.generated.models.AddressSpace; +import com.azure.resourcemanager.network.generated.models.O365BreakOutCategoryPolicies; +import com.azure.resourcemanager.network.generated.models.O365PolicyProperties; +import com.azure.resourcemanager.network.generated.models.VpnLinkBgpSettings; +import com.azure.resourcemanager.network.generated.models.VpnLinkProviderProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnSites CreateOrUpdate. + */ +public final class VpnSitesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSitePut.json + */ + /** + * Sample code: VpnSiteCreate. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteCreate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites() + .define("vpnSite1") + .withRegion("West US") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withVirtualWan(new SubResource() + .withId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWANs/wan1")) + .withAddressSpace(new AddressSpace().withAddressPrefixes(Arrays.asList("10.0.0.0/16"))) + .withIsSecuritySite(false) + .withVpnSiteLinks(Arrays.asList(new VpnSiteLinkInner().withName("vpnSiteLink1") + .withLinkProperties( + new VpnLinkProviderProperties().withLinkProviderName("vendor1").withLinkSpeedInMbps(0)) + .withIpAddress("50.50.50.56") + .withFqdn("link1.vpnsite1.contoso.com") + .withBgpProperties(new VpnLinkBgpSettings().withAsn(1234L).withBgpPeeringAddress("192.168.0.0")))) + .withO365Policy(new O365PolicyProperties().withBreakOutCategories( + new O365BreakOutCategoryPolicies().withAllow(true).withOptimize(true).withDefaultProperty(false))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesDeleteSamples.java new file mode 100644 index 0000000000000..9f2dede71333d --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnSites Delete. + */ +public final class VpnSitesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteDelete.json + */ + /** + * Sample code: VpnSiteDelete. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteDelete(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().delete("rg1", "vpnSite1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..c20051d476878 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnSites GetByResourceGroup. + */ +public final class VpnSitesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteGet.json + */ + /** + * Sample code: VpnSiteGet. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteGet(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().getByResourceGroupWithResponse("rg1", "vpnSite1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..e14a388cd6e3a --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListByResourceGroupSamples.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.generated; + +/** + * Samples for VpnSites ListByResourceGroup. + */ +public final class VpnSitesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteListByResourceGroup. + * json + */ + /** + * Sample code: VpnSiteListByResourceGroup. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteListByResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListSamples.java new file mode 100644 index 0000000000000..20d1e90503b9f --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for VpnSites List. + */ +public final class VpnSitesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteList.json + */ + /** + * Sample code: VpnSiteList. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteList(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.vpnSites().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesUpdateTagsSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesUpdateTagsSamples.java new file mode 100644 index 0000000000000..c3e719c62cabc --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/VpnSitesUpdateTagsSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.VpnSite; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for VpnSites UpdateTags. + */ +public final class VpnSitesUpdateTagsSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/VpnSiteUpdateTags.json + */ + /** + * Sample code: VpnSiteUpdate. + * + * @param manager Entry point to NetworkManager. + */ + public static void vpnSiteUpdate(com.azure.resourcemanager.network.generated.NetworkManager manager) { + VpnSite resource = manager.vpnSites() + .getByResourceGroupWithResponse("rg1", "vpnSite1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesCreateOrUpdateSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..857172f2fb3f9 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.network.generated.models.ActionType; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallRateLimitDuration; +import com.azure.resourcemanager.network.generated.models.ApplicationGatewayFirewallUserSessionVariable; +import com.azure.resourcemanager.network.generated.models.ExceptionEntry; +import com.azure.resourcemanager.network.generated.models.ExceptionEntryMatchVariable; +import com.azure.resourcemanager.network.generated.models.ExceptionEntrySelectorMatchOperator; +import com.azure.resourcemanager.network.generated.models.ExceptionEntryValueMatchOperator; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRule; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleGroup; +import com.azure.resourcemanager.network.generated.models.ExclusionManagedRuleSet; +import com.azure.resourcemanager.network.generated.models.GroupByUserSession; +import com.azure.resourcemanager.network.generated.models.GroupByVariable; +import com.azure.resourcemanager.network.generated.models.ManagedRuleEnabledState; +import com.azure.resourcemanager.network.generated.models.ManagedRuleGroupOverride; +import com.azure.resourcemanager.network.generated.models.ManagedRuleOverride; +import com.azure.resourcemanager.network.generated.models.ManagedRuleSet; +import com.azure.resourcemanager.network.generated.models.ManagedRulesDefinition; +import com.azure.resourcemanager.network.generated.models.MatchCondition; +import com.azure.resourcemanager.network.generated.models.MatchVariable; +import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntry; +import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntryMatchVariable; +import com.azure.resourcemanager.network.generated.models.OwaspCrsExclusionEntrySelectorMatchOperator; +import com.azure.resourcemanager.network.generated.models.PolicySettings; +import com.azure.resourcemanager.network.generated.models.PolicySettingsLogScrubbing; +import com.azure.resourcemanager.network.generated.models.ScrubbingRuleEntryMatchOperator; +import com.azure.resourcemanager.network.generated.models.ScrubbingRuleEntryMatchVariable; +import com.azure.resourcemanager.network.generated.models.ScrubbingRuleEntryState; +import com.azure.resourcemanager.network.generated.models.SensitivityType; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallAction; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallCustomRule; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallMatchVariable; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallOperator; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallRuleType; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallScrubbingRules; +import com.azure.resourcemanager.network.generated.models.WebApplicationFirewallScrubbingState; +import java.util.Arrays; + +/** + * Samples for WebApplicationFirewallPolicies CreateOrUpdate. + */ +public final class WebApplicationFirewallPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafPolicyCreateOrUpdate.json + */ + /** + * Sample code: Creates or updates a WAF policy within a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void createsOrUpdatesAWAFPolicyWithinAResourceGroup( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies() + .define("Policy1") + .withRegion("WestUs") + .withExistingResourceGroup("rg1") + .withPolicySettings(new PolicySettings() + .withLogScrubbing( + new PolicySettingsLogScrubbing().withState(WebApplicationFirewallScrubbingState.ENABLED) + .withScrubbingRules(Arrays.asList( + new WebApplicationFirewallScrubbingRules() + .withMatchVariable(ScrubbingRuleEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(ScrubbingRuleEntryMatchOperator.EQUALS) + .withSelector("test") + .withState(ScrubbingRuleEntryState.ENABLED), + new WebApplicationFirewallScrubbingRules() + .withMatchVariable(ScrubbingRuleEntryMatchVariable.REQUEST_IPADDRESS) + .withSelectorMatchOperator(ScrubbingRuleEntryMatchOperator.EQUALS_ANY) + .withState(ScrubbingRuleEntryState.ENABLED)))) + .withJsChallengeCookieExpirationInMins(100)) + .withCustomRules( + Arrays + .asList( + new WebApplicationFirewallCustomRule().withName("Rule1") + .withPriority(1) + .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE) + .withMatchConditions(Arrays.asList(new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withMatchValues(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")))) + .withAction(WebApplicationFirewallAction.BLOCK), + new WebApplicationFirewallCustomRule().withName("Rule2") + .withPriority(2) + .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE) + .withMatchConditions(Arrays.asList( + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withMatchValues(Arrays.asList("192.168.1.0/24")), + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REQUEST_HEADERS) + .withSelector("UserAgent"))) + .withOperator(WebApplicationFirewallOperator.CONTAINS) + .withMatchValues(Arrays.asList("Windows")))) + .withAction(WebApplicationFirewallAction.BLOCK), + new WebApplicationFirewallCustomRule().withName("RateLimitRule3") + .withPriority(3) + .withRateLimitDuration(ApplicationGatewayFirewallRateLimitDuration.ONE_MIN) + .withRateLimitThreshold(10) + .withRuleType(WebApplicationFirewallRuleType.RATE_LIMIT_RULE) + .withMatchConditions(Arrays.asList(new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withNegationConditon(true) + .withMatchValues(Arrays.asList("192.168.1.0/24", "10.0.0.0/24")))) + .withGroupByUserSession( + Arrays.asList( + new GroupByUserSession().withGroupByVariables(Arrays.asList(new GroupByVariable() + .withVariableName(ApplicationGatewayFirewallUserSessionVariable.CLIENT_ADDR))))) + .withAction(WebApplicationFirewallAction.BLOCK), + new WebApplicationFirewallCustomRule().withName("Rule4") + .withPriority(4) + .withRuleType(WebApplicationFirewallRuleType.MATCH_RULE) + .withMatchConditions(Arrays.asList( + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REMOTE_ADDR))) + .withOperator(WebApplicationFirewallOperator.IPMATCH) + .withMatchValues(Arrays.asList("192.168.1.0/24")), + new MatchCondition() + .withMatchVariables(Arrays.asList(new MatchVariable() + .withVariableName(WebApplicationFirewallMatchVariable.REQUEST_HEADERS) + .withSelector("UserAgent"))) + .withOperator(WebApplicationFirewallOperator.CONTAINS) + .withMatchValues(Arrays.asList("Bot")))) + .withAction(WebApplicationFirewallAction.JSCHALLENGE))) + .withManagedRules(new ManagedRulesDefinition() + .withExceptions(Arrays.asList(new ExceptionEntry() + .withMatchVariable(ExceptionEntryMatchVariable.REQUEST_URI) + .withValues(Arrays.asList("health", "account/images", "default.aspx")) + .withValueMatchOperator(ExceptionEntryValueMatchOperator.CONTAINS) + .withExceptionManagedRuleSets(Arrays.asList(new ExclusionManagedRuleSet() + .withRuleSetType("OWASP") + .withRuleSetVersion("3.2"))), + new ExceptionEntry().withMatchVariable(ExceptionEntryMatchVariable.REQUEST_HEADER) + .withValues(Arrays.asList("Mozilla/5.0", "Chrome/122.0.0.0")) + .withValueMatchOperator(ExceptionEntryValueMatchOperator.CONTAINS) + .withSelectorMatchOperator(ExceptionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("User-Agent") + .withExceptionManagedRuleSets( + Arrays.asList(new ExclusionManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.2") + .withRuleGroups(Arrays.asList(new ExclusionManagedRuleGroup() + .withRuleGroupName("REQUEST-932-APPLICATION-ATTACK-RCE"))))), + new ExceptionEntry().withMatchVariable(ExceptionEntryMatchVariable.REMOTE_ADDR) + .withValues(Arrays.asList("1.2.3.4", "10.0.0.1/6")) + .withValueMatchOperator(ExceptionEntryValueMatchOperator.IPMATCH) + .withExceptionManagedRuleSets(Arrays.asList(new ExclusionManagedRuleSet() + .withRuleSetType("Microsoft_BotManagerRuleSet") + .withRuleSetVersion("1.0") + .withRuleGroups(Arrays.asList(new ExclusionManagedRuleGroup().withRuleGroupName("BadBots") + .withRules(Arrays.asList(new ExclusionManagedRule().withRuleId("100100"))))))))) + .withExclusions( + Arrays + .asList( + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("hello") + .withExclusionManagedRuleSets( + Arrays + .asList( + new ExclusionManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.2") + .withRuleGroups(Arrays.asList( + new ExclusionManagedRuleGroup() + .withRuleGroupName("REQUEST-930-APPLICATION-ATTACK-LFI") + .withRules(Arrays + .asList(new ExclusionManagedRule().withRuleId("930120"))), + new ExclusionManagedRuleGroup() + .withRuleGroupName("REQUEST-932-APPLICATION-ATTACK-RCE"))))), + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.ENDS_WITH) + .withSelector("hello") + .withExclusionManagedRuleSets( + Arrays.asList(new ExclusionManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.1") + .withRuleGroups(Arrays.asList()))), + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_NAMES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("test"), + new OwaspCrsExclusionEntry() + .withMatchVariable(OwaspCrsExclusionEntryMatchVariable.REQUEST_ARG_VALUES) + .withSelectorMatchOperator(OwaspCrsExclusionEntrySelectorMatchOperator.STARTS_WITH) + .withSelector("test"))) + .withManagedRuleSets( + Arrays + .asList( + new ManagedRuleSet().withRuleSetType("OWASP") + .withRuleSetVersion("3.2") + .withRuleGroupOverrides(Arrays.asList(new ManagedRuleGroupOverride() + .withRuleGroupName("REQUEST-931-APPLICATION-ATTACK-RFI") + .withRules(Arrays.asList( + new ManagedRuleOverride().withRuleId("931120") + .withState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.LOG), + new ManagedRuleOverride().withRuleId("931130") + .withState(ManagedRuleEnabledState.DISABLED) + .withAction(ActionType.ANOMALY_SCORING))))), + new ManagedRuleSet().withRuleSetType("Microsoft_BotManagerRuleSet") + .withRuleSetVersion("1.0") + .withRuleGroupOverrides( + Arrays.asList(new ManagedRuleGroupOverride().withRuleGroupName("UnknownBots") + .withRules(Arrays.asList(new ManagedRuleOverride().withRuleId("300700") + .withState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.JSCHALLENGE))))), + new ManagedRuleSet().withRuleSetType("Microsoft_HTTPDDoSRuleSet") + .withRuleSetVersion("1.0") + .withRuleGroupOverrides( + Arrays.asList(new ManagedRuleGroupOverride().withRuleGroupName("ExcessiveRequests") + .withRules(Arrays.asList(new ManagedRuleOverride().withRuleId("500100") + .withState(ManagedRuleEnabledState.ENABLED) + .withAction(ActionType.BLOCK) + .withSensitivity(SensitivityType.HIGH)))))))) + .create(); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesDeleteSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesDeleteSamples.java new file mode 100644 index 0000000000000..cd9f7c3ae7e17 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesDeleteSamples.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.generated; + +/** + * Samples for WebApplicationFirewallPolicies Delete. + */ +public final class WebApplicationFirewallPoliciesDeleteSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafPolicyDelete.json + */ + /** + * Sample code: Deletes a WAF policy within a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + deletesAWAFPolicyWithinAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies().delete("rg1", "Policy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesGetByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d1ce6f279fafa --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesGetByResourceGroupSamples.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.generated; + +/** + * Samples for WebApplicationFirewallPolicies GetByResourceGroup. + */ +public final class WebApplicationFirewallPoliciesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafPolicyGet.json + */ + /** + * Sample code: Gets a WAF policy within a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + getsAWAFPolicyWithinAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies() + .getByResourceGroupWithResponse("rg1", "Policy1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListByResourceGroupSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..483119a8badbb --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListByResourceGroupSamples.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.generated; + +/** + * Samples for WebApplicationFirewallPolicies ListByResourceGroup. + */ +public final class WebApplicationFirewallPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafListPolicies.json + */ + /** + * Sample code: Lists all WAF policies in a resource group. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listsAllWAFPoliciesInAResourceGroup(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListSamples.java new file mode 100644 index 0000000000000..ad7384fc1d974 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebApplicationFirewallPoliciesListSamples.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.generated; + +/** + * Samples for WebApplicationFirewallPolicies List. + */ +public final class WebApplicationFirewallPoliciesListSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/WafListAllPolicies.json + */ + /** + * Sample code: Lists all WAF policies in a subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void + listsAllWAFPoliciesInASubscription(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webApplicationFirewallPolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesGetSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesGetSamples.java new file mode 100644 index 0000000000000..36d99a43c0985 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.network.generated.generated; + +/** + * Samples for WebCategories Get. + */ +public final class WebCategoriesGetSamples { + /* + * x-ms-original-file: + * specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/AzureWebCategoryGet.json + */ + /** + * Sample code: Get Azure Web Category by name. + * + * @param manager Entry point to NetworkManager. + */ + public static void getAzureWebCategoryByName(com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webCategories().getWithResponse("Arts", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesListSamples.java b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesListSamples.java new file mode 100644 index 0000000000000..d4a40769fdc42 --- /dev/null +++ b/sdk/network/azure-resourcemanager-network-generated/src/samples/java/com/azure/resourcemanager/network/generated/generated/WebCategoriesListSamples.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.generated; + +/** + * Samples for WebCategories List. + */ +public final class WebCategoriesListSamples { + /* + * x-ms-original-file: specification/network/resource-manager/Microsoft.Network/stable/2024-03-01/examples/ + * AzureWebCategoriesListBySubscription.json + */ + /** + * Sample code: List all Azure Web Categories for a given subscription. + * + * @param manager Entry point to NetworkManager. + */ + public static void listAllAzureWebCategoriesForAGivenSubscription( + com.azure.resourcemanager.network.generated.NetworkManager manager) { + manager.webCategories().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/network/ci.yml b/sdk/network/ci.yml new file mode 100644 index 0000000000000..03c04d893ce29 --- /dev/null +++ b/sdk/network/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.yml + - sdk/network/azure-resourcemanager-network-generated/ + exclude: + - sdk/network/pom.xml + - sdk/network/azure-resourcemanager-network-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.yml + - sdk/network/azure-resourcemanager-network-generated/ + exclude: + - sdk/network/pom.xml + - sdk/network/azure-resourcemanager-network-generated/pom.xml + +parameters: + - name: release_azureresourcemanagernetworkgenerated + displayName: azure-resourcemanager-network-generated + type: boolean + default: false + +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 + releaseInBatch: ${{ parameters.release_azureresourcemanagernetworkgenerated }} diff --git a/sdk/network/pom.xml b/sdk/network/pom.xml new file mode 100644 index 0000000000000..eb90da0398e16 --- /dev/null +++ b/sdk/network/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-network-service + pom + 1.0.0 + + + azure-resourcemanager-network-generated + +